Skip to content
Free planNo credit card requiredStart writing

article · Applied Sciences · 2025

Refactoring for Java-Structured Concurrency

Yang Zhang, Gaojie Shen, Liyan Zhang, Meiyan Zheng, Kun Zheng

Cited by 0Open access

Abstract

Structured concurrency treats multiple tasks running in different threads as a single unit, thereby improving reliability and enhancing observability. The existing IDE (Integrated Development Environment) does not provide sufficient support to leverage such an advanced structure and conduct refactoring automatically. Manual refactoring is tedious and error prone. There is an urgent need to provide adequate support to perform automatic refactoring. To this end, this paper proposes ReStruct, an automatic refactoring approach to transform unstructured concurrency to structured concurrency. ReStruct first employs visitor pattern analysis to acquire the target code for refactoring and then performs a precondition to filter out the code that meets the refactoring criteria. Subsequently, it performs scope analysis to guide the refactoring process. Finally, ReStruct performs refactoring on the AST of the source program. ReStruct is implemented as an Eclipse plugin and is evaluated in seven real-world projects via the number of refactorings and changes to LOCs (lines of code), time, and performance after refactoring. The experimental results illustrate that a total of 82 unstructured codes are refactored, with an average of 27.3 s per project. Furthermore, the performances of these refactored projects are improved by an average of 6.5%, demonstrating its effectiveness.

Cite this paper

APA 7

Zhang, Y., Shen, G., Zhang, L., Zheng, M., & Zheng, K. (2025). Refactoring for Java-Structured Concurrency. Applied Sciences, 15(5), 2407. https://doi.org/10.3390/app15052407

MLA 9

Zhang, Yang, et al. “Refactoring for Java-Structured Concurrency.” Applied Sciences, vol. 15, no. 5, 2025, p. 2407, https://doi.org/10.3390/app15052407.

Chicago

Zhang, Yang, Gaojie Shen, Liyan Zhang, Meiyan Zheng, and Kun Zheng. 2025. “Refactoring for Java-Structured Concurrency.” Applied Sciences 15 (5): 2407. https://doi.org/10.3390/app15052407.

Harvard

Zhang, Y. et al. (2025) ‘Refactoring for Java-Structured Concurrency’, Applied Sciences, 15(5), p. 2407. Available at: https://doi.org/10.3390/app15052407.

BibTeX
@article{zhang2025refactoring,
  title = {{Refactoring for Java-Structured Concurrency}},
  author = {Zhang, Yang and Shen, Gaojie and Zhang, Liyan and Zheng, Meiyan and Zheng, Kun},
  journal = {Applied Sciences},
  volume = {15},
  number = {5},
  pages = {2407},
  year = {2025},
  doi = {10.3390/app15052407}
}

Made from the index record. Check names, capitalisation and page numbers against the paper. Need another style? AI for Research has over 10,000.