Menu

Replacement classes

Tobias Gutzmann

Collection classes for use with points-to analysis. The implementation described in the paper Collection Classes for Points-to Analysis.

The project consists of two parts, the bytecode transformation tool and the actual replacement classes. First, run the bytecode transformation tool on the project to be analyzed, and then use the transformed classes together with the replacement classes.

The code can be found here, and binaries downloaded here

The bytecode transformation tool

Usage is as follows:

Run fixBytecode.FixBytecode .../jre/lib/rt.jar .../jre/lib/jce.jar .../myProject/MyProject.jar .../myProject/lib/aLib.jar ...

FixBytecode puts a transformed library, where _mod is added prior to .jar, in the current directory. Use these libraries together with the replacement colleciton classes (see below) to run your subsequent points-to analysis.

In order to map back method signatures (if required), you can use changedMethods.xml, which is generated by FixBytecode.

Possible warnings printed by FixBytecode:

Warning: possible elementData problem in p.X.m()

A class overwriting Vector accesses the field elementData directly; this may be problematic. When transforming rt.jar, this will show up a lot for classes com.sun.jmx.snmp.SnmpVarBindList and com.sun.jmx.snmp.agent.SnmpMibOid$NonSyncVector

Warning: possible instanceof problem in p.X.m()

An instanceof operation for a type Set, Map.Entry, or Iterator is found. This may be critical for some optimizations in points-to analysis (cf. above mentioned papaer). Usually, these pop up a lot for equals() methods, where they shouldn't cause any problem.

The replacement collection classes

Add the transformed .jar files together with the replacement classes in your analysis. Note that the replacement classes must be in the classpath before the transformed rt.jar.

You can peek at the implementation of the replacement classes here.


MongoDB Logo MongoDB