paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Static analysis of Java dynamic proxies

Java 动态代理的静态分析
ISSTA Proceedings of the 27th ACM SIGSOFT International Symposium on Software Testing and Analysis2018匹配度 3/10 · 论文属于静态分析与程序分析范畴,在 Doop 中建模 Java 动态代理语义,具备问题驱动和真实程序评估,但与用户核心关注的 LLM/Agent 与静态分析交叉、浮点程序分析、贝叶斯程序分析均无直接关联。引用 24 inbox
George Fourtounis, George Kastrinis, Yannis Smaragdakis
crossref: 2026-09-12

AI 速览

一句话:以简洁逻辑规则在 Doop 中建模 Java 动态代理语义,使静态分析得以穿透代理层。

动态代理是 Java 最常用的动态特性之一,允许运行时代码生成与链接,但由此产生的动态字节码层使现有静态分析无法穿透,导致大量代码不可达或建模不完整。本文观察到动态代理 API 的用法足够规整,因而可以静态建模。作者在 Doop 静态分析框架中,用一组简洁的逻辑规则直接刻画动态代理的语义,从而使 Doop 的标准分析能够处理代理背后的代码。评估基于真实 Java 程序语料 XCorpus:该方法完全处理了其中 95% 的代理创建点,并成功分析了大量此前不可达或建模不完整的代码,证明了动态特性可被静态分析有效捕获。

问题
Java 动态代理在运行时生成字节码层,现有静态分析无法穿透,导致大量被代理的代码不可达或建模不完整。
方法
利用动态代理 API 用法的规整性,在 Doop 静态分析框架中以一组简洁的逻辑规则建模动态代理语义。
评估
在真实 Java 程序语料 XCorpus 上评估,完全处理了 95% 的代理创建点,并分析了大量此前不可达或建模不完整的代码。
原文摘要(Abstract)

The dynamic proxy API is one of Java’s most widely-used dynamic features, permitting principled run-time code generation and link- ing. Dynamic proxies can implement any set of interfaces and for- ward method calls to a special object that handles them reflectively. The flexibility of dynamic proxies, however, comes at the cost of having a dynamically generated layer of bytecode that cannot be penetrated by current static analyses. In this paper, we observe that the dynamic proxy API is stylized enough to permit static analysis. We show how the semantics of dynamic proxies can be modeled in a straightforward manner as logical rules in the Doop static analysis framework. This concise set of rules enables Doop’s standard analyses to process code behind dynamic proxies. We evaluate our approach by analyzing XCorpus, a corpus of real-world Java programs: we fully handle 95% of its reported proxy creation sites. Our handling results in the analysis of significant portions of previously unreachable or incompletely- modeled code.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot4830,
  title = {Static analysis of Java dynamic proxies},
  author = {George Fourtounis and George Kastrinis and Yannis Smaragdakis},
  booktitle = {ISSTA},
  year = {2018},
  doi = {10.1145/3213846.3213864}
}