• Home
  • Search
  • Автоматический рефакторинг Java-кода с использованием Stream API
  • https://doi.org/10.25205/1818-7900-2019-17-2-49-60Copy DOI Icon

Автоматический рефакторинг Java-кода с использованием Stream API

Show More
  • Abstract
  • Literature Map
  • References
  • Similar Papers
Abstract

For a long time, functional Java programming was not possible. However, lambda expressions appeared in version 8 of the Java language. Due to the support of standard library classes (Stream, Optional, etc.) in Java, it became possible to describe transformations over data in a functional style. Java is a rather old language with a large imperative code base written in it. In order to take advantage of the new approach, it is necessary to perform a non-trivial refactoring, which can be very tedious and error prone when applied manually. Fortunately, for a sufficiently large number of situations, this refactoring can be safely performed automatically. Using IntelliJ Idea as a platform software tool was developed that allows you to find places where it is possible to automatically convert an imperative code to an equivalent code that uses Stream API, as well as an automatic fix that allows you to make a replacement. Refactoring uses IntelliJ Idea framework to analyze Java code, and integrates into the IDE itself. One of the main criteria for the correct operation of the algorithm is the security of this transformation. The user cannot trust the tool if the transformation can change the semantics of the code. This article discusses various constraints that are imposed on code patterns so that transformation without distortion of semantics is possible. Refactoring has been tested in various libraries to verify the semantics are preserved by checking the test results before and after applying refactoring. This article will not describe the impact of using the Stream API on the performance of the application.

Similar Papers
  • Conference Article
  • Citations1

Functional Classes: Cost of Recursive Method Call in Java

  • Aug 01, 2007
  • Hannu Mayra +1
  • Book Chapter
  • Citations21

JReq: Database Queries in Imperative Languages

  • Jan 01, 2010
  • Ming-Yee Iu +2
  • Conference Article

Ray Tracing Through Functional Programming Language Using OCaml with Comparative Performance Analysis

  • Jul 18, 2025
  • Poulomi Mukherjee +2
  • Conference Article

Interconnecting YAJCo with Xtext: Experience Report

  • Nov 01, 2019
  • Sergej Chodarev +1
  • Conference Article
  • Citations3

Lambda Calculus as a Workflow Model

  • May 01, 2008
  • Peter M Kelly +2
  • Research Article
  • Citations34

Safety of Nöcker's strictness analysis

  • Nov 08, 2007
  • Journal of Functional Programming
  • Manfred Schmidt-Schauss +2
  • Single Report

Functional Programming in Computer Science

  • Jan 19, 2016
  • Loren James Anderson +1
  • Research Article
  • Citations671

RacerX

  • Oct 19, 2003
  • ACM SIGOPS Operating Systems Review
  • Dawson Engler +1
  • Conference Article
  • Citations3

Deploying Smart Program Understanding on a Large Code Base

  • Apr 01, 2019
  • Carlo Ieva +3
  • Conference Article
  • Citations12

Scalable detection of missed cross-function refactorings

  • Jul 21, 2014
  • Narcisa Andreea Milea +2
  • Book Chapter
  • Citations3

Functional Data Structures

  • Oct 28, 2004
  • Chris Okasaki
  • Conference Article
  • Citations7

Compiling functional languages for SIMD architectures

  • Dec 02, 1991
  • G.K Jouret
  • Conference Article

Can Programming Be Liberated from the Functional Style?

  • Jun 12, 2025
  • Friedrich Steimann
  • Book Chapter
  • Citations4

A Parallel Intermediate Representation based on Lambda Expressions

  • Jan 01, 1991
  • Timothy A. Budd
  • Single Book
  • Citations171

Two-Level Functional Languages

  • Jul 16, 1992
  • Flemming Nielson +1
Cactus Communications logo

Copyright 2026 Cactus Communications. All rights reserved.