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 条
  • [21] E-Knowledge Analyzing with Java']Java Ontology
    Khamparia, Aditya
    Pandey, Babita
    Kaur, Parampreet
    Tiwari, Shrasti
    PROCEEDINGS OF THE 2018 IEEE 6TH INTERNATIONAL CONFERENCE ON MOOCS, INNOVATION AND TECHNOLOGY IN EDUCATION (MITE 2018), 2018, : 60 - 68
  • [22] JGromacs: A Java']Java Package for Analyzing Protein Simulations
    Muenz, Marton
    Biggin, Philip C.
    JOURNAL OF CHEMICAL INFORMATION AND MODELING, 2012, 52 (01) : 255 - 259
  • [23] Analyzing Stack Flows to Compare Java']Java Programs
    Lim, Hyun-il
    Han, Taisook
    IEICE TRANSACTIONS ON INFORMATION AND SYSTEMS, 2012, E95D (02): : 565 - 576
  • [24] The indolent lambdification of Java']Java Understanding the support for lambda expressions in the Java']Java ecosystem
    Petrulio, Fernando
    Sawant, Anand Ashok
    Bacchelli, Alberto
    EMPIRICAL SOFTWARE ENGINEERING, 2021, 26 (06)
  • [25] More Sound Static Handling of Java']Java Reflection
    Smaragdakis, Yannis
    Balatsouras, George
    Kastrinis, George
    Bravenboer, Martin
    PROGRAMMING LANGUAGES AND SYSTEMS, APLAS 2015, 2015, 9458 : 485 - 503
  • [26] Compile-time Reflection and Metaprogramming for Java']Java
    Miao, Weiyu
    Siek, Jeremy
    PEPM '14: PROCEEDINGS OF THE ACM SIGPLAN WORKSHOP ON PARTIAL EVALUATION AND PROGRAM MANIPULATION, 2014, : 27 - 37
  • [27] Enhancing Java']Java RMI with Asynchrony through Reflection
    Akin, Orhan
    Erdogan, Nadia
    COMMUNICATIONS INFRASTRUCTURE: SYSTEMS AND APPLICATIONS IN EUROPE, 2009, 16 : 23 - 34
  • [28] Load-time structural reflection in Java']Java
    Chiba, S
    ECOOP 2000 - OBJECT-ORIENTED PROGRAMMING, 2000, 1850 : 313 - 336
  • [29] Self-inferencing Reflection Resolution for Java']Java
    Li, Yue
    Tan, Tian
    Sui, Yulei
    Xue, Jingling
    ECOOP 2014 - OBJECT-ORIENTED PROGRAMMING, 2014, 8586 : 27 - 53
  • [30] Steps toward understanding performance in Java']Java
    Lea, D
    SEVENTH HETEROGENEOUS COMPUTING WORKSHOP (HCW '98), 1998, : 171 - 172