Improved Static Resolution of Dynamic Class Loading in Java

  • Authors:
  • Jason Sawin;Atanas Rountev

  • Affiliations:
  • Ohio State University, USA;Ohio State University, USA

  • Venue:
  • SCAM '07 Proceedings of the Seventh IEEE International Working Conference on Source Code Analysis and Manipulation
  • Year:
  • 2007

Quantified Score

Hi-index 0.00

Visualization

Abstract

Modern applications are becoming increasingly more dynamic and flexible. In Java software, one important flexibility mechanism is dynamic class loading. Unfortunately, the vast majority of static analyses for Java handle this feature either unsoundly or overly conservatively. We present a set of techniques for static resolution of dynamic-class-loading sites in Java software. Previous work has used static string analysis to achieve this goal. However, a large number of such sites are impossible to resolve with purely static techniques. We present a novel semi-static approach, which combines static string analysis with dynamically gathered information about the execution environment. The key insight behind this approach is the observation that dynamic class loading often depends on characteristics of the execution environment that are encoded in various environment variables. In addition, we propose generalizations of string analysis to increase the number of sites that can be resolved purely statically, and to track the names of environment variables. We present an experimental evaluation on 10,238 classes from the standard Java libraries. Our results show that a stateof- the-art purely static approach resolves only 28% of non-trivial sites, while our approach resolves more than twice as many sites. This work is a step towards making static analysis tools better equipped to handle the dynamic features of Java.