Breaking Strong Encapsulation: A Comprehensive Study of Java Module Abuse
Yirui He, Yongbo Chen, Jessy Ayala, Yecheng Zhou, Qiran Wang, Joshua Garcia
Abstract
As an increasing number of software systems reach sizes of hundreds of millions of lines of code, relying solely on code-level abstractions is impractical, posing profound challenges to software maintenance. Java Platform Module System (JPMS) provides architectural abstractions that enable Java engineers to control the required and provided interfaces of a module. Despite numerous advantages of enforced strong encapsulation provided by JPMS, developers still break those encapsulations to access the internal elements of a module. Such practice is referred to as Breaking the Strong Encapsulation (BSE). This behavior not only complicates the migration to newer versions (e.g., Java 9) but also threatens the integrity and safety of software projects. Since the BSE problem is still underexplored, in this work, we conduct the first empirical study to identify and characterize this widespread and impactful problem. We first collect a comprehensive dataset containing 4,079 GitHub issues and then investigate those issues from various perspectives, including symptoms, abuse sources, desired functionalities, and resolutions. Our empirical study highlights a tension in the Java module system: module developers aim to enforce strong encapsulation while module users frequently attempt to break the encapsulation. Our finding also emphasizes the need for both practitioners and researchers to develop effective strategies to mitigate these problems, offering an understanding of BSE characteristics to inform future detection and repair efforts.
• Software and its engineering → Software architectures; Software evolution.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 11e9fadb-012f-48c8-9d6c-932dd526ce10Builds on10
- Taxonomy of real faults in deep learning systemsNargiz Humbatova, Gunel Jahangirova, Gabriele Bavota, Vincenzo Riccio et al.ICSE 2020 · 281 citations
- A comprehensive study of autonomous vehicle bugsJoshua Garcia, Yang Feng, Junjie Shen, Sumaya Almanee et al.ICSE 2020 · 127 citations
- An exploratory study of autopilot software bugs in unmanned aerial vehiclesDinghua Wang, Shuqing Li, Guanping Xiao, Yepang Liu et al.FSE 2021 · 60 citations
- A large-scale empirical study on Java library migrations: prevalence, trends, and rationalesHao He, Runzhi He, Haiqiao Gu, Minghui ZhouFSE 2021 · 47 citations
- Software Composition Analysis for Vulnerability Detection: An Empirical Study on Java ProjectsLida Zhao, Sen Chen, Zhengzi Xu, Chengwei Liu et al.FSE 2023 · 42 citations
Related papers
- Understanding type changes in JavaAmeya Ketkar, Nikolaos Tsantalis, Danny DigFSE 2020 · 17 citations
- Understanding Breaking Changes in the WildDhanushka Jayasuriya, Valerio Terragni, Jens Dietrich, Samuel Ou et al.ISSTA 2023 · 19 citations
- Has My Release Disobeyed Semantic Versioning? Static Detection Based on Semantic DifferencingLyuye Zhang, Chengwei Liu, Zhengzi Xu, Sen Chen et al.ASE 2022 · 30 citations
- Automatically Fixing Dependency Breaking ChangesLukas Fruntke, Jens KrinkeFSE 2025
- PairSmell: A Novel Perspective Inspecting Software Modular StructureChenxing Zhong, Daniel Feitosa, Paris Avgeriou, Huang Huang et al.ICSE 2025
