Package daikon.dcomp

Class BuildJDK


  • public class BuildJDK
    extends Object
    BuildJDK uses DCInstrument to add comparability instrumentation to Java class files, then stores the modified files into a directory identified by a (required) command line argument.

    DCInstrument duplicates each method of a class file. The new methods are distinguished by the addition of a final parameter of type DCompMarker and are instrumented to track comparability. Based on its invocation arguments, DynComp will decide whether to call the instrumented or uninstrumented version of a method.

    • Field Detail

      • java_home

        public static final String java_home
        The "java.home" system property. Note that there is also a JAVA_HOME variable that contains System.getenv("JAVA_HOME").
      • known_uninstrumentable_methods

        public static List<String> known_uninstrumentable_methods
        A list of methods known to cause DCInstrument to fail. This is used to remove known problems from the list of failures displayed at the end of BuildJDK's execution. Format is <fully-qualified class name>.<method name>
    • Method Detail

      • main

        public static void main​(String[] args)
                         throws IOException
        Instruments each class file in the Java runtime and puts the result in the first non-option command-line argument.

        By default, BuildJDK will locate the appropriate Java runtime library and instrument each of its member class files. However, if there are additional arguments on the command line after the destination directory, then we assume these are class files to be instrumented and the Java runtime library is not used. This usage is primarily for testing purposes.

        Parameters:
        args - arguments being passed to BuildJDK
        Throws:
        IOException - if unable to read or write file dcomp_jdk_static_field_id or if unable to write jdk_classes.txt
      • check_java_home

        public static void check_java_home()
        Verify that java.home and JAVA_HOME match. Exits the JVM if there is an error.