Understanding and Analyzing Java']Java Reflection

被引:29
|
作者
Li, Yue [1 ,3 ]
Tan, Tian [1 ,3 ]
Xue, Jingling [2 ]
机构
[1] UNSW Sydney, Sydney, NSW 2052, Australia
[2] UNSW Sydney, Sch Comp Sci & Engn, Sydney, NSW 2052, Australia
[3] Aarhus Univ, Dept Comp Sci, IT Pk,Aabogade 34, DK-8200 Aarhus N, Denmark
基金
欧盟地平线“2020”; 澳大利亚研究理事会; 欧洲研究理事会;
关键词
!text type='Java']Java[!/text] reflection; static analysis; reflection analysis; points-to analysis; POINTS-TO ANALYSIS; PRECISE; SENSITIVITY; RESOLUTION; EFFICIENT;
D O I
10.1145/3295739
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Java reflection has been widely used in a variety of applications and frameworks. It allows a software system to inspect and change the behaviour of its classes, interfaces, methods, and fields at runtime, enabling the software to adapt to dynamically changing runtime environments. However, this dynamic language feature imposes significant challenges to static analysis, because the behaviour of reflection-rich software is logically complex and statically hard to predict. As a result, existing static analysis tools either ignore reflection or handle it partially, resulting in missed, important behaviours, i.e., unsound results. Therefore, improving or even achieving soundness in static reflection analysis-an analysis that infers statically the behaviour of reflective code-will provide significant benefits to many analysis clients, such as bug detectors, security analyzers, and program verifiers. In this article, we provide a comprehensive understanding of Java reflection through examining its underlying concept, API, and real-world usage, and, building on this, we introduce a new static approach to resolving Java reflection effectively in practice. We have implemented our reflection analysis in an open-source tool, called Solar, and evaluated its effectiveness extensively with large Java programs and libraries. Our experimental results demonstrate that Solar is able to (1) resolve reflection more soundly than the state-of-the-art reflection analyses; (2) automatically and accurately identify the parts of the program where reflection is resolved unsoundly or imprecisely; and (3) guide users to iteratively refine the analysis results by using lightweight annotations until their specific requirements are satisfied.
引用
收藏
页数:50
相关论文
共 50 条
  • [1] Understanding and analyzing Java reflection
    UNSW, Australia
    arXiv, 1600,
  • [2] Java']Java reflection
    Tremblett, P
    DR DOBBS JOURNAL, 1998, 23 (01): : 36 - &
  • [3] Reflection analysis for Java']Java
    Livshits, B
    Whaley, J
    Lam, MS
    PROGRAMMING LANGUAGES AND SYSTEMS, PROCEEDINGS, 2005, 3780 : 139 - 160
  • [4] Linguistic reflection in Java']Java
    Kirby, G
    Morrison, R
    Stemple, D
    SOFTWARE-PRACTICE & EXPERIENCE, 1998, 28 (10): : 1045 - 1077
  • [5] Understanding Java']Java
    Currie, CC
    SOCIETY FOR TECHNICAL COMMUNICATION 44TH ANNUAL CONFERENCE, 1997 PROCEEDINGS, 1997, : 356 - 359
  • [6] Analyzing the characteristic of JAVA']JAVA objects
    Li, Junyi
    Chen, Jingyu
    Fong, Anthony S.
    SENSORS, MEASUREMENT AND INTELLIGENT MATERIALS, PTS 1-4, 2013, 303-306 : 2329 - +
  • [7] A Better API for Java']Java Reflection
    Shams, Zalia
    Edwards, Stephen H.
    SIGCSE 12: PROCEEDINGS OF THE 43RD ACM TECHNICAL SYMPOSIUM ON COMPUTER SCIENCE EDUCATION, 2011, : 674 - 674
  • [8] Java reflection
    Tremblett, Paul
    Dr. Dobb's Journal of Software Tools for Professional Programmer, 1998, 23 (01):
  • [9] Analyzing the QoS of VoIP on SIP in Java']Java
    da Silva, J. M., Jr.
    Lins, R. D.
    PROCEEDINGS OF THE IEEE INTERNATIONAL TELECOMMUNICATIONS SYMPOSIUM, VOLS 1 AND 2, 2006, : 576 - 581
  • [10] Analyzing exception flow in Java']Java™ programs
    Robillard, MP
    Murphy, GC
    SOFTWARE ENGINEERING - ESEC/FSE '99, PROCEEDINGS, 1999, 1687 : 322 - 337