Refactoring for Java']Java-Structured Concurrency

被引:0
作者
Zhang, Yang [1 ]
Shen, Gaojie [1 ]
Zhang, Liyan [1 ]
Zheng, Meiyan [1 ]
Zheng, Kun [1 ]
机构
[1] Hebei Univ Sci & Technol, Sch Informat Sci & Engn, Shijiazhuang 050000, Peoples R China
来源
APPLIED SCIENCES-BASEL | 2025年 / 15卷 / 05期
关键词
refactoring; structured concurrency; program analysis; parallel programming;
D O I
10.3390/app15052407
中图分类号
O6 [化学];
学科分类号
0703 ;
摘要
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.
引用
收藏
页数:21
相关论文
共 31 条
[1]  
[Anonymous], 2023, 2023-2024 Baldrige Excellence Framework: Proven Leadership and Management Practices for High Performance
[2]  
[Anonymous], 2021, ThoughtFlow Combines New Java Features into Practical Applications (ModernJava)
[3]  
[Anonymous], 2023, JetBrains Java Development Kit
[4]  
[Anonymous], 2018, Smith Notes on Structured Concurrency
[5]  
[Anonymous], 2023, TrackMate Biomedical Imaging
[6]  
[Anonymous], 2021, OpenJDK Jmh, a Tool for Java Program Testing
[7]  
Apache Flexible, 2023, Scalable Machine Learning Platform (SystemML)
[8]  
Bateman C.M., 2007, GAME WRITING NARRATI
[9]  
Beroni D., 2021, P 2021 44 INT CONV I, P1684
[10]  
Beronic D., 2022, 2022 45th Jubilee International Convention on Information, Communication and Electronic Technology (MIPRO)., P1466, DOI 10.23919/MIPRO55190.2022.9803765