Treffer: A Thought on Refactoring Java Loops Using Java 8 Streams

Title:
A Thought on Refactoring Java Loops Using Java 8 Streams
Source:
Departmental Technical Reports (CS)
Publisher Information:
ScholarWorks@UTEP
Publication Year:
2017
Collection:
University of Texas at El Paso: Digital Commons@UTEP
Document Type:
Fachzeitschrift text
File Description:
application/pdf
Language:
unknown
Accession Number:
edsbas.CD661B76
Database:
BASE

Weitere Informationen

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.