Open Access. Powered by Scholars. Published by Universities.®

Physical Sciences and Mathematics Commons

Open Access. Powered by Scholars. Published by Universities.®

Computer Sciences

PDF

City University of New York (CUNY)

Series

Java 8

Articles 1 - 11 of 11

Full-Text Articles in Physical Sciences and Mathematics

An Empirical Study On The Use And Misuse Of Java 8 Streams, Raffi T. Khatchadourian, Yiming Tang, Mehdi Bagherzadeh, Baishakhi Ray Apr 2020

An Empirical Study On The Use And Misuse Of Java 8 Streams, Raffi T. Khatchadourian, Yiming Tang, Mehdi Bagherzadeh, Baishakhi Ray

Publications and Research

Streaming APIs allow for big data processing of native data structures by providing MapReduce-like operations over these structures. However, unlike traditional big data systems, these data structures typically reside in shared memory accessed by multiple cores. Although popular, this emerging hybrid paradigm opens the door to possibly detrimental behavior, such as thread contention and bugs related to non-execution and non-determinism. This study explores the use and misuse of a popular streaming API, namely, Java 8 Streams. The focus is on how developers decide whether or not to run these operations sequentially or in parallel and bugs both specific and tangential …


Safe Automated Refactoring For Intelligent Parallelization Of Java 8 Streams, Raffi T. Khatchadourian, Yiming Tang, Mehdi Bagherzadeh Jan 2020

Safe Automated Refactoring For Intelligent Parallelization Of Java 8 Streams, Raffi T. Khatchadourian, Yiming Tang, Mehdi Bagherzadeh

Publications and Research

Streaming APIs are becoming more pervasive in mainstream Object-Oriented programming languages and platforms. For example, the Stream API introduced in Java 8 allows for functional-like, MapReduce-style operations in processing both finite, e.g., collections, and infinite data structures. However, using this API efficiently involves subtle considerations such as determining when it is best for stream operations to run in parallel, when running operations in parallel can be less efficient, and when it is safe to run in parallel due to possible lambda expression side-effects. ics-preserving fashion. The approach, based on a novel data ordering and typestate analysis, consists of preconditions and …


Safe Automated Refactoring For Intelligent Parallelization Of Java 8 Streams, Raffi T. Khatchadourian, Yiming Tang, Mehdi Bagherzadeh, Syed Ahmed Jul 2019

Safe Automated Refactoring For Intelligent Parallelization Of Java 8 Streams, Raffi T. Khatchadourian, Yiming Tang, Mehdi Bagherzadeh, Syed Ahmed

Publications and Research

Streaming APIs are becoming more pervasive in mainstream Object-Oriented programming languages and platforms. For example, the Stream API introduced in Java 8 allows for functional-like, MapReduce-style operations in processing both finite, e.g., collections, and infinite data structures. However, using this API efficiently involves subtle considerations such as determining when it is best for stream operations to run in parallel, when running operations in parallel can be less efficient, and when it is safe to run in parallel due to possible lambda expression side-effects. Also, streams may not run all operations in parallel depending on particular collectors used in reductions. In …


Safe Automated Refactoring For Intelligent Parallelization Of Java 8 Streams, Raffi T. Khatchadourian, Yiming Tang, Mehdi Bagherzadeh, Syed Ahmed May 2019

Safe Automated Refactoring For Intelligent Parallelization Of Java 8 Streams, Raffi T. Khatchadourian, Yiming Tang, Mehdi Bagherzadeh, Syed Ahmed

Publications and Research

Streaming APIs are becoming more pervasive in mainstream Object-Oriented programming languages. For example, the Stream API introduced in Java 8 allows for functional-like, MapReduce-style operations in processing both finite and infinite data structures. However, using this API efficiently involves subtle considerations like determining when it is best for stream operations to run in parallel, when running operations in parallel can be less efficient, and when it is safe to run in parallel due to possible lambda expression side-effects. In this paper, we present an automated refactoring approach that assists developers in writing efficient stream code in a semantics-preserving fashion. The …


A Tool For Optimizing Java 8 Stream Software Via Automated Refactoring, Raffi T. Khatchadourian, Yiming Tang, Mehdi Bagherzadeh, Syed Ahmed Sep 2018

A Tool For Optimizing Java 8 Stream Software Via Automated Refactoring, Raffi T. Khatchadourian, Yiming Tang, Mehdi Bagherzadeh, Syed Ahmed

Publications and Research

Streaming APIs are pervasive in mainstream Object-Oriented languages. For example, the Java 8 Stream API allows for functional-like, MapReduce-style operations in processing both finite and infinite data structures. However, using this API efficiently involves subtle considerations like determining when it is best for stream operations to run in parallel, when running operations in parallel can be less efficient, and when it is safe to run in parallel due to possible lambda expression side-effects. In this paper, we describe the engineering aspects of an open source automated refactoring tool called Optimize Streams that assists developers in writing optimal stream software in …


Poster: Towards Safe Refactoring For Intelligent Parallelization Of Java 8 Streams, Yiming Tang, Raffi T. Khatchadourian, Mehdi Bagherzadeh, Syed Ahmed May 2018

Poster: Towards Safe Refactoring For Intelligent Parallelization Of Java 8 Streams, Yiming Tang, Raffi T. Khatchadourian, Mehdi Bagherzadeh, Syed Ahmed

Publications and Research

The Java 8 Stream API sets forth a promising new programming model that incorporates functional-like, MapReduce-style features into a mainstream programming language. However, using streams correctly and efficiently may involve subtle considerations. In this poster, we present our ongoing work and preliminary results towards an automated refactoring approach that assists developers in writing optimal stream code. The approach, based on ordering and typestate analysis, determines when it is safe and advantageous to convert streams to parallel and optimize a parallel streams.


Poster: Towards Safe Refactoring For Intelligent Parallelization Of Java 8 Streams, Yiming Tang, Raffi T. Khatchadourian, Mehdi Bagherzadeh, Syed Ahmed Mar 2018

Poster: Towards Safe Refactoring For Intelligent Parallelization Of Java 8 Streams, Yiming Tang, Raffi T. Khatchadourian, Mehdi Bagherzadeh, Syed Ahmed

Publications and Research

The Java 8 Stream API sets forth a promising new programming model that incorporates functional-like, MapReduce-style features into a mainstream programming language. However, using streams correctly and efficiently may involve subtle considerations. In this poster, we present our ongoing work and preliminary results to- wards an automated refactoring approach that assists developers in writing optimal stream code. The approach, based on ordering and typestate analysis, determines when it is safe and advantageous to convert streams to parallel and optimize a parallel streams.


Automated Refactoring Of Legacy Java Software To Default Methods, Raffi T. Khatchadourian, Hidehiko Masuhara May 2017

Automated Refactoring Of Legacy Java Software To Default Methods, Raffi T. Khatchadourian, Hidehiko Masuhara

Publications and Research

Java 8 default methods, which allow interfaces to contain (instance) method implementations, are useful for the skeletal implementation software design pattern. However, it is not easy to transform existing software to exploit default methods as it requires analyzing complex type hierarchies, resolving multiple implementation inheritance issues, reconciling differences between class and interface methods, and analyzing tie-breakers (dispatch precedence) with overriding class methods to preserve type-correctness and confirm semantics preservation. In this paper, we present an efficient, fully-automated, type constraint-based refactoring approach that assists developers in taking advantage of enhanced interfaces for their legacy Java software. The approach features an extensive …


Automated Refactoring Of Legacy Java Software To Default Methods, Raffi T. Khatchadourian, Hidehiko Masuhara May 2017

Automated Refactoring Of Legacy Java Software To Default Methods, Raffi T. Khatchadourian, Hidehiko Masuhara

Publications and Research

Java 8 introduces enhanced interfaces, allowing for default (instance) methods that implementers will inherit if none are provided [3]. Default methods can be used [2] as a replacement of the skeletal implementation pattern [1], which creates abstract skeletal implementation classes that implementers extend. Migrating legacy code using the skeletal implementation pattern to instead use default methods can require significant manual effort due to subtle language and semantic restrictions. It requires preserving typecorrectness by analyzing complex type hierarchies, resolving issues arising from multiple inheritance, reconciling differences between class and interface methods, and ensuring tie-breakers with overriding class methods do not alter …


Porting The Netbeans Java 8 Enhanced For Loop Lambda Expression Refactoring To Eclipse, Md Arefin, Raffi T. Khatchadourian Oct 2015

Porting The Netbeans Java 8 Enhanced For Loop Lambda Expression Refactoring To Eclipse, Md Arefin, Raffi T. Khatchadourian

Publications and Research

Java 8 is one of the largest upgrades to the popular language and framework in over a decade. However, the Eclipse IDE is missing several key refactorings that could help developers take advantage of new features in Java 8 more easily. In this paper, we discuss our ongoing work in porting the enhanced for loop to lambda expression refactoring from the NetBeans IDE to Eclipse. We also discuss future plans for new Java 8 refactorings not found in any current IDE.


Porting The Netbeans Java 8 Enhanced For Loop Lambda Expression Refactoring To Eclipse, Md Arefin, Raffi T. Khatchadourian Oct 2015

Porting The Netbeans Java 8 Enhanced For Loop Lambda Expression Refactoring To Eclipse, Md Arefin, Raffi T. Khatchadourian

Publications and Research

Java 8 is one of the largest upgrades to the popular language and framework in over a decade. However, the Eclipse IDE is missing several key refactorings that could help developers take advantage of new features in Java 8 more easily. In this paper, we discuss our ongoing work in porting the enhanced for loop to lambda expression refactoring from the NetBeans IDE to Eclipse. We also discuss future plans for new Java 8 refactorings not found in any current IDE.