License Compatibility Detection for OpenJavaWorks Open-Source Projects Based on Code Similarity
Xiaotong Wang, Huiqun Yu, Guisheng Fan, Yuguo Liang, Wentao Chen, Jingyi Liu · 2025
This study investigates the relationship between code similarity and open-source license compatibility in Java projects. While the extensive use of open-source projects promotes code reuse, it also poses challenges concerning license compatibility. Current license detection methods often overlook code similarities and the degree of sharing among projects. To address these issues, we pave a new research path in the field of license compatibility, with a particular focus on the correlation between code similarity and license compatibility. Unlike traditional methods that focus on individual projects, this research offers a comprehensive approach that identifies potential license compatibility issues both within and across multiple projects. Our analysis employs the BigCloneBench (BCB) dataset and conducts a large-scale empirical study on 746,048 Java open-source projects, which we collected and labeled as OJW. Findings indicate that 11.9% of multi-license projects face compatibility issues, while 23.7% of project pairs with over 70% code similarity demonstrate license incompatibility. This innovative approach not only overcomes the limitations of existing research but also provides developers with a practical tool to reduce legal risks during code reuse, ensuring compliance in open-source software.