Work

A Thought on Refactoring Java Loops Using Java 8 Streams

Year: 2017
Type: article
Abstract: Java 8 has introduced a new abstraction called a stream to represent an immutable sequence of elements and to provide a variety of operations to be executed on the elements in series or in parallel. By processing a collection of data in a declarative way, it enables one to write more concise and clean code that can also leverage multi-core architectures without needing a single line of multithread code to be written. In this document, we describe our preliminary work on systematically refactoring loops with Java 8 streams to produce more concise and clean code. Our idea is to adapt existing work on analyzing loops and deriving their specifications written in a functional program verification style. Our extension is to define a set of transformation rules for loop patterns, one for each pattern, by decomposing the derived specification function into a series of stream operations.
Language: English
Subfield: Software
Open Access status: green
OpenAlex ID: W2759528399
FWCI: 0.336
Cites: 8
Cited by: 1
Related to: 10