REPFINDER: Finding Replacements for Missing APIs in Library Update
Kaifeng Huang, Bihuan Chen, Linghao Pan, Shuai Wu, Xin Peng
Abstract
Libraries are widely adopted in developing software projects. Library APIs are often missing during library evolution as library developers may deprecate, remove or refactor APIs. As a result, client developers have to manually find replacement APIs for missing APIs when updating library versions in their projects, which is a difficult and expensive software maintenance task. One of the key limitations of the existing automated approaches is that they usually consider the library itself as the single source to find replacement APIs, which heavily limits their accuracy. In this paper, we first present an empirical study to understand characteristics about missing APIs and their replacements. Specifically, we quantify the prevalence of missing APIs, and summarize the knowledge sources where the replacements are found, and the code change and mapping cardinality between missing APIs and their replacements. Then, inspired by the insights from our study, we propose a heuristic-based approach, REPFINDER, to automatically find replacements for missing APIs in library update. We design and combine a set of heuristics to hierarchically search three sources (deprecation message, own library, and external library) for finding replacements. Our evaluation has demonstrated that REPFINDER can find replacement APIs effectively and efficiently, and significantly outperform the state-of-the-art approaches. TABLE I. Examples of Missing APIs and Their Replacements in Library Update No. Library Version Update Missing API Replacement API Source 1 org.mapdb mapdb 0.9.3 0.9.13 org.mapdb. DBMaker.writeAheadLogDisable() org.mapdb. DBMaker.transactionDisable() Deprecation Message 2 org.apache.lucene lucene-core 5.1.0 6.0.0 org.apache.lucene.search. PhraseQuery.add(Term) org.apache.lucene.search. PhraseQuery.Builder.add(Term) Own Library 3 org.apache.lucene lucene-core 3.0.3 4.0.0 org.apache.lucene.analysis.standard. StandardAnalyzer.StandardAnalyzer(Version) org.apache.lucene.analysis.standard. StandardAnalyzer.StandardAnalyzer(Version) Vendor Library 4 org.elasticsearch elasticsearch 1.7.1 2.0.0 org.elasticsearch.common.joda.time.format. DateTimeFormatter.print(long) org.joda.time.format. DateTimeFormatter.print(long) Dependency Library 5 org.elasticsearch elasticsearch 0.20.6 1.2.1 org.elasticsearch.common.trove.list.array. TIntArrayList.toArray()
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 3f4c1d81-d6d9-4ced-9af2-cf866e22ba64Cited by top-tier papers2
- LLMs Meet Library Evolution: Evaluating Deprecated API Usage in LLM-Based Code CompletionChong Wang, Kaifeng Huang, Jian Zhang, Yebo Feng et al.ICSE 2025 · 3 citations
- Your "Notice" Is Missing: Detecting and Fixing Violations of Modification Terms in Open Source Licenses during ForkingKaifeng Huang, Yingfeng Xia, Bihuan Chen, Siyang He et al.ISSTA 2024 · 3 citations
Builds on8
- Small World with High Risks: A Study of Security Threats in the npm EcosystemMarkus Zimmermann, Cristian-Alexandru Staicu, Cam Tenny, Michael PradelUSENIX Security 2019 · 281 citations
- Keep me Updated: An Empirical Study of Third-Party Library Updatability on AndroidErik Derr, Sven Bugiel, Sascha Fahl, Yasemin Acar et al.CCS 2017 · 196 citations
- Thou Shalt Not Depend on Me: Analysing the Use of Outdated JavaScript Libraries on the WebTobias Lauinger, Abdelberi Chaabane, Sajjad Arshad, William Robertson et al.NDSS 2017 · 183 citations
- Watchman: monitoring dependency conflicts for Python library ecosystemYing Wang, Ming Wen, Yepang Liu, Yibo Wang et al.ICSE 2020 · 65 citations
- Exploring how deprecated Python library APIs are (not) handledJiawei Wang, Li Li, Kui Liu, Haipeng CaiFSE 2020 · 52 citations
Related papers
- Compiler-directed Migrating API Callsite of Client CodeHao Zhong, Na MengICSE 2024 · 5 citations
- Interactive, effort-aware library version harmonizationKaifeng Huang, Bihuan Chen, Bowen Shi, Ying Wang et al.FSE 2020 · 32 citations
- Understanding Breaking Changes in the WildDhanushka Jayasuriya, Valerio Terragni, Jens Dietrich, Samuel Ou et al.ISSTA 2023 · 19 citations
- Break to Adapt: Knowledge-Based Updates of Breaking Dependencies in JavaScriptYifan Xia, Chengwei Liu, Zifan Xie, Lyuye Zhang et al.FSE 2026
- Recommending Analogical APIs via Knowledge Graph EmbeddingMingwei Liu, Yanjun Yang, Yiling Lou, Xin Peng et al.FSE 2023 · 8 citations
