1 / 8

Improved Static Resolution of Dynamic Class Loading in Java

Improved Static Resolution of Dynamic Class Loading in Java . Jason Sawin, Atanas Rountev Ohio State University Work supported by NSF. Dynamic Class Loading. Dynamic Class Loading Ability to install classes at run time . String className = “foo.bar.clazz”; .....

pules
Download Presentation

Improved Static Resolution of Dynamic Class Loading in Java

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Improved Static Resolution of Dynamic Class Loading in Java Jason Sawin, Atanas Rountev Ohio State University Work supported by NSF

  2. Dynamic Class Loading • Dynamic Class Loading • Ability to install classes at run time String className = “foo.bar.clazz”; ..... Class c = Class.forName(className); Object h = c.newInstance(); .....

  3. Class Loading and Static Analysis • In the general case it is impossible to statically determine the affects of dynamic class loading • Static Analysis Approaches • Ignore it • Overly conservative • Query the user • Utilize casting information • String analysis

  4. Problems with Modern Approaches • Problem: string analysis only considers purely static string values • Many uses of dynamic class loading will rely on string values which are not hard coded into applications • Insight: hybrid (static/dynamic) analysis can increase information being considered • Increases precision • Loss of global soundness • Problem: state-of-the-art string analysis is not powerful enough to precisely model all language features • Insight: generalization can be made to improve the precision of string analysis

  5. Hybrid Generalization • Extended Java String Analyzer (JSA) • During the static string analysis, dynamically gather information about the values of system environment variables • Inject this information at environment variable entry points • System.getProperty(String propName) • Utilize JSA to resolve propName

  6. Increasing the Precision of JSA • Field Generalization: JSA provides no treatment for fields • We provide a context-insensitive treatment for certain fields • Type Generalization: String is a subclass of Object • Use type inferencing analysis to determine objects of static type Object which are actually objects of type String • Needed for the up and down casting of objects between String and Object

  7. Study of Java 1.4 Libraries

  8. Summary of Initial Study • Our approach increases by a factor of 2.6 the ability of a state-of-the-art string analysis to resolve instances of dynamic class loading • Results are sound for the values of environment variables observed at analysis time • Gathering environment information maybe a useful technique for a wide range of static analyses

More Related