Merge

Thu, 11 Jun 2009 21:35:12 -0700

author
tbell
date
Thu, 11 Jun 2009 21:35:12 -0700
changeset 292
163f5d75f77a
parent 278
522520757dd3
parent 291
47cf04bb80c9
child 293
6855e5aa3348
child 296
a9c04a57a39f

Merge

make/Makefile file | annotate | diff | comparison | revisions
make/build.xml file | annotate | diff | comparison | revisions
src/share/classes/sun/tools/javap/AttrData.java file | annotate | diff | comparison | revisions
src/share/classes/sun/tools/javap/CPX.java file | annotate | diff | comparison | revisions
src/share/classes/sun/tools/javap/CPX2.java file | annotate | diff | comparison | revisions
src/share/classes/sun/tools/javap/ClassData.java file | annotate | diff | comparison | revisions
src/share/classes/sun/tools/javap/Constants.java file | annotate | diff | comparison | revisions
src/share/classes/sun/tools/javap/FieldData.java file | annotate | diff | comparison | revisions
src/share/classes/sun/tools/javap/InnerClassData.java file | annotate | diff | comparison | revisions
src/share/classes/sun/tools/javap/JavapEnvironment.java file | annotate | diff | comparison | revisions
src/share/classes/sun/tools/javap/JavapPrinter.java file | annotate | diff | comparison | revisions
src/share/classes/sun/tools/javap/LineNumData.java file | annotate | diff | comparison | revisions
src/share/classes/sun/tools/javap/LocVarData.java file | annotate | diff | comparison | revisions
src/share/classes/sun/tools/javap/Main.java file | annotate | diff | comparison | revisions
src/share/classes/sun/tools/javap/MethodData.java file | annotate | diff | comparison | revisions
src/share/classes/sun/tools/javap/RuntimeConstants.java file | annotate | diff | comparison | revisions
src/share/classes/sun/tools/javap/StackMapData.java file | annotate | diff | comparison | revisions
src/share/classes/sun/tools/javap/StackMapTableData.java file | annotate | diff | comparison | revisions
src/share/classes/sun/tools/javap/Tables.java file | annotate | diff | comparison | revisions
src/share/classes/sun/tools/javap/TrapData.java file | annotate | diff | comparison | revisions
src/share/classes/sun/tools/javap/TypeSignature.java file | annotate | diff | comparison | revisions
test/tools/javac/code/ArrayClone.sh file | annotate | diff | comparison | revisions
test/tools/javap/ListTest.java file | annotate | diff | comparison | revisions
test/tools/javap/OptionTest.java file | annotate | diff | comparison | revisions
     1.1 --- a/make/Makefile	Thu Jun 11 10:54:31 2009 -0700
     1.2 +++ b/make/Makefile	Thu Jun 11 21:35:12 2009 -0700
     1.3 @@ -120,6 +120,14 @@
     1.4    endif
     1.5  endif 
     1.6  
     1.7 +ifdef SOURCE_LANGUAGE_VERSION
     1.8 +  ANT_OPTIONS += -Djavac.source=$(SOURCE_LANGUAGE_VERSION)
     1.9 +else
    1.10 +  ifdef JAVAC_SOURCE_ARG 
    1.11 +    ANT_OPTIONS += -Djavac.source=$(JAVAC_SOURCE_ARG)
    1.12 +  endif
    1.13 +endif 
    1.14 +
    1.15  ifdef ALT_BOOTDIR
    1.16    ANT_OPTIONS += -Dboot.java.home=$(ALT_BOOTDIR)
    1.17    ANT_JAVA_HOME = JAVA_HOME=$(ALT_BOOTDIR)
     2.1 --- a/make/build.properties	Thu Jun 11 10:54:31 2009 -0700
     2.2 +++ b/make/build.properties	Thu Jun 11 21:35:12 2009 -0700
     2.3 @@ -32,7 +32,8 @@
     2.4  # boot.java.home = /opt/jdk/1.5.0 
     2.5  boot.java = ${boot.java.home}/bin/java
     2.6  boot.javac = ${boot.java.home}/bin/javac
     2.7 -boot.javac.target = 5
     2.8 +boot.javac.source = 6
     2.9 +boot.javac.target = 6
    2.10  
    2.11  # This is the JDK used to run the product version of the tools,
    2.12  # for example, for testing. If you're building a complete JDK, specify that.
    2.13 @@ -59,7 +60,8 @@
    2.14  bootstrap.full.version = ${bootstrap.release}-${build.number}
    2.15  
    2.16  # options for the <javac> tasks used to compile the tools
    2.17 -javac.target = 6
    2.18 +javac.source = 5
    2.19 +javac.target = 5
    2.20  javac.debug = true
    2.21  javac.debuglevel = source,lines
    2.22  javac.no.jdk.warnings = -XDignore.symbol.file=true
     3.1 --- a/make/build.xml	Thu Jun 11 10:54:31 2009 -0700
     3.2 +++ b/make/build.xml	Thu Jun 11 21:35:12 2009 -0700
     3.3 @@ -315,7 +315,7 @@
     3.4      <target name="build-javap" depends="build-javac">
     3.5          <build-tool name="javap"
     3.6                      includes="${javap.includes}"
     3.7 -                    jarmainclass="sun.tools.javap.Main"
     3.8 +                    jarmainclass="com.sun.tools.javap.Main"
     3.9                      jarclasspath="javac.jar"/>
    3.10      </target>
    3.11      
    3.12 @@ -400,6 +400,7 @@
    3.13              <attribute name="java" default="java"/>
    3.14              <attribute name="javac.bootclasspath" default="-J-Xbootclasspath/p:${build.bootstrap.dir}/classes"/>
    3.15              <attribute name="javac.java.home" default="${boot.java.home}"/>
    3.16 +            <attribute name="javac.source" default="${javac.source}"/>
    3.17              <attribute name="javac.target" default="${javac.target}"/>
    3.18              <attribute name="jarmainclass" default="com.sun.tools.@{name}.Main"/>
    3.19              <attribute name="jarclasspath" default=""/>
    3.20 @@ -418,6 +419,7 @@
    3.21                      release="@{release}"
    3.22                      full.version="@{full.version}"
    3.23                      javac.bootclasspath="@{javac.bootclasspath}"
    3.24 +                    javac.source="@{javac.source}"
    3.25                      javac.target="@{javac.target}"
    3.26                  />
    3.27                  <mkdir dir="@{bin.dir}"/>
    3.28 @@ -442,6 +444,7 @@
    3.29              <attribute name="lib.dir" default="${dist.lib.dir}"/>
    3.30              <attribute name="javac.bootclasspath" default="-J-Xbootclasspath/p:${build.bootstrap.dir}/classes"/>
    3.31              <attribute name="javac.java.home" default="${boot.java.home}"/>
    3.32 +            <attribute name="javac.source" default="${javac.source}"/>
    3.33              <attribute name="javac.target" default="${javac.target}"/>
    3.34              <attribute name="jarmainclass" default="com.sun.tools.@{name}.Main"/>
    3.35              <attribute name="jarclasspath" default=""/>
    3.36 @@ -457,6 +460,7 @@
    3.37                      release="@{release}"
    3.38                      full.version="@{full.version}"
    3.39                      javac.bootclasspath="@{javac.bootclasspath}"
    3.40 +                    javac.source="@{javac.source}"
    3.41                      javac.target="@{javac.target}"
    3.42                  />
    3.43                  <mkdir dir="@{lib.dir}"/>
    3.44 @@ -481,6 +485,7 @@
    3.45              <attribute name="gensrc.dir" default="${build.gensrc.dir}"/>
    3.46              <attribute name="javac.bootclasspath" default="${build.bootstrap.dir}/classes"/>
    3.47              <attribute name="javac.java.home" default="${boot.java.home}"/>
    3.48 +            <attribute name="javac.source" default="${javac.source}"/>
    3.49              <attribute name="javac.target" default="${javac.target}"/>
    3.50              <attribute name="release" default="${release}"/>
    3.51              <attribute name="full.version" default="${full.version}"/>
    3.52 @@ -509,6 +514,7 @@
    3.53                         includes="@{includes}"
    3.54                         sourcepath=""
    3.55                         includeAntRuntime="no"
    3.56 +                       source="@{javac.source}"
    3.57                         target="@{javac.target}">
    3.58                      <compilerarg value="-J-Xbootclasspath/p:@{javac.bootclasspath}"/>
    3.59                      <compilerarg line="${javac.version.opt}"/>
    3.60 @@ -522,6 +528,7 @@
    3.61                         excludes="@{excludes}"
    3.62                         sourcepath=""
    3.63                         includeAntRuntime="no"
    3.64 +                       source="@{javac.source}"
    3.65                         target="@{javac.target}"
    3.66                         debug="${javac.debug}" 
    3.67                         debuglevel="${javac.debuglevel}">
    3.68 @@ -547,6 +554,7 @@
    3.69      <target name="-def-build-bootstrap-tool" depends="-check-boot.java.home,-def-build-tool">
    3.70          <presetdef name="build-bootstrap-tool">
    3.71              <build-tool
    3.72 +                javac.source="${boot.javac.source}"
    3.73                  javac.target="${boot.javac.target}"
    3.74                  gensrc.dir="${build.bootstrap.dir}/gensrc"
    3.75                  classes.dir="${build.bootstrap.dir}/classes"
    3.76 @@ -562,6 +570,7 @@
    3.77      <target name="-def-build-bootstrap-jar" depends="-def-build-jar">
    3.78          <presetdef name="build-bootstrap-jar">
    3.79              <build-jar
    3.80 +                javac.source="${boot.javac.source}"
    3.81                  javac.target="${boot.javac.target}"
    3.82                  gensrc.dir="${build.bootstrap.dir}/gensrc"
    3.83                  classes.dir="${build.bootstrap.dir}/classes"
     4.1 --- a/src/share/classes/com/sun/tools/apt/main/Main.java	Thu Jun 11 10:54:31 2009 -0700
     4.2 +++ b/src/share/classes/com/sun/tools/apt/main/Main.java	Thu Jun 11 21:35:12 2009 -0700
     4.3 @@ -26,7 +26,6 @@
     4.4  package com.sun.tools.apt.main;
     4.5  
     4.6  import java.io.File;
     4.7 -import java.io.FileOutputStream;
     4.8  import java.io.FileWriter;
     4.9  import java.io.IOException;
    4.10  import java.io.PrintWriter;
    4.11 @@ -37,14 +36,15 @@
    4.12  import java.util.Map;
    4.13  import java.util.HashMap;
    4.14  import java.util.Collections;
    4.15 -import java.util.Collection;
    4.16  
    4.17  import java.net.URLClassLoader;
    4.18  import java.net.URL;
    4.19 -import java.io.File;
    4.20  import java.net.MalformedURLException;
    4.21  
    4.22 -import com.sun.tools.javac.file.Paths;
    4.23 +import javax.tools.JavaFileManager;
    4.24 +import javax.tools.StandardLocation;
    4.25 +
    4.26 +import com.sun.tools.javac.file.JavacFileManager;
    4.27  import com.sun.tools.javac.code.Source;
    4.28  import com.sun.tools.javac.code.Symbol;
    4.29  import com.sun.tools.javac.code.Type;
    4.30 @@ -766,6 +766,7 @@
    4.31          providedFactory = factory;
    4.32  
    4.33          Context context = new Context();
    4.34 +        JavacFileManager.preRegister(context);
    4.35          options = Options.instance(context);
    4.36          Bark bark;
    4.37  
    4.38 @@ -862,14 +863,14 @@
    4.39              }
    4.40              origOptions = Collections.unmodifiableMap(origOptions);
    4.41  
    4.42 +            JavacFileManager fm = (JavacFileManager) context.get(JavaFileManager.class);
    4.43              {
    4.44                  // Note: it might be necessary to check for an empty
    4.45                  // component ("") of the source path or class path
    4.46 -                Paths paths = Paths.instance(context);
    4.47  
    4.48                  String sourceDest = options.get("-s");
    4.49 -                if (paths.sourcePath() != null) {
    4.50 -                    for(File f: paths.sourcePath())
    4.51 +                if (fm.hasLocation(StandardLocation.SOURCE_PATH)) {
    4.52 +                    for(File f: fm.getLocation(StandardLocation.SOURCE_PATH))
    4.53                          augmentedSourcePath += (f + File.pathSeparator);
    4.54                      augmentedSourcePath += (sourceDest == null)?".":sourceDest;
    4.55                  } else {
    4.56 @@ -880,8 +881,8 @@
    4.57                  }
    4.58  
    4.59                  String classDest = options.get("-d");
    4.60 -                if (paths.userClassPath() != null) {
    4.61 -                    for(File f: paths.userClassPath())
    4.62 +                if (fm.hasLocation(StandardLocation.CLASS_PATH)) {
    4.63 +                    for(File f: fm.getLocation(StandardLocation.CLASS_PATH))
    4.64                          baseClassPath += (f + File.pathSeparator);
    4.65                      // put baseClassPath into map to handle any
    4.66                      // value needed for the classloader
    4.67 @@ -908,9 +909,8 @@
    4.68               * uses.
    4.69               */
    4.70                  String aptclasspath = "";
    4.71 -                Paths paths = Paths.instance(context);
    4.72                  String bcp = "";
    4.73 -                Collection<File> bootclasspath = paths.bootClassPath();
    4.74 +                Iterable<? extends File> bootclasspath = fm.getLocation(StandardLocation.PLATFORM_CLASS_PATH);
    4.75  
    4.76                  if (bootclasspath != null) {
    4.77                      for(File f: bootclasspath)
     5.1 --- a/src/share/classes/com/sun/tools/classfile/ClassTranslator.java	Thu Jun 11 10:54:31 2009 -0700
     5.2 +++ b/src/share/classes/com/sun/tools/classfile/ClassTranslator.java	Thu Jun 11 21:35:12 2009 -0700
     5.3 @@ -95,7 +95,7 @@
     5.4          if (cp2 == null) {
     5.5              ConstantPool.CPInfo[] pool2 = new ConstantPool.CPInfo[cp.size()];
     5.6              boolean eq = true;
     5.7 -            for (int i = 0; i < cp.size(); i++) {
     5.8 +            for (int i = 0; i < cp.size(); ) {
     5.9                  ConstantPool.CPInfo cpInfo;
    5.10                  try {
    5.11                      cpInfo = cp.get(i);
    5.12 @@ -107,11 +107,7 @@
    5.13                  pool2[i] = cpInfo2;
    5.14                  if (cpInfo.getTag() != cpInfo2.getTag())
    5.15                      throw new IllegalStateException();
    5.16 -                switch (cpInfo.getTag()) {
    5.17 -                    case ConstantPool.CONSTANT_Double:
    5.18 -                    case ConstantPool.CONSTANT_Long:
    5.19 -                        i += 1;
    5.20 -                }
    5.21 +                i += cpInfo.size();
    5.22              }
    5.23  
    5.24              if (eq)
     6.1 --- a/src/share/classes/com/sun/tools/classfile/ClassWriter.java	Thu Jun 11 10:54:31 2009 -0700
     6.2 +++ b/src/share/classes/com/sun/tools/classfile/ClassWriter.java	Thu Jun 11 21:35:12 2009 -0700
     6.3 @@ -118,13 +118,8 @@
     6.4          ConstantPool pool = classFile.constant_pool;
     6.5          int size = pool.size();
     6.6          out.writeShort(size);
     6.7 -        try {
     6.8 -            for (int i = 1; i < size; ) {
     6.9 -                i += constantPoolWriter.write(pool.get(i), out);
    6.10 -            }
    6.11 -        } catch (ConstantPoolException e) {
    6.12 -            throw new Error(e); // ??
    6.13 -        }
    6.14 +        for (CPInfo cpInfo: pool.entries())
    6.15 +            constantPoolWriter.write(cpInfo, out);
    6.16      }
    6.17  
    6.18      protected void writeFields() throws IOException {
     7.1 --- a/src/share/classes/com/sun/tools/classfile/ConstantPool.java	Thu Jun 11 10:54:31 2009 -0700
     7.2 +++ b/src/share/classes/com/sun/tools/classfile/ConstantPool.java	Thu Jun 11 21:35:12 2009 -0700
     7.3 @@ -26,6 +26,7 @@
     7.4  package com.sun.tools.classfile;
     7.5  
     7.6  import java.io.IOException;
     7.7 +import java.util.Iterator;
     7.8  
     7.9  /**
    7.10   * See JVMS3, section 4.5.
    7.11 @@ -223,6 +224,40 @@
    7.12          throw new EntryNotFound(value);
    7.13      }
    7.14  
    7.15 +    public Iterable<CPInfo> entries() {
    7.16 +        return new Iterable<CPInfo>() {
    7.17 +            public Iterator<CPInfo> iterator() {
    7.18 +                return new Iterator<CPInfo>() {
    7.19 +
    7.20 +                    public boolean hasNext() {
    7.21 +                        return next < pool.length;
    7.22 +                    }
    7.23 +
    7.24 +                    public CPInfo next() {
    7.25 +                        current = pool[next];
    7.26 +                        switch (current.getTag()) {
    7.27 +                            case CONSTANT_Double:
    7.28 +                            case CONSTANT_Long:
    7.29 +                                next += 2;
    7.30 +                                break;
    7.31 +                            default:
    7.32 +                                next += 1;
    7.33 +                        }
    7.34 +                        return current;
    7.35 +                    }
    7.36 +
    7.37 +                    public void remove() {
    7.38 +                        throw new UnsupportedOperationException();
    7.39 +                    }
    7.40 +
    7.41 +                    private CPInfo current;
    7.42 +                    private int next = 1;
    7.43 +
    7.44 +                };
    7.45 +            }
    7.46 +        };
    7.47 +    }
    7.48 +
    7.49      private CPInfo[] pool;
    7.50  
    7.51      public interface Visitor<R,P> {
    7.52 @@ -250,6 +285,12 @@
    7.53  
    7.54          public abstract int getTag();
    7.55  
    7.56 +        /** The number of slots in the constant pool used by this entry.
    7.57 +         * 2 for CONSTANT_Double and CONSTANT_Long; 1 for everything else. */
    7.58 +        public int size() {
    7.59 +            return 1;
    7.60 +        }
    7.61 +
    7.62          public abstract <R,D> R accept(Visitor<R,D> visitor, D data);
    7.63  
    7.64          protected final ConstantPool cp;
    7.65 @@ -310,6 +351,20 @@
    7.66              return cp.getUTF8Value(name_index);
    7.67          }
    7.68  
    7.69 +        public String getBaseName() throws ConstantPoolException {
    7.70 +            String name = getName();
    7.71 +            int index = name.indexOf("[L") + 1;
    7.72 +            return name.substring(index);
    7.73 +        }
    7.74 +
    7.75 +        public int getDimensionCount() throws ConstantPoolException {
    7.76 +            String name = getName();
    7.77 +            int count = 0;
    7.78 +            while (name.charAt(count) == '[')
    7.79 +                count++;
    7.80 +            return count;
    7.81 +        }
    7.82 +
    7.83          @Override
    7.84          public String toString() {
    7.85              return "CONSTANT_Class_info[name_index: " + name_index + "]";
    7.86 @@ -336,6 +391,11 @@
    7.87          }
    7.88  
    7.89          @Override
    7.90 +        public int size() {
    7.91 +            return 2;
    7.92 +        }
    7.93 +
    7.94 +        @Override
    7.95          public String toString() {
    7.96              return "CONSTANT_Double_info[value: " + value + "]";
    7.97          }
    7.98 @@ -449,6 +509,11 @@
    7.99          }
   7.100  
   7.101          @Override
   7.102 +        public int size() {
   7.103 +            return 2;
   7.104 +        }
   7.105 +
   7.106 +        @Override
   7.107          public String toString() {
   7.108              return "CONSTANT_Long_info[value: " + value + "]";
   7.109          }
     8.1 --- a/src/share/classes/com/sun/tools/classfile/StackMapTable_attribute.java	Thu Jun 11 10:54:31 2009 -0700
     8.2 +++ b/src/share/classes/com/sun/tools/classfile/StackMapTable_attribute.java	Thu Jun 11 21:35:12 2009 -0700
     8.3 @@ -107,6 +107,8 @@
     8.4              return 1;
     8.5          }
     8.6  
     8.7 +        public abstract int getOffsetDelta();
     8.8 +
     8.9          public abstract <R,D> R accept(Visitor<R,D> visitor, D data);
    8.10  
    8.11          public final int frame_type;
    8.12 @@ -130,6 +132,10 @@
    8.13          public <R, D> R accept(Visitor<R, D> visitor, D data) {
    8.14              return visitor.visit_same_frame(this, data);
    8.15          }
    8.16 +
    8.17 +        public int getOffsetDelta() {
    8.18 +            return frame_type;
    8.19 +        }
    8.20      }
    8.21  
    8.22      public static class same_locals_1_stack_item_frame extends stack_map_frame {
    8.23 @@ -149,6 +155,10 @@
    8.24              return visitor.visit_same_locals_1_stack_item_frame(this, data);
    8.25          }
    8.26  
    8.27 +        public int getOffsetDelta() {
    8.28 +            return frame_type - 64;
    8.29 +        }
    8.30 +
    8.31          public final verification_type_info[] stack;
    8.32      }
    8.33  
    8.34 @@ -170,6 +180,10 @@
    8.35              return visitor.visit_same_locals_1_stack_item_frame_extended(this, data);
    8.36          }
    8.37  
    8.38 +        public int getOffsetDelta() {
    8.39 +            return offset_delta;
    8.40 +        }
    8.41 +
    8.42          public final int offset_delta;
    8.43          public final verification_type_info[] stack;
    8.44      }
    8.45 @@ -189,6 +203,10 @@
    8.46              return visitor.visit_chop_frame(this, data);
    8.47          }
    8.48  
    8.49 +        public int getOffsetDelta() {
    8.50 +            return offset_delta;
    8.51 +        }
    8.52 +
    8.53          public final int offset_delta;
    8.54      }
    8.55  
    8.56 @@ -207,6 +225,10 @@
    8.57              return visitor.visit_same_frame_extended(this, data);
    8.58          }
    8.59  
    8.60 +        public int getOffsetDelta() {
    8.61 +            return offset_delta;
    8.62 +        }
    8.63 +
    8.64          public final int offset_delta;
    8.65      }
    8.66  
    8.67 @@ -232,6 +254,10 @@
    8.68              return visitor.visit_append_frame(this, data);
    8.69          }
    8.70  
    8.71 +        public int getOffsetDelta() {
    8.72 +            return offset_delta;
    8.73 +        }
    8.74 +
    8.75          public final int offset_delta;
    8.76          public final verification_type_info[] locals;
    8.77      }
    8.78 @@ -266,6 +292,10 @@
    8.79              return visitor.visit_full_frame(this, data);
    8.80          }
    8.81  
    8.82 +        public int getOffsetDelta() {
    8.83 +            return offset_delta;
    8.84 +        }
    8.85 +
    8.86          public final int offset_delta;
    8.87          public final int number_of_locals;
    8.88          public final verification_type_info[] locals;
    8.89 @@ -308,7 +338,7 @@
    8.90              }
    8.91          }
    8.92  
    8.93 -        verification_type_info(int tag) {
    8.94 +        protected verification_type_info(int tag) {
    8.95              this.tag = tag;
    8.96          }
    8.97  
     9.1 --- a/src/share/classes/com/sun/tools/classfile/Type.java	Thu Jun 11 10:54:31 2009 -0700
     9.2 +++ b/src/share/classes/com/sun/tools/classfile/Type.java	Thu Jun 11 21:35:12 2009 -0700
     9.3 @@ -25,7 +25,10 @@
     9.4  
     9.5  package com.sun.tools.classfile;
     9.6  
     9.7 +import java.util.Arrays;
     9.8 +import java.util.HashSet;
     9.9  import java.util.List;
    9.10 +import java.util.Set;
    9.11  
    9.12  /*
    9.13   *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
    9.14 @@ -33,8 +36,9 @@
    9.15   *  This code and its internal interfaces are subject to change or
    9.16   *  deletion without notice.</b>
    9.17   */
    9.18 -public class Type {
    9.19 +public abstract class Type {
    9.20      protected Type() { }
    9.21 +    public abstract <R,D> R accept(Visitor<R,D> visitor, D data);
    9.22  
    9.23      protected static void append(StringBuilder sb, String prefix, List<? extends Type> types, String suffix) {
    9.24          sb.append(prefix);
    9.25 @@ -52,11 +56,33 @@
    9.26              append(sb, prefix, types, suffix);
    9.27      }
    9.28  
    9.29 +    public interface Visitor<R,P> {
    9.30 +        R visitSimpleType(SimpleType type, P p);
    9.31 +        R visitArrayType(ArrayType type, P p);
    9.32 +        R visitMethodType(MethodType type, P p);
    9.33 +        R visitClassSigType(ClassSigType type, P p);
    9.34 +        R visitClassType(ClassType type, P p);
    9.35 +        R visitInnerClassType(InnerClassType type, P p);
    9.36 +        R visitTypeArgType(TypeArgType type, P p);
    9.37 +        R visitWildcardType(WildcardType type, P p);
    9.38 +    }
    9.39 +
    9.40      public static class SimpleType extends Type {
    9.41          public SimpleType(String name) {
    9.42              this.name = name;
    9.43          }
    9.44  
    9.45 +        public <R, D> R accept(Visitor<R, D> visitor, D data) {
    9.46 +            return visitor.visitSimpleType(this, data);
    9.47 +        }
    9.48 +
    9.49 +        public boolean isPrimitiveType() {
    9.50 +            return primitiveTypes.contains(name);
    9.51 +        }
    9.52 +        // where
    9.53 +        private static final Set<String> primitiveTypes = new HashSet<String>(Arrays.asList(
    9.54 +            "boolean", "byte", "char", "double", "float", "int", "long", "short", "void"));
    9.55 +
    9.56          @Override
    9.57          public String toString() {
    9.58              return name;
    9.59 @@ -70,6 +96,10 @@
    9.60              this.elemType = elemType;
    9.61          }
    9.62  
    9.63 +        public <R, D> R accept(Visitor<R, D> visitor, D data) {
    9.64 +            return visitor.visitArrayType(this, data);
    9.65 +        }
    9.66 +
    9.67          @Override
    9.68          public String toString() {
    9.69              return elemType + "[]";
    9.70 @@ -93,6 +123,10 @@
    9.71              this.throwsTypes = throwsTypes;
    9.72          }
    9.73  
    9.74 +        public <R, D> R accept(Visitor<R, D> visitor, D data) {
    9.75 +            return visitor.visitMethodType(this, data);
    9.76 +        }
    9.77 +
    9.78          @Override
    9.79          public String toString() {
    9.80              StringBuilder sb = new StringBuilder();
    9.81 @@ -116,6 +150,10 @@
    9.82              this.superinterfaceTypes = superinterfaceTypes;
    9.83          }
    9.84  
    9.85 +        public <R, D> R accept(Visitor<R, D> visitor, D data) {
    9.86 +            return visitor.visitClassSigType(this, data);
    9.87 +        }
    9.88 +
    9.89          @Override
    9.90          public String toString() {
    9.91              StringBuilder sb = new StringBuilder();
    9.92 @@ -139,6 +177,10 @@
    9.93              this.typeArgs = typeArgs;
    9.94          }
    9.95  
    9.96 +        public <R, D> R accept(Visitor<R, D> visitor, D data) {
    9.97 +            return visitor.visitClassType(this, data);
    9.98 +        }
    9.99 +
   9.100          @Override
   9.101          public String toString() {
   9.102              StringBuilder sb = new StringBuilder();
   9.103 @@ -158,6 +200,10 @@
   9.104              this.innerType = innerType;
   9.105          }
   9.106  
   9.107 +        public <R, D> R accept(Visitor<R, D> visitor, D data) {
   9.108 +            return visitor.visitInnerClassType(this, data);
   9.109 +        }
   9.110 +
   9.111          @Override
   9.112          public String toString() {
   9.113              return outerType + "." + innerType;
   9.114 @@ -174,6 +220,10 @@
   9.115              this.interfaceBounds = interfaceBounds;
   9.116          }
   9.117  
   9.118 +        public <R, D> R accept(Visitor<R, D> visitor, D data) {
   9.119 +            return visitor.visitTypeArgType(this, data);
   9.120 +        }
   9.121 +
   9.122          @Override
   9.123          public String toString() {
   9.124              StringBuilder sb = new StringBuilder();
   9.125 @@ -209,6 +259,10 @@
   9.126              this.boundType = boundType;
   9.127          }
   9.128  
   9.129 +        public <R, D> R accept(Visitor<R, D> visitor, D data) {
   9.130 +            return visitor.visitWildcardType(this, data);
   9.131 +        }
   9.132 +
   9.133          @Override
   9.134          public String toString() {
   9.135              if (kind == null)
    10.1 --- a/src/share/classes/com/sun/tools/javac/code/Printer.java	Thu Jun 11 10:54:31 2009 -0700
    10.2 +++ b/src/share/classes/com/sun/tools/javac/code/Printer.java	Thu Jun 11 21:35:12 2009 -0700
    10.3 @@ -43,6 +43,9 @@
    10.4   */
    10.5  public abstract class Printer implements Type.Visitor<String, Locale>, Symbol.Visitor<String, Locale> {
    10.6  
    10.7 +    List<Type> seenCaptured = List.nil();
    10.8 +    static final int PRIME = 997;  // largest prime less than 1000
    10.9 +
   10.10      /**
   10.11       * This method should be overriden in order to provide proper i18n support.
   10.12       *
   10.13 @@ -54,7 +57,18 @@
   10.14      protected abstract String localize(Locale locale, String key, Object... args);
   10.15  
   10.16      /**
   10.17 -     * Create a printer with default i18n support provided my Messages.
   10.18 +     * Maps a captured type into an unique identifier.
   10.19 +     *
   10.20 +     * @param t the captured type for which an id is to be retrieved
   10.21 +     * @param locale locale settings
   10.22 +     * @return unique id representing this captured type
   10.23 +     */
   10.24 +    protected abstract String capturedVarId(CapturedType t, Locale locale);
   10.25 +
   10.26 +    /**
   10.27 +     * Create a printer with default i18n support provided by Messages. By default,
   10.28 +     * captured types ids are generated using hashcode.
   10.29 +     *
   10.30       * @param messages Messages class to be used for i18n
   10.31       * @return printer visitor instance
   10.32       */
   10.33 @@ -63,6 +77,11 @@
   10.34              @Override
   10.35              protected String localize(Locale locale, String key, Object... args) {
   10.36                  return messages.getLocalizedString(locale, key, args);
   10.37 +            }
   10.38 +
   10.39 +            @Override
   10.40 +            protected String capturedVarId(CapturedType t, Locale locale) {
   10.41 +                return (t.hashCode() & 0xFFFFFFFFL) % PRIME + "";
   10.42          }};
   10.43      }
   10.44  
   10.45 @@ -120,9 +139,20 @@
   10.46  
   10.47      @Override
   10.48      public String visitCapturedType(CapturedType t, Locale locale) {
   10.49 -        return localize(locale, "compiler.misc.type.captureof",
   10.50 -            (t.hashCode() & 0xFFFFFFFFL) % Type.CapturedType.PRIME,
   10.51 -            visit(t.wildcard, locale));
   10.52 +        if (seenCaptured.contains(t))
   10.53 +            return localize(locale, "compiler.misc.type.captureof.1",
   10.54 +                capturedVarId(t, locale));
   10.55 +        else {
   10.56 +            try {
   10.57 +                seenCaptured = seenCaptured.prepend(t);
   10.58 +                return localize(locale, "compiler.misc.type.captureof",
   10.59 +                    capturedVarId(t, locale),
   10.60 +                    visit(t.wildcard, locale));
   10.61 +            }
   10.62 +            finally {
   10.63 +                seenCaptured = seenCaptured.tail;
   10.64 +            }
   10.65 +        }
   10.66      }
   10.67  
   10.68      @Override
    11.1 --- a/src/share/classes/com/sun/tools/javac/code/Source.java	Thu Jun 11 10:54:31 2009 -0700
    11.2 +++ b/src/share/classes/com/sun/tools/javac/code/Source.java	Thu Jun 11 21:35:12 2009 -0700
    11.3 @@ -95,7 +95,7 @@
    11.4          this.name = name;
    11.5      }
    11.6  
    11.7 -    public static final Source DEFAULT = JDK1_5;
    11.8 +    public static final Source DEFAULT = JDK1_7;
    11.9  
   11.10      public static Source lookup(String name) {
   11.11          return tab.get(name);
    12.1 --- a/src/share/classes/com/sun/tools/javac/code/Type.java	Thu Jun 11 10:54:31 2009 -0700
    12.2 +++ b/src/share/classes/com/sun/tools/javac/code/Type.java	Thu Jun 11 21:35:12 2009 -0700
    12.3 @@ -1008,11 +1008,10 @@
    12.4          @Override
    12.5          public String toString() {
    12.6              return "capture#"
    12.7 -                + (hashCode() & 0xFFFFFFFFL) % PRIME
    12.8 +                + (hashCode() & 0xFFFFFFFFL) % Printer.PRIME
    12.9                  + " of "
   12.10                  + wildcard;
   12.11          }
   12.12 -        static final int PRIME = 997;  // largest prime less than 1000
   12.13      }
   12.14  
   12.15      public static abstract class DelegatedType extends Type {
    13.1 --- a/src/share/classes/com/sun/tools/javac/file/Paths.java	Thu Jun 11 10:54:31 2009 -0700
    13.2 +++ b/src/share/classes/com/sun/tools/javac/file/Paths.java	Thu Jun 11 21:35:12 2009 -0700
    13.3 @@ -66,7 +66,7 @@
    13.4       *  @param context the context
    13.5       *  @return the Paths instance for this context
    13.6       */
    13.7 -    public static Paths instance(Context context) {
    13.8 +    static Paths instance(Context context) {
    13.9          Paths instance = context.get(pathsKey);
   13.10          if (instance == null)
   13.11              instance = new Paths(context);
    14.1 --- a/src/share/classes/com/sun/tools/javac/jvm/Target.java	Thu Jun 11 10:54:31 2009 -0700
    14.2 +++ b/src/share/classes/com/sun/tools/javac/jvm/Target.java	Thu Jun 11 21:35:12 2009 -0700
    14.3 @@ -108,7 +108,7 @@
    14.4          this.minorVersion = minorVersion;
    14.5      }
    14.6  
    14.7 -    public static final Target DEFAULT = JDK1_6;
    14.8 +    public static final Target DEFAULT = JDK1_7;
    14.9  
   14.10      public static Target lookup(String name) {
   14.11          return tab.get(name);
    15.1 --- a/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Thu Jun 11 10:54:31 2009 -0700
    15.2 +++ b/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Thu Jun 11 21:35:12 2009 -0700
    15.3 @@ -391,6 +391,8 @@
    15.4              (options.get("shouldStopPolicy") != null)
    15.5              ? CompileState.valueOf(options.get("shouldStopPolicy"))
    15.6              : null;
    15.7 +        if (options.get("oldDiags") == null)
    15.8 +            log.setDiagnosticFormatter(RichDiagnosticFormatter.instance(context));
    15.9      }
   15.10  
   15.11      /* Switches:
    16.1 --- a/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java	Thu Jun 11 10:54:31 2009 -0700
    16.2 +++ b/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java	Thu Jun 11 21:35:12 2009 -0700
    16.3 @@ -55,7 +55,6 @@
    16.4  import com.sun.tools.javac.api.JavacTaskImpl;
    16.5  import com.sun.tools.javac.code.*;
    16.6  import com.sun.tools.javac.code.Symbol.*;
    16.7 -import com.sun.tools.javac.file.Paths;
    16.8  import com.sun.tools.javac.file.JavacFileManager;
    16.9  import com.sun.tools.javac.jvm.*;
   16.10  import com.sun.tools.javac.main.JavaCompiler;
   16.11 @@ -180,7 +179,6 @@
   16.12      }
   16.13  
   16.14      private void initProcessorIterator(Context context, Iterable<? extends Processor> processors) {
   16.15 -        Paths paths = Paths.instance(context);
   16.16          Log   log   = Log.instance(context);
   16.17          Iterator<? extends Processor> processorIterator;
   16.18  
    17.1 --- a/src/share/classes/com/sun/tools/javac/resources/compiler.properties	Thu Jun 11 10:54:31 2009 -0700
    17.2 +++ b/src/share/classes/com/sun/tools/javac/resources/compiler.properties	Thu Jun 11 21:35:12 2009 -0700
    17.3 @@ -1165,3 +1165,64 @@
    17.4  compiler.err.enums.not.supported.in.source=\
    17.5      enums are not supported in -source {0}\n\
    17.6  (use -source 5 or higher to enable enums)
    17.7 +
    17.8 +########################################
    17.9 +# Diagnostics for where clause implementation
   17.10 +# used by the RichDiagnosticFormatter.
   17.11 +########################################
   17.12 +
   17.13 +compiler.misc.type.null=\
   17.14 +    <null>
   17.15 +
   17.16 +# X#n (where n is an int id) is disambiguated tvar name
   17.17 +compiler.misc.type.var=\
   17.18 +    {0}#{1}
   17.19 +
   17.20 +# CAP#n (where n is an int id) is an abbreviation for 'captured type'
   17.21 +compiler.misc.captured.type=\
   17.22 +    CAP#{0}
   17.23 +
   17.24 +# <INT#n> (where n is an int id) is an abbreviation for 'intersection type'
   17.25 +compiler.misc.intersection.type=\
   17.26 +    INT#{0}
   17.27 +
   17.28 +# where clause for captured type: contains upper ('extends {1}') and lower
   17.29 +# ('super {2}') bound along with the wildcard that generated this captured type ({3})
   17.30 +compiler.misc.where.captured=\
   17.31 +    {0} extends {1} super: {2} from capture of {3}
   17.32 +
   17.33 +# compact where clause for captured type: contains upper ('extends {1}') along
   17.34 +# with the wildcard that generated this captured type ({3})
   17.35 +compiler.misc.where.captured.1=\
   17.36 +    {0} extends {1} from capture of {3}
   17.37 +
   17.38 +# where clause for type variable: contains upper bound(s) ('extends {1}') along with
   17.39 +# the kindname ({2}) and location ({3}) in which the typevar has been declared
   17.40 +compiler.misc.where.typevar=\
   17.41 +    {0} extends {1} declared in {2} {3}
   17.42 +
   17.43 +# compact where clause for type variable: contains the kindname ({2}) and location ({3})
   17.44 +# in which the typevar has been declared
   17.45 +compiler.misc.where.typevar.1=\
   17.46 +    {0} declared in {2} {3}
   17.47 +
   17.48 +# where clause for type variable: contains all the upper bound(s) ('extends {1}')
   17.49 +# of this intersection type
   17.50 +compiler.misc.where.intersection=\
   17.51 +    {0} extends {1}
   17.52 +
   17.53 +### Where clause headers ###
   17.54 +compiler.misc.where.description.captured=\
   17.55 +    where {0} is a fresh type-variable:
   17.56 +compiler.misc.where.description.typevar=\
   17.57 +    where {0} is a type-variable:
   17.58 +compiler.misc.where.description.intersection=\
   17.59 +    where {0} is an intersection type:
   17.60 +compiler.misc.where.description.captured.1=\
   17.61 +    where {0} are fresh type-variables:
   17.62 +compiler.misc.where.description.typevar.1=\
   17.63 +    where {0} are type-variables:
   17.64 +compiler.misc.where.description.intersection.1=\
   17.65 +    where {0} are intersection types:
   17.66 +
   17.67 +
    18.1 --- a/src/share/classes/com/sun/tools/javac/util/AbstractDiagnosticFormatter.java	Thu Jun 11 10:54:31 2009 -0700
    18.2 +++ b/src/share/classes/com/sun/tools/javac/util/AbstractDiagnosticFormatter.java	Thu Jun 11 21:35:12 2009 -0700
    18.3 @@ -77,9 +77,11 @@
    18.4      protected int depth = 0;
    18.5  
    18.6      /**
    18.7 -     * Printer instance to be used for formatting types/symbol
    18.8 +     * All captured types that have been encountered during diagnostic formatting.
    18.9 +     * This info is used by the FormatterPrinter in order to print friendly unique
   18.10 +     * ids for captured types
   18.11       */
   18.12 -    protected Printer printer;
   18.13 +    private List<Type> allCaptured = List.nil();
   18.14  
   18.15      /**
   18.16       * Initialize an AbstractDiagnosticFormatter by setting its JavacMessages object.
   18.17 @@ -88,7 +90,6 @@
   18.18      protected AbstractDiagnosticFormatter(JavacMessages messages, SimpleConfiguration config) {
   18.19          this.messages = messages;
   18.20          this.config = config;
   18.21 -        this.printer = new FormatterPrinter();
   18.22      }
   18.23  
   18.24      public String formatKind(JCDiagnostic d, Locale l) {
   18.25 @@ -104,7 +105,7 @@
   18.26  
   18.27      @Override
   18.28      public String format(JCDiagnostic d, Locale locale) {
   18.29 -        printer = new FormatterPrinter();
   18.30 +        allCaptured = List.nil();
   18.31          return formatDiagnostic(d, locale);
   18.32      }
   18.33  
   18.34 @@ -171,6 +172,9 @@
   18.35              return formatIterable(d, (Iterable<?>)arg, l);
   18.36          }
   18.37          else if (arg instanceof Type) {
   18.38 +            if (!allCaptured.contains(arg)) {
   18.39 +                allCaptured = allCaptured.append((Type)arg);
   18.40 +            }
   18.41              return printer.visit((Type)arg, l);
   18.42          }
   18.43          else if (arg instanceof Symbol) {
   18.44 @@ -291,6 +295,10 @@
   18.45                  d.getIntPosition() != Position.NOPOS;
   18.46      }
   18.47  
   18.48 +    public boolean isRaw() {
   18.49 +        return false;
   18.50 +    }
   18.51 +
   18.52      /**
   18.53       * Creates a string with a given amount of empty spaces. Useful for
   18.54       * indenting the text of a diagnostic message.
   18.55 @@ -355,26 +363,26 @@
   18.56              String showSource = null;
   18.57              if ((showSource = options.get("showSource")) != null) {
   18.58                  if (showSource.equals("true"))
   18.59 -                    visibleParts.add(DiagnosticPart.SOURCE);
   18.60 +                    setVisiblePart(DiagnosticPart.SOURCE, true);
   18.61                  else if (showSource.equals("false"))
   18.62 -                    visibleParts.remove(DiagnosticPart.SOURCE);
   18.63 +                    setVisiblePart(DiagnosticPart.SOURCE, false);
   18.64              }
   18.65              String diagOpts = options.get("diags");
   18.66              if (diagOpts != null) {//override -XDshowSource
   18.67                  Collection<String> args = Arrays.asList(diagOpts.split(","));
   18.68                  if (args.contains("short")) {
   18.69 -                    visibleParts.remove(DiagnosticPart.DETAILS);
   18.70 -                    visibleParts.remove(DiagnosticPart.SUBDIAGNOSTICS);
   18.71 +                    setVisiblePart(DiagnosticPart.DETAILS, false);
   18.72 +                    setVisiblePart(DiagnosticPart.SUBDIAGNOSTICS, false);
   18.73                  }
   18.74                  if (args.contains("source"))
   18.75 -                    visibleParts.add(DiagnosticPart.SOURCE);
   18.76 +                    setVisiblePart(DiagnosticPart.SOURCE, true);
   18.77                  if (args.contains("-source"))
   18.78 -                    visibleParts.remove(DiagnosticPart.SOURCE);
   18.79 +                    setVisiblePart(DiagnosticPart.SOURCE, false);
   18.80              }
   18.81              String multiPolicy = null;
   18.82              if ((multiPolicy = options.get("multilinePolicy")) != null) {
   18.83                  if (multiPolicy.equals("disabled"))
   18.84 -                    visibleParts.remove(DiagnosticPart.SUBDIAGNOSTICS);
   18.85 +                    setVisiblePart(DiagnosticPart.SUBDIAGNOSTICS, false);
   18.86                  else if (multiPolicy.startsWith("limit:")) {
   18.87                      String limitString = multiPolicy.substring("limit:".length());
   18.88                      String[] limits = limitString.split(":");
   18.89 @@ -421,6 +429,13 @@
   18.90              visibleParts = EnumSet.copyOf(diagParts);
   18.91          }
   18.92  
   18.93 +        public void setVisiblePart(DiagnosticPart diagParts, boolean enabled) {
   18.94 +            if (enabled)
   18.95 +                visibleParts.add(diagParts);
   18.96 +            else
   18.97 +                visibleParts.remove(diagParts);
   18.98 +        }
   18.99 +
  18.100          /**
  18.101           * Shows a '^' sign under the source line displayed by the formatter
  18.102           * (if applicable).
  18.103 @@ -441,6 +456,14 @@
  18.104          }
  18.105      }
  18.106  
  18.107 +    public Printer getPrinter() {
  18.108 +        return printer;
  18.109 +    }
  18.110 +
  18.111 +    public void setPrinter(Printer printer) {
  18.112 +        this.printer = printer;
  18.113 +    }
  18.114 +
  18.115      /**
  18.116       * An enhanced printer for formatting types/symbols used by
  18.117       * AbstractDiagnosticFormatter. Provides alternate numbering of captured
  18.118 @@ -450,33 +473,14 @@
  18.119       * type referred by a given captured type C contains C itself) which might
  18.120       * lead to infinite loops.
  18.121       */
  18.122 -    protected class FormatterPrinter extends Printer {
  18.123 -
  18.124 -        List<Type> allCaptured = List.nil();
  18.125 -        List<Type> seenCaptured = List.nil();
  18.126 -
  18.127 +    protected Printer printer = new Printer() {
  18.128          @Override
  18.129          protected String localize(Locale locale, String key, Object... args) {
  18.130              return AbstractDiagnosticFormatter.this.localize(locale, key, args);
  18.131          }
  18.132 -
  18.133          @Override
  18.134 -        public String visitCapturedType(CapturedType t, Locale locale) {
  18.135 -            if (seenCaptured.contains(t))
  18.136 -                return localize(locale, "compiler.misc.type.captureof.1",
  18.137 -                    allCaptured.indexOf(t) + 1);
  18.138 -            else {
  18.139 -                try {
  18.140 -                    seenCaptured = seenCaptured.prepend(t);
  18.141 -                    allCaptured = allCaptured.append(t);
  18.142 -                    return localize(locale, "compiler.misc.type.captureof",
  18.143 -                        allCaptured.indexOf(t) + 1,
  18.144 -                        visit(t.wildcard, locale));
  18.145 -                }
  18.146 -                finally {
  18.147 -                    seenCaptured = seenCaptured.tail;
  18.148 -                }
  18.149 -            }
  18.150 +        protected String capturedVarId(CapturedType t, Locale locale) {
  18.151 +            return "" + (allCaptured.indexOf(t) + 1);
  18.152          }
  18.153 -    }
  18.154 +    };
  18.155  }
    19.1 --- a/src/share/classes/com/sun/tools/javac/util/BasicDiagnosticFormatter.java	Thu Jun 11 10:54:31 2009 -0700
    19.2 +++ b/src/share/classes/com/sun/tools/javac/util/BasicDiagnosticFormatter.java	Thu Jun 11 21:35:12 2009 -0700
    19.3 @@ -209,6 +209,7 @@
    19.4  
    19.5      @Override
    19.6      public BasicConfiguration getConfiguration() {
    19.7 +        //the following cast is always safe - see init
    19.8          return (BasicConfiguration)super.getConfiguration();
    19.9      }
   19.10  
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/src/share/classes/com/sun/tools/javac/util/ForwardingDiagnosticFormatter.java	Thu Jun 11 21:35:12 2009 -0700
    20.3 @@ -0,0 +1,132 @@
    20.4 +/*
    20.5 + * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
    20.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    20.7 + *
    20.8 + * This code is free software; you can redistribute it and/or modify it
    20.9 + * under the terms of the GNU General Public License version 2 only, as
   20.10 + * published by the Free Software Foundation.  Sun designates this
   20.11 + * particular file as subject to the "Classpath" exception as provided
   20.12 + * by Sun in the LICENSE file that accompanied this code.
   20.13 + *
   20.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
   20.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   20.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   20.17 + * version 2 for more details (a copy is included in the LICENSE file that
   20.18 + * accompanied this code).
   20.19 + *
   20.20 + * You should have received a copy of the GNU General Public License version
   20.21 + * 2 along with this work; if not, write to the Free Software Foundation,
   20.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   20.23 + *
   20.24 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   20.25 + * CA 95054 USA or visit www.sun.com if you need additional information or
   20.26 + * have any questions.
   20.27 + */
   20.28 +package com.sun.tools.javac.util;
   20.29 +
   20.30 +import java.util.Set;
   20.31 +import java.util.Locale;
   20.32 +import javax.tools.Diagnostic;
   20.33 +
   20.34 +import com.sun.tools.javac.api.DiagnosticFormatter;
   20.35 +import com.sun.tools.javac.api.DiagnosticFormatter.Configuration;
   20.36 +import com.sun.tools.javac.api.DiagnosticFormatter.Configuration.DiagnosticPart;
   20.37 +import com.sun.tools.javac.api.DiagnosticFormatter.Configuration.MultilineLimit;
   20.38 +import com.sun.tools.javac.api.DiagnosticFormatter.PositionKind;
   20.39 +
   20.40 +/**
   20.41 + * A delegated diagnostic formatter delegates all formatting
   20.42 + * actions to an underlying formatter (aka the delegated formatter).
   20.43 + */
   20.44 +public class ForwardingDiagnosticFormatter<D extends Diagnostic<?>, F extends DiagnosticFormatter<D>>
   20.45 +        implements DiagnosticFormatter<D> {
   20.46 +
   20.47 +    /**
   20.48 +     * The delegated formatter
   20.49 +     */
   20.50 +    protected F formatter;
   20.51 +
   20.52 +    /*
   20.53 +     * configuration object used by this formatter
   20.54 +     */
   20.55 +    protected ForwardingConfiguration configuration;
   20.56 +
   20.57 +    public ForwardingDiagnosticFormatter(F formatter) {
   20.58 +        this.formatter = formatter;
   20.59 +        this.configuration = new ForwardingConfiguration(formatter.getConfiguration());
   20.60 +    }
   20.61 +
   20.62 +    /**
   20.63 +     * Returns the underlying delegated formatter
   20.64 +     * @return delegate formatter
   20.65 +     */
   20.66 +    public F getDelegatedFormatter() {
   20.67 +        return formatter;
   20.68 +    }
   20.69 +
   20.70 +    public Configuration getConfiguration() {
   20.71 +        return configuration;
   20.72 +    }
   20.73 +
   20.74 +    public boolean displaySource(D diag) {
   20.75 +        return formatter.displaySource(diag);
   20.76 +    }
   20.77 +
   20.78 +    public String format(D diag, Locale l) {
   20.79 +        return formatter.format(diag, l);
   20.80 +    }
   20.81 +
   20.82 +    public String formatKind(D diag, Locale l) {
   20.83 +        return formatter.formatKind(diag, l);
   20.84 +    }
   20.85 +
   20.86 +    public String formatMessage(D diag, Locale l) {
   20.87 +        return formatter.formatMessage(diag, l);
   20.88 +    }
   20.89 +
   20.90 +    public String formatPosition(D diag, PositionKind pk, Locale l) {
   20.91 +        return formatter.formatPosition(diag, pk, l);
   20.92 +    }
   20.93 +
   20.94 +    public String formatSource(D diag, boolean fullname, Locale l) {
   20.95 +        return formatter.formatSource(diag, fullname, l);
   20.96 +    }
   20.97 +
   20.98 +    /**
   20.99 +     * A delegated formatter configuration delegates all configurations settings
  20.100 +     * to an underlying configuration object (aka the delegated configuration).
  20.101 +     */
  20.102 +    public static class ForwardingConfiguration implements DiagnosticFormatter.Configuration {
  20.103 +
  20.104 +        /** The configurationr object to which the forwarding configuration delegates some settings */
  20.105 +        protected Configuration configuration;
  20.106 +
  20.107 +        public ForwardingConfiguration(Configuration configuration) {
  20.108 +            this.configuration = configuration;
  20.109 +        }
  20.110 +
  20.111 +        /**
  20.112 +         * Returns the underlying delegated configuration.
  20.113 +         * @return delegated configuration
  20.114 +         */
  20.115 +        public Configuration getDelegatedConfiguration() {
  20.116 +            return configuration;
  20.117 +        }
  20.118 +
  20.119 +        public int getMultilineLimit(MultilineLimit limit) {
  20.120 +            return configuration.getMultilineLimit(limit);
  20.121 +        }
  20.122 +
  20.123 +        public Set<DiagnosticPart> getVisible() {
  20.124 +            return configuration.getVisible();
  20.125 +        }
  20.126 +
  20.127 +        public void setMultilineLimit(MultilineLimit limit, int value) {
  20.128 +            configuration.setMultilineLimit(limit, value);
  20.129 +        }
  20.130 +
  20.131 +        public void setVisible(Set<DiagnosticPart> diagParts) {
  20.132 +            configuration.setVisible(diagParts);
  20.133 +        }
  20.134 +    }
  20.135 +}
    21.1 --- a/src/share/classes/com/sun/tools/javac/util/RawDiagnosticFormatter.java	Thu Jun 11 10:54:31 2009 -0700
    21.2 +++ b/src/share/classes/com/sun/tools/javac/util/RawDiagnosticFormatter.java	Thu Jun 11 21:35:12 2009 -0700
    21.3 @@ -124,4 +124,9 @@
    21.4          }
    21.5          return buf.toString();
    21.6      }
    21.7 +
    21.8 +    @Override
    21.9 +    public boolean isRaw() {
   21.10 +        return true;
   21.11 +    }
   21.12  }
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java	Thu Jun 11 21:35:12 2009 -0700
    22.3 @@ -0,0 +1,648 @@
    22.4 +/*
    22.5 + * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
    22.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    22.7 + *
    22.8 + * This code is free software; you can redistribute it and/or modify it
    22.9 + * under the terms of the GNU General Public License version 2 only, as
   22.10 + * published by the Free Software Foundation.  Sun designates this
   22.11 + * particular file as subject to the "Classpath" exception as provided
   22.12 + * by Sun in the LICENSE file that accompanied this code.
   22.13 + *
   22.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
   22.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   22.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   22.17 + * version 2 for more details (a copy is included in the LICENSE file that
   22.18 + * accompanied this code).
   22.19 + *
   22.20 + * You should have received a copy of the GNU General Public License version
   22.21 + * 2 along with this work; if not, write to the Free Software Foundation,
   22.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   22.23 + *
   22.24 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   22.25 + * CA 95054 USA or visit www.sun.com if you need additional information or
   22.26 + * have any questions.
   22.27 + */
   22.28 +package com.sun.tools.javac.util;
   22.29 +
   22.30 +import java.util.EnumSet;
   22.31 +import java.util.HashMap;
   22.32 +import java.util.LinkedHashMap;
   22.33 +import java.util.Locale;
   22.34 +import java.util.Map;
   22.35 +
   22.36 +import com.sun.tools.javac.code.Kinds;
   22.37 +import com.sun.tools.javac.code.Printer;
   22.38 +import com.sun.tools.javac.code.Symbol;
   22.39 +import com.sun.tools.javac.code.Symbol.*;
   22.40 +import com.sun.tools.javac.code.Symtab;
   22.41 +import com.sun.tools.javac.code.Type;
   22.42 +import com.sun.tools.javac.code.Type.*;
   22.43 +import com.sun.tools.javac.code.Types;
   22.44 +
   22.45 +import static com.sun.tools.javac.code.TypeTags.*;
   22.46 +import static com.sun.tools.javac.code.Flags.*;
   22.47 +import static com.sun.tools.javac.util.LayoutCharacters.*;
   22.48 +import static com.sun.tools.javac.util.RichDiagnosticFormatter.RichConfiguration.*;
   22.49 +
   22.50 +/**
   22.51 + * A rich diagnostic formatter is a formatter that provides better integration
   22.52 + * with javac's type system. A diagostic is first preprocessed in order to keep
   22.53 + * track of each types/symbols in it; after these informations are collected,
   22.54 + * the diagnostic is rendered using a standard formatter, whose type/symbol printer
   22.55 + * has been replaced by a more refined version provided by this rich formatter.
   22.56 + * The rich formatter currently enables three different features: (i) simple class
   22.57 + * names - that is class names are displayed used a non qualified name (thus
   22.58 + * omitting package info) whenever possible - (ii) where clause list - a list of
   22.59 + * additional subdiagnostics that provide specific info about type-variables,
   22.60 + * captured types, intersection types that occur in the diagnostic that is to be
   22.61 + * formatted and (iii) type-variable disambiguation - when the diagnostic refers
   22.62 + * to two different type-variables with the same name, their representation is
   22.63 + * disambiguated by appending an index to the type variable name.
   22.64 + */
   22.65 +public class RichDiagnosticFormatter extends
   22.66 +        ForwardingDiagnosticFormatter<JCDiagnostic, AbstractDiagnosticFormatter> {
   22.67 +
   22.68 +    final Symtab syms;
   22.69 +    final Types types;
   22.70 +    final JCDiagnostic.Factory diags;
   22.71 +    final JavacMessages messages;
   22.72 +
   22.73 +    /* name simplifier used by this formatter */
   22.74 +    ClassNameSimplifier nameSimplifier;
   22.75 +
   22.76 +    /* map for keeping track of a where clause associated to a given type */
   22.77 +    Map<WhereClauseKind, Map<Type, JCDiagnostic>> whereClauses;
   22.78 +
   22.79 +    /** Get the DiagnosticFormatter instance for this context. */
   22.80 +    public static RichDiagnosticFormatter instance(Context context) {
   22.81 +        RichDiagnosticFormatter instance = context.get(RichDiagnosticFormatter.class);
   22.82 +        if (instance == null)
   22.83 +            instance = new RichDiagnosticFormatter(context);
   22.84 +        return instance;
   22.85 +    }
   22.86 +
   22.87 +    protected RichDiagnosticFormatter(Context context) {
   22.88 +        super((AbstractDiagnosticFormatter)Log.instance(context).getDiagnosticFormatter());
   22.89 +        this.formatter.setPrinter(printer);
   22.90 +        this.syms = Symtab.instance(context);
   22.91 +        this.diags = JCDiagnostic.Factory.instance(context);
   22.92 +        this.types = Types.instance(context);
   22.93 +        this.messages = JavacMessages.instance(context);
   22.94 +        whereClauses = new LinkedHashMap<WhereClauseKind, Map<Type, JCDiagnostic>>();
   22.95 +        configuration = new RichConfiguration(Options.instance(context), formatter);
   22.96 +        for (WhereClauseKind kind : WhereClauseKind.values())
   22.97 +            whereClauses.put(kind, new LinkedHashMap<Type, JCDiagnostic>());
   22.98 +    }
   22.99 +
  22.100 +    @Override
  22.101 +    public String format(JCDiagnostic diag, Locale l) {
  22.102 +        StringBuilder sb = new StringBuilder();
  22.103 +        nameSimplifier = new ClassNameSimplifier();
  22.104 +        for (WhereClauseKind kind : WhereClauseKind.values())
  22.105 +            whereClauses.get(kind).clear();
  22.106 +        preprocessDiagnostic(diag);
  22.107 +        sb.append(formatter.format(diag, l));
  22.108 +        if (getConfiguration().isEnabled(RichFormatterFeature.WHERE_CLAUSES)) {
  22.109 +            List<JCDiagnostic> clauses = getWhereClauses();
  22.110 +            String indent = formatter.isRaw() ? "" :
  22.111 +                formatter.indentString(DetailsInc);
  22.112 +            for (JCDiagnostic d : clauses) {
  22.113 +                String whereClause = formatter.format(d, l);
  22.114 +                if (whereClause.length() > 0) {
  22.115 +                    sb.append('\n' + indent + whereClause);
  22.116 +                }
  22.117 +            }
  22.118 +        }
  22.119 +        return sb.toString();
  22.120 +    }
  22.121 +
  22.122 +    /**
  22.123 +     * Preprocess a given diagnostic by looking both into its arguments and into
  22.124 +     * its subdiagnostics (if any). This preprocessing is responsible for
  22.125 +     * generating info corresponding to features like where clauses, name
  22.126 +     * simplification, etc.
  22.127 +     *
  22.128 +     * @param diag the diagnostic to be preprocessed
  22.129 +     */
  22.130 +    protected void preprocessDiagnostic(JCDiagnostic diag) {
  22.131 +        for (Object o : diag.getArgs()) {
  22.132 +            if (o != null) {
  22.133 +                preprocessArgument(o);
  22.134 +            }
  22.135 +        }
  22.136 +        if (diag.isMultiline()) {
  22.137 +            for (JCDiagnostic d : diag.getSubdiagnostics())
  22.138 +                preprocessDiagnostic(d);
  22.139 +        }
  22.140 +    }
  22.141 +
  22.142 +    /**
  22.143 +     * Preprocess a diagnostic argument. A type/symbol argument is
  22.144 +     * preprocessed by specialized type/symbol preprocessors.
  22.145 +     *
  22.146 +     * @param arg the argument to be translated
  22.147 +     */
  22.148 +    protected void preprocessArgument(Object arg) {
  22.149 +        if (arg instanceof Type) {
  22.150 +            preprocessType((Type)arg);
  22.151 +        }
  22.152 +        else if (arg instanceof Symbol) {
  22.153 +            preprocessSymbol((Symbol)arg);
  22.154 +        }
  22.155 +        else if (arg instanceof JCDiagnostic) {
  22.156 +            preprocessDiagnostic((JCDiagnostic)arg);
  22.157 +        }
  22.158 +        else if (arg instanceof Iterable<?>) {
  22.159 +            for (Object o : (Iterable<?>)arg) {
  22.160 +                preprocessArgument(o);
  22.161 +            }
  22.162 +        }
  22.163 +    }
  22.164 +
  22.165 +    /**
  22.166 +     * Build a list of multiline diagnostics containing detailed info about
  22.167 +     * type-variables, captured types, and intersection types
  22.168 +     *
  22.169 +     * @return where clause list
  22.170 +     */
  22.171 +    protected List<JCDiagnostic> getWhereClauses() {
  22.172 +        List<JCDiagnostic> clauses = List.nil();
  22.173 +        for (WhereClauseKind kind : WhereClauseKind.values()) {
  22.174 +            List<JCDiagnostic> lines = List.nil();
  22.175 +            for (Map.Entry<Type, JCDiagnostic> entry : whereClauses.get(kind).entrySet()) {
  22.176 +                lines = lines.prepend(entry.getValue());
  22.177 +            }
  22.178 +            if (!lines.isEmpty()) {
  22.179 +                String key = kind.key();
  22.180 +                if (lines.size() > 1)
  22.181 +                    key += ".1";
  22.182 +                JCDiagnostic d = diags.fragment(key, whereClauses.get(kind).keySet());
  22.183 +                d = new JCDiagnostic.MultilineDiagnostic(d, lines.reverse());
  22.184 +                clauses = clauses.prepend(d);
  22.185 +            }
  22.186 +        }
  22.187 +        return clauses.reverse();
  22.188 +    }
  22.189 +    //where
  22.190 +    /**
  22.191 +     * This enum defines all posssible kinds of where clauses that can be
  22.192 +     * attached by a rich diagnostic formatter to a given diagnostic
  22.193 +     */
  22.194 +    enum WhereClauseKind {
  22.195 +
  22.196 +        /** where clause regarding a type variable */
  22.197 +        TYPEVAR("where.description.typevar"),
  22.198 +        /** where clause regarding a captured type */
  22.199 +        CAPTURED("where.description.captured"),
  22.200 +        /** where clause regarding an intersection type */
  22.201 +        INTERSECTION("where.description.intersection");
  22.202 +
  22.203 +        /** resource key for this where clause kind */
  22.204 +        private String key;
  22.205 +
  22.206 +        WhereClauseKind(String key) {
  22.207 +            this.key = key;
  22.208 +        }
  22.209 +
  22.210 +        String key() {
  22.211 +            return key;
  22.212 +        }
  22.213 +    }
  22.214 +
  22.215 +    // <editor-fold defaultstate="collapsed" desc="name simplifier">
  22.216 +    /**
  22.217 +     * A name simplifier keeps track of class names usages in order to determine
  22.218 +     * whether a class name can be compacted or not. Short names are not used
  22.219 +     * if a conflict is detected, e.g. when two classes with the same simple
  22.220 +     * name belong to different packages - in this case the formatter reverts
  22.221 +     * to fullnames as compact names might lead to a confusing diagnostic.
  22.222 +     */
  22.223 +    class ClassNameSimplifier {
  22.224 +
  22.225 +        /* table for keeping track of all short name usages */
  22.226 +        Map<Name, List<Symbol>> nameClashes = new HashMap<Name, List<Symbol>>();
  22.227 +
  22.228 +        /**
  22.229 +         * Add a name usage to the simplifier's internal cache
  22.230 +         */
  22.231 +        protected void addUsage(Symbol sym) {
  22.232 +            Name n = sym.getSimpleName();
  22.233 +            List<Symbol> conflicts = nameClashes.get(n);
  22.234 +            if (conflicts == null) {
  22.235 +                conflicts = List.nil();
  22.236 +            }
  22.237 +            if (!conflicts.contains(sym))
  22.238 +                nameClashes.put(n, conflicts.append(sym));
  22.239 +        }
  22.240 +
  22.241 +        public String simplify(Symbol s) {
  22.242 +            String name = s.getQualifiedName().toString();
  22.243 +            if (!s.type.isCompound()) {
  22.244 +                List<Symbol> conflicts = nameClashes.get(s.getSimpleName());
  22.245 +                if (conflicts == null ||
  22.246 +                    (conflicts.size() == 1 &&
  22.247 +                    conflicts.contains(s))) {
  22.248 +                    List<Name> l = List.nil();
  22.249 +                    Symbol s2 = s;
  22.250 +                    while (s2.type.getEnclosingType().tag == CLASS
  22.251 +                            && s2.owner.kind == Kinds.TYP) {
  22.252 +                        l = l.prepend(s2.getSimpleName());
  22.253 +                        s2 = s2.owner;
  22.254 +                    }
  22.255 +                    l = l.prepend(s2.getSimpleName());
  22.256 +                    StringBuilder buf = new StringBuilder();
  22.257 +                    String sep = "";
  22.258 +                    for (Name n2 : l) {
  22.259 +                        buf.append(sep);
  22.260 +                        buf.append(n2);
  22.261 +                        sep = ".";
  22.262 +                    }
  22.263 +                    name = buf.toString();
  22.264 +                }
  22.265 +            }
  22.266 +            return name;
  22.267 +        }
  22.268 +    };
  22.269 +    // </editor-fold>
  22.270 +
  22.271 +    // <editor-fold defaultstate="collapsed" desc="rich printer">
  22.272 +    /**
  22.273 +     * Enhanced type/symbol printer that provides support for features like simple names
  22.274 +     * and type variable disambiguation. This enriched printer exploits the info
  22.275 +     * discovered during type/symbol preprocessing. This printer is set on the delegate
  22.276 +     * formatter so that rich type/symbol info can be properly rendered.
  22.277 +     */
  22.278 +    protected Printer printer = new Printer() {
  22.279 +
  22.280 +        @Override
  22.281 +        public String localize(Locale locale, String key, Object... args) {
  22.282 +            return formatter.localize(locale, key, args);
  22.283 +        }
  22.284 +
  22.285 +        @Override
  22.286 +        public String capturedVarId(CapturedType t, Locale locale) {
  22.287 +            return indexOf(t, WhereClauseKind.CAPTURED) + "";
  22.288 +        }
  22.289 +
  22.290 +        @Override
  22.291 +        public String visitType(Type t, Locale locale) {
  22.292 +            String s = super.visitType(t, locale);
  22.293 +            if (t == syms.botType)
  22.294 +                s = localize(locale, "compiler.misc.type.null");
  22.295 +            return s;
  22.296 +        }
  22.297 +
  22.298 +        @Override
  22.299 +        public String visitCapturedType(CapturedType t, Locale locale) {
  22.300 +            if (getConfiguration().isEnabled(RichFormatterFeature.WHERE_CLAUSES)) {
  22.301 +                return localize(locale,
  22.302 +                    "compiler.misc.captured.type",
  22.303 +                    indexOf(t, WhereClauseKind.CAPTURED));
  22.304 +            }
  22.305 +            else
  22.306 +                return super.visitCapturedType(t, locale);
  22.307 +        }
  22.308 +
  22.309 +        @Override
  22.310 +        public String visitClassType(ClassType t, Locale locale) {
  22.311 +            if (t.isCompound() &&
  22.312 +                    getConfiguration().isEnabled(RichFormatterFeature.WHERE_CLAUSES)) {
  22.313 +                return localize(locale,
  22.314 +                        "compiler.misc.intersection.type",
  22.315 +                        indexOf(t, WhereClauseKind.INTERSECTION));
  22.316 +            }
  22.317 +            else
  22.318 +                return super.visitClassType(t, locale);
  22.319 +        }
  22.320 +
  22.321 +        @Override
  22.322 +        protected String className(ClassType t, boolean longform, Locale locale) {
  22.323 +            Symbol sym = t.tsym;
  22.324 +            if (sym.name.length() == 0 ||
  22.325 +                    !getConfiguration().isEnabled(RichFormatterFeature.SIMPLE_NAMES)) {
  22.326 +                return super.className(t, longform, locale);
  22.327 +            }
  22.328 +            else if (longform)
  22.329 +                return nameSimplifier.simplify(sym).toString();
  22.330 +            else
  22.331 +                return sym.name.toString();
  22.332 +        }
  22.333 +
  22.334 +        @Override
  22.335 +        public String visitTypeVar(TypeVar t, Locale locale) {
  22.336 +            if (unique(t) ||
  22.337 +                    !getConfiguration().isEnabled(RichFormatterFeature.UNIQUE_TYPEVAR_NAMES)) {
  22.338 +                return t.toString();
  22.339 +            }
  22.340 +            else {
  22.341 +                return localize(locale,
  22.342 +                        "compiler.misc.type.var",
  22.343 +                        t.toString(), indexOf(t, WhereClauseKind.TYPEVAR));
  22.344 +            }
  22.345 +        }
  22.346 +
  22.347 +        private int indexOf(Type type, WhereClauseKind kind) {
  22.348 +            int index = 0;
  22.349 +            boolean found = false;
  22.350 +            for (Type t : whereClauses.get(kind).keySet()) {
  22.351 +                if (t == type) {
  22.352 +                    found = true;
  22.353 +                    break;
  22.354 +                }
  22.355 +                index++;
  22.356 +            }
  22.357 +            if (!found)
  22.358 +                throw new AssertionError("Missing symbol in where clause " + type);
  22.359 +            return index + 1;
  22.360 +        }
  22.361 +
  22.362 +        private boolean unique(TypeVar typevar) {
  22.363 +            int found = 0;
  22.364 +            for (Type t : whereClauses.get(WhereClauseKind.TYPEVAR).keySet()) {
  22.365 +                if (t.toString().equals(typevar.toString())) {
  22.366 +                    found++;
  22.367 +                }
  22.368 +            }
  22.369 +            if (found < 1)
  22.370 +                throw new AssertionError("Missing type variable in where clause " + typevar);
  22.371 +            return found == 1;
  22.372 +        }
  22.373 +
  22.374 +        @Override
  22.375 +        protected String printMethodArgs(List<Type> args, boolean varArgs, Locale locale) {
  22.376 +            return super.printMethodArgs(args, varArgs, locale);
  22.377 +        }
  22.378 +
  22.379 +        @Override
  22.380 +        public String visitClassSymbol(ClassSymbol s, Locale locale) {
  22.381 +            String name = nameSimplifier.simplify(s);
  22.382 +            if (name.length() == 0 ||
  22.383 +                    !getConfiguration().isEnabled(RichFormatterFeature.SIMPLE_NAMES)) {
  22.384 +                return super.visitClassSymbol(s, locale);
  22.385 +            }
  22.386 +            else {
  22.387 +                return name;
  22.388 +            }
  22.389 +        }
  22.390 +
  22.391 +        @Override
  22.392 +        public String visitMethodSymbol(MethodSymbol s, Locale locale) {
  22.393 +            String ownerName = visit(s.owner, locale);
  22.394 +            if ((s.flags() & BLOCK) != 0) {
  22.395 +               return ownerName;
  22.396 +            } else {
  22.397 +                String ms = (s.name == s.name.table.names.init)
  22.398 +                    ? ownerName
  22.399 +                    : s.name.toString();
  22.400 +                if (s.type != null) {
  22.401 +                    if (s.type.tag == FORALL) {
  22.402 +                        ms = "<" + visitTypes(s.type.getTypeArguments(), locale) + ">" + ms;
  22.403 +                    }
  22.404 +                    ms += "(" + printMethodArgs(
  22.405 +                            s.type.getParameterTypes(),
  22.406 +                            (s.flags() & VARARGS) != 0,
  22.407 +                            locale) + ")";
  22.408 +                }
  22.409 +                return ms;
  22.410 +            }
  22.411 +        }
  22.412 +    };
  22.413 +    // </editor-fold>
  22.414 +
  22.415 +    // <editor-fold defaultstate="collapsed" desc="type scanner">
  22.416 +    /**
  22.417 +     * Preprocess a given type looking for (i) additional info (where clauses) to be
  22.418 +     * added to the main diagnostic (ii) names to be compacted.
  22.419 +     */
  22.420 +    protected void preprocessType(Type t) {
  22.421 +        typePreprocessor.visit(t);
  22.422 +    }
  22.423 +    //where
  22.424 +    protected Types.UnaryVisitor<Void> typePreprocessor =
  22.425 +            new Types.UnaryVisitor<Void>() {
  22.426 +
  22.427 +        public Void visit(List<Type> ts) {
  22.428 +            for (Type t : ts)
  22.429 +                visit(t);
  22.430 +            return null;
  22.431 +        }
  22.432 +
  22.433 +        @Override
  22.434 +        public Void visitForAll(ForAll t, Void ignored) {
  22.435 +            visit(t.tvars);
  22.436 +            visit(t.qtype);
  22.437 +            return null;
  22.438 +        }
  22.439 +
  22.440 +        @Override
  22.441 +        public Void visitMethodType(MethodType t, Void ignored) {
  22.442 +            visit(t.argtypes);
  22.443 +            visit(t.restype);
  22.444 +            return null;
  22.445 +        }
  22.446 +
  22.447 +        @Override
  22.448 +        public Void visitErrorType(ErrorType t, Void ignored) {
  22.449 +            Type ot = t.getOriginalType();
  22.450 +            if (ot != null)
  22.451 +                visit(ot);
  22.452 +            return null;
  22.453 +        }
  22.454 +
  22.455 +        @Override
  22.456 +        public Void visitArrayType(ArrayType t, Void ignored) {
  22.457 +            visit(t.elemtype);
  22.458 +            return null;
  22.459 +        }
  22.460 +
  22.461 +        @Override
  22.462 +        public Void visitWildcardType(WildcardType t, Void ignored) {
  22.463 +            visit(t.type);
  22.464 +            return null;
  22.465 +        }
  22.466 +
  22.467 +        public Void visitType(Type t, Void ignored) {
  22.468 +            return null;
  22.469 +        }
  22.470 +
  22.471 +        @Override
  22.472 +        public Void visitCapturedType(CapturedType t, Void ignored) {
  22.473 +            if (!whereClauses.get(WhereClauseKind.CAPTURED).containsKey(t)) {
  22.474 +                String suffix = t.lower == syms.botType ? ".1" : "";
  22.475 +                JCDiagnostic d = diags.fragment("where.captured"+ suffix, t, t.bound, t.lower, t.wildcard);
  22.476 +                whereClauses.get(WhereClauseKind.CAPTURED).put(t, d);
  22.477 +                visit(t.wildcard);
  22.478 +                visit(t.lower);
  22.479 +                visit(t.bound);
  22.480 +            }
  22.481 +            return null;
  22.482 +        }
  22.483 +
  22.484 +        @Override
  22.485 +        public Void visitClassType(ClassType t, Void ignored) {
  22.486 +            if (t.isCompound()) {
  22.487 +                if (!whereClauses.get(WhereClauseKind.INTERSECTION).containsKey(t)) {
  22.488 +                    Type supertype = types.supertype(t);
  22.489 +                    List<Type> interfaces = types.interfaces(t);
  22.490 +                    JCDiagnostic d = diags.fragment("where.intersection", t, interfaces.prepend(supertype));
  22.491 +                    whereClauses.get(WhereClauseKind.INTERSECTION).put(t, d);
  22.492 +                    visit(supertype);
  22.493 +                    visit(interfaces);
  22.494 +                }
  22.495 +            }
  22.496 +            nameSimplifier.addUsage(t.tsym);
  22.497 +            visit(t.getTypeArguments());
  22.498 +            if (t.getEnclosingType() != Type.noType)
  22.499 +                visit(t.getEnclosingType());
  22.500 +            return null;
  22.501 +        }
  22.502 +
  22.503 +        @Override
  22.504 +        public Void visitTypeVar(TypeVar t, Void ignored) {
  22.505 +            if (!whereClauses.get(WhereClauseKind.TYPEVAR).containsKey(t)) {
  22.506 +                Type bound = t.bound;
  22.507 +                while ((bound instanceof ErrorType))
  22.508 +                    bound = ((ErrorType)bound).getOriginalType();
  22.509 +                List<Type> bounds  = types.getBounds(t);
  22.510 +                nameSimplifier.addUsage(t.tsym);
  22.511 +
  22.512 +                boolean boundErroneous = bounds.head == null ||
  22.513 +                                         bounds.head.tag == NONE ||
  22.514 +                                         bounds.head.tag == ERROR;
  22.515 +
  22.516 +
  22.517 +                JCDiagnostic d = diags.fragment("where.typevar" +
  22.518 +                        (boundErroneous ? ".1" : ""), t, bounds,
  22.519 +                        Kinds.kindName(t.tsym.location()), t.tsym.location());
  22.520 +                whereClauses.get(WhereClauseKind.TYPEVAR).put(t, d);
  22.521 +                symbolPreprocessor.visit(t.tsym.location(), null);
  22.522 +                visit(bounds);
  22.523 +            }
  22.524 +            return null;
  22.525 +        }
  22.526 +    };
  22.527 +    // </editor-fold>
  22.528 +
  22.529 +    // <editor-fold defaultstate="collapsed" desc="symbol scanner">
  22.530 +    /**
  22.531 +     * Preprocess a given symbol looking for (i) additional info (where clauses) to be
  22.532 +     * asdded to the main diagnostic (ii) names to be compacted
  22.533 +     */
  22.534 +    protected void preprocessSymbol(Symbol s) {
  22.535 +        symbolPreprocessor.visit(s, null);
  22.536 +    }
  22.537 +    //where
  22.538 +    protected Types.DefaultSymbolVisitor<Void, Void> symbolPreprocessor =
  22.539 +            new Types.DefaultSymbolVisitor<Void, Void>() {
  22.540 +
  22.541 +        @Override
  22.542 +        public Void visitClassSymbol(ClassSymbol s, Void ignored) {
  22.543 +            nameSimplifier.addUsage(s);
  22.544 +            return null;
  22.545 +        }
  22.546 +
  22.547 +        @Override
  22.548 +        public Void visitSymbol(Symbol s, Void ignored) {
  22.549 +            return null;
  22.550 +        }
  22.551 +
  22.552 +        @Override
  22.553 +        public Void visitMethodSymbol(MethodSymbol s, Void ignored) {
  22.554 +            visit(s.owner, null);
  22.555 +            typePreprocessor.visit(s.type);
  22.556 +            return null;
  22.557 +        }
  22.558 +    };
  22.559 +    // </editor-fold>
  22.560 +
  22.561 +    @Override
  22.562 +    public RichConfiguration getConfiguration() {
  22.563 +        //the following cast is always safe - see init
  22.564 +        return (RichConfiguration)configuration;
  22.565 +    }
  22.566 +
  22.567 +    /**
  22.568 +     * Configuration object provided by the rich formatter.
  22.569 +     */
  22.570 +    public static class RichConfiguration extends ForwardingDiagnosticFormatter.ForwardingConfiguration {
  22.571 +
  22.572 +        /** set of enabled rich formatter's features */
  22.573 +        protected java.util.EnumSet<RichFormatterFeature> features;
  22.574 +
  22.575 +        @SuppressWarnings("fallthrough")
  22.576 +        public RichConfiguration(Options options, AbstractDiagnosticFormatter formatter) {
  22.577 +            super(formatter.getConfiguration());
  22.578 +            features = formatter.isRaw() ? EnumSet.noneOf(RichFormatterFeature.class) :
  22.579 +                EnumSet.of(RichFormatterFeature.SIMPLE_NAMES,
  22.580 +                    RichFormatterFeature.WHERE_CLAUSES,
  22.581 +                    RichFormatterFeature.UNIQUE_TYPEVAR_NAMES);
  22.582 +            String diagOpts = options.get("diags");
  22.583 +            if (diagOpts != null) {
  22.584 +                for (String args: diagOpts.split(",")) {
  22.585 +                    if (args.equals("-where")) {
  22.586 +                        features.remove(RichFormatterFeature.WHERE_CLAUSES);
  22.587 +                    }
  22.588 +                    else if (args.equals("where")) {
  22.589 +                        features.add(RichFormatterFeature.WHERE_CLAUSES);
  22.590 +                    }
  22.591 +                    if (args.equals("-simpleNames")) {
  22.592 +                        features.remove(RichFormatterFeature.SIMPLE_NAMES);
  22.593 +                    }
  22.594 +                    else if (args.equals("simpleNames")) {
  22.595 +                        features.add(RichFormatterFeature.SIMPLE_NAMES);
  22.596 +                    }
  22.597 +                    if (args.equals("-disambiguateTvars")) {
  22.598 +                        features.remove(RichFormatterFeature.UNIQUE_TYPEVAR_NAMES);
  22.599 +                    }
  22.600 +                    else if (args.equals("disambiguateTvars")) {
  22.601 +                        features.add(RichFormatterFeature.UNIQUE_TYPEVAR_NAMES);
  22.602 +                    }
  22.603 +                }
  22.604 +            }
  22.605 +        }
  22.606 +
  22.607 +        /**
  22.608 +         * Returns a list of all the features supported by the rich formatter.
  22.609 +         * @return list of supported features
  22.610 +         */
  22.611 +        public RichFormatterFeature[] getAvailableFeatures() {
  22.612 +            return RichFormatterFeature.values();
  22.613 +        }
  22.614 +
  22.615 +        /**
  22.616 +         * Enable a specific feature on this rich formatter.
  22.617 +         * @param feature feature to be enabled
  22.618 +         */
  22.619 +        public void enable(RichFormatterFeature feature) {
  22.620 +            features.add(feature);
  22.621 +        }
  22.622 +
  22.623 +        /**
  22.624 +         * Disable a specific feature on this rich formatter.
  22.625 +         * @param feature feature to be disabled
  22.626 +         */
  22.627 +        public void disable(RichFormatterFeature feature) {
  22.628 +            features.remove(feature);
  22.629 +        }
  22.630 +
  22.631 +        /**
  22.632 +         * Is a given feature enabled on this formatter?
  22.633 +         * @param feature feature to be tested
  22.634 +         */
  22.635 +        public boolean isEnabled(RichFormatterFeature feature) {
  22.636 +            return features.contains(feature);
  22.637 +        }
  22.638 +
  22.639 +        /**
  22.640 +         * The advanced formatting features provided by the rich formatter
  22.641 +         */
  22.642 +        public enum RichFormatterFeature {
  22.643 +            /** a list of additional info regarding a given type/symbol */
  22.644 +            WHERE_CLAUSES,
  22.645 +            /** full class names simplification (where possible) */
  22.646 +            SIMPLE_NAMES,
  22.647 +            /** type-variable names disambiguation */
  22.648 +            UNIQUE_TYPEVAR_NAMES;
  22.649 +        }
  22.650 +    }
  22.651 +}
    23.1 --- a/src/share/classes/com/sun/tools/javap/BasicWriter.java	Thu Jun 11 10:54:31 2009 -0700
    23.2 +++ b/src/share/classes/com/sun/tools/javap/BasicWriter.java	Thu Jun 11 21:35:12 2009 -0700
    23.3 @@ -44,6 +44,9 @@
    23.4      protected BasicWriter(Context context) {
    23.5          lineWriter = LineWriter.instance(context);
    23.6          out = context.get(PrintWriter.class);
    23.7 +        messages = context.get(Messages.class);
    23.8 +        if (messages == null)
    23.9 +            throw new AssertionError();
   23.10      }
   23.11  
   23.12      protected void print(String s) {
   23.13 @@ -88,8 +91,26 @@
   23.14          return "???";
   23.15      }
   23.16  
   23.17 +    protected String space(int w) {
   23.18 +        if (w < spaces.length && spaces[w] != null)
   23.19 +            return spaces[w];
   23.20 +
   23.21 +        StringBuilder sb = new StringBuilder();
   23.22 +        for (int i = 0; i < w; i++)
   23.23 +            sb.append(" ");
   23.24 +
   23.25 +        String s = sb.toString();
   23.26 +        if (w < spaces.length)
   23.27 +            spaces[w] = s;
   23.28 +
   23.29 +        return s;
   23.30 +    }
   23.31 +
   23.32 +    private String[] spaces = new String[80];
   23.33 +
   23.34      private LineWriter lineWriter;
   23.35      private PrintWriter out;
   23.36 +    protected Messages messages;
   23.37  
   23.38      private static class LineWriter {
   23.39          static LineWriter instance(Context context) {
    24.1 --- a/src/share/classes/com/sun/tools/javap/ClassWriter.java	Thu Jun 11 10:54:31 2009 -0700
    24.2 +++ b/src/share/classes/com/sun/tools/javap/ClassWriter.java	Thu Jun 11 21:35:12 2009 -0700
    24.3 @@ -26,7 +26,9 @@
    24.4  package com.sun.tools.javap;
    24.5  
    24.6  import java.net.URI;
    24.7 +import java.text.DateFormat;
    24.8  import java.util.Collection;
    24.9 +import java.util.Date;
   24.10  import java.util.List;
   24.11  
   24.12  import com.sun.tools.classfile.AccessFlags;
   24.13 @@ -47,8 +49,6 @@
   24.14  import com.sun.tools.classfile.SourceFile_attribute;
   24.15  import com.sun.tools.classfile.Type;
   24.16  
   24.17 -import java.text.DateFormat;
   24.18 -import java.util.Date;
   24.19  import static com.sun.tools.classfile.AccessFlags.*;
   24.20  
   24.21  /*
    25.1 --- a/src/share/classes/com/sun/tools/javap/CodeWriter.java	Thu Jun 11 10:54:31 2009 -0700
    25.2 +++ b/src/share/classes/com/sun/tools/javap/CodeWriter.java	Thu Jun 11 21:35:12 2009 -0700
    25.3 @@ -25,6 +25,9 @@
    25.4  
    25.5  package com.sun.tools.javap;
    25.6  
    25.7 +import java.util.ArrayList;
    25.8 +import java.util.List;
    25.9 +
   25.10  import com.sun.tools.classfile.AccessFlags;
   25.11  import com.sun.tools.classfile.Code_attribute;
   25.12  import com.sun.tools.classfile.ConstantPool;
   25.13 @@ -33,9 +36,6 @@
   25.14  import com.sun.tools.classfile.Instruction;
   25.15  import com.sun.tools.classfile.Instruction.TypeKind;
   25.16  import com.sun.tools.classfile.Method;
   25.17 -import com.sun.tools.classfile.Opcode;
   25.18 -
   25.19 -//import static com.sun.tools.classfile.OpCodes.*;
   25.20  
   25.21  /*
   25.22   *  Write the contents of a Code attribute.
   25.23 @@ -59,6 +59,12 @@
   25.24          attrWriter = AttributeWriter.instance(context);
   25.25          classWriter = ClassWriter.instance(context);
   25.26          constantWriter = ConstantWriter.instance(context);
   25.27 +        sourceWriter = SourceWriter.instance(context);
   25.28 +        tryBlockWriter = TryBlockWriter.instance(context);
   25.29 +        stackMapWriter = StackMapWriter.instance(context);
   25.30 +        localVariableTableWriter = LocalVariableTableWriter.instance(context);
   25.31 +        localVariableTypeTableWriter = LocalVariableTypeTableWriter.instance(context);
   25.32 +        options = Options.instance(context);
   25.33      }
   25.34  
   25.35      void write(Code_attribute attr, ConstantPool constant_pool) {
   25.36 @@ -90,14 +96,21 @@
   25.37      }
   25.38  
   25.39      public void writeInstrs(Code_attribute attr) {
   25.40 +        List<InstructionDetailWriter> detailWriters = getDetailWriters(attr);
   25.41 +
   25.42          for (Instruction instr: attr.getInstructions()) {
   25.43              try {
   25.44 +                for (InstructionDetailWriter w: detailWriters)
   25.45 +                    w.writeDetails(instr);
   25.46                  writeInstr(instr);
   25.47              } catch (ArrayIndexOutOfBoundsException e) {
   25.48                  println(report("error at or after byte " + instr.getPC()));
   25.49                  break;
   25.50              }
   25.51          }
   25.52 +
   25.53 +        for (InstructionDetailWriter w: detailWriters)
   25.54 +            w.flush();
   25.55      }
   25.56  
   25.57      public void writeInstr(Instruction instr) {
   25.58 @@ -211,11 +224,45 @@
   25.59          print(s);
   25.60      }
   25.61  
   25.62 -    private static int align(int n) {
   25.63 -        return (n + 3) & ~3;
   25.64 +    private List<InstructionDetailWriter> getDetailWriters(Code_attribute attr) {
   25.65 +        List<InstructionDetailWriter> detailWriters =
   25.66 +                new ArrayList<InstructionDetailWriter>();
   25.67 +        if (options.details.contains(InstructionDetailWriter.Kind.SOURCE)) {
   25.68 +            sourceWriter.reset(classWriter.getClassFile(), attr);
   25.69 +            detailWriters.add(sourceWriter);
   25.70 +        }
   25.71 +
   25.72 +        if (options.details.contains(InstructionDetailWriter.Kind.LOCAL_VARS)) {
   25.73 +            localVariableTableWriter.reset(attr);
   25.74 +            detailWriters.add(localVariableTableWriter);
   25.75 +        }
   25.76 +
   25.77 +        if (options.details.contains(InstructionDetailWriter.Kind.LOCAL_VAR_TYPES)) {
   25.78 +            localVariableTypeTableWriter.reset(attr);
   25.79 +            detailWriters.add(localVariableTypeTableWriter);
   25.80 +        }
   25.81 +
   25.82 +        if (options.details.contains(InstructionDetailWriter.Kind.STACKMAPS)) {
   25.83 +            stackMapWriter.reset(attr);
   25.84 +            stackMapWriter.writeInitialDetails();
   25.85 +            detailWriters.add(stackMapWriter);
   25.86 +        }
   25.87 +
   25.88 +        if (options.details.contains(InstructionDetailWriter.Kind.TRY_BLOCKS)) {
   25.89 +            tryBlockWriter.reset(attr);
   25.90 +            detailWriters.add(tryBlockWriter);
   25.91 +        }
   25.92 +
   25.93 +        return detailWriters;
   25.94      }
   25.95  
   25.96      private AttributeWriter attrWriter;
   25.97      private ClassWriter classWriter;
   25.98      private ConstantWriter constantWriter;
   25.99 +    private LocalVariableTableWriter localVariableTableWriter;
  25.100 +    private LocalVariableTypeTableWriter localVariableTypeTableWriter;
  25.101 +    private SourceWriter sourceWriter;
  25.102 +    private StackMapWriter stackMapWriter;
  25.103 +    private TryBlockWriter tryBlockWriter;
  25.104 +    private Options options;
  25.105  }
    26.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.2 +++ b/src/share/classes/com/sun/tools/javap/InstructionDetailWriter.java	Thu Jun 11 21:35:12 2009 -0700
    26.3 @@ -0,0 +1,57 @@
    26.4 +/*
    26.5 + * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
    26.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    26.7 + *
    26.8 + * This code is free software; you can redistribute it and/or modify it
    26.9 + * under the terms of the GNU General Public License version 2 only, as
   26.10 + * published by the Free Software Foundation.  Sun designates this
   26.11 + * particular file as subject to the "Classpath" exception as provided
   26.12 + * by Sun in the LICENSE file that accompanied this code.
   26.13 + *
   26.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
   26.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   26.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   26.17 + * version 2 for more details (a copy is included in the LICENSE file that
   26.18 + * accompanied this code).
   26.19 + *
   26.20 + * You should have received a copy of the GNU General Public License version
   26.21 + * 2 along with this work; if not, write to the Free Software Foundation,
   26.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   26.23 + *
   26.24 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   26.25 + * CA 95054 USA or visit www.sun.com if you need additional information or
   26.26 + * have any questions.
   26.27 + */
   26.28 +
   26.29 +package com.sun.tools.javap;
   26.30 +
   26.31 +import com.sun.tools.classfile.Instruction;
   26.32 +
   26.33 +
   26.34 +/*
   26.35 + *  Write additional details for an instruction.
   26.36 + *
   26.37 + *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
   26.38 + *  you write code that depends on this, you do so at your own risk.
   26.39 + *  This code and its internal interfaces are subject to change or
   26.40 + *  deletion without notice.</b>
   26.41 + */
   26.42 +public abstract class InstructionDetailWriter extends BasicWriter {
   26.43 +    public enum Kind {
   26.44 +        LOCAL_VARS("localVariables"),
   26.45 +        LOCAL_VAR_TYPES("localVariableTypes"),
   26.46 +        SOURCE("source"),
   26.47 +        STACKMAPS("stackMaps"),
   26.48 +        TRY_BLOCKS("tryBlocks");
   26.49 +        Kind(String option) {
   26.50 +            this.option = option;
   26.51 +        }
   26.52 +        final String option;
   26.53 +    }
   26.54 +    InstructionDetailWriter(Context context) {
   26.55 +        super(context);
   26.56 +    }
   26.57 +
   26.58 +    abstract void writeDetails(Instruction instr);
   26.59 +    void flush() { }
   26.60 +}
    27.1 --- a/src/share/classes/com/sun/tools/javap/JavapTask.java	Thu Jun 11 10:54:31 2009 -0700
    27.2 +++ b/src/share/classes/com/sun/tools/javap/JavapTask.java	Thu Jun 11 21:35:12 2009 -0700
    27.3 @@ -39,6 +39,7 @@
    27.4  import java.text.MessageFormat;
    27.5  import java.util.ArrayList;
    27.6  import java.util.Arrays;
    27.7 +import java.util.EnumSet;
    27.8  import java.util.HashMap;
    27.9  import java.util.Iterator;
   27.10  import java.util.List;
   27.11 @@ -65,7 +66,7 @@
   27.12   *  This code and its internal interfaces are subject to change or
   27.13   *  deletion without notice.</b>
   27.14   */
   27.15 -public class JavapTask implements DisassemblerTool.DisassemblerTask {
   27.16 +public class JavapTask implements DisassemblerTool.DisassemblerTask, Messages {
   27.17      public class BadArgs extends Exception {
   27.18          static final long serialVersionUID = 8765093759964640721L;
   27.19          BadArgs(String key, Object... args) {
   27.20 @@ -211,9 +212,7 @@
   27.21  
   27.22          new Option(false, "-Xold") {
   27.23              void process(JavapTask task, String opt, String arg) throws BadArgs {
   27.24 -                // -Xold is only supported as first arg when invoked from
   27.25 -                // command line; this is handled in Main,main
   27.26 -                throw task.new BadArgs("err.Xold.not.supported.here");
   27.27 +                task.log.println(task.getMessage("warn.Xold.not.supported"));
   27.28              }
   27.29          },
   27.30  
   27.31 @@ -241,6 +240,56 @@
   27.32              }
   27.33          },
   27.34  
   27.35 +        new Option(false, "-XDdetails") {
   27.36 +            void process(JavapTask task, String opt, String arg) {
   27.37 +                task.options.details = EnumSet.allOf(InstructionDetailWriter.Kind.class);
   27.38 +            }
   27.39 +
   27.40 +        },
   27.41 +
   27.42 +        new Option(false, "-XDdetails:") {
   27.43 +            @Override
   27.44 +            boolean matches(String opt) {
   27.45 +                int sep = opt.indexOf(":");
   27.46 +                return sep != -1 && super.matches(opt.substring(0, sep + 1));
   27.47 +            }
   27.48 +
   27.49 +            void process(JavapTask task, String opt, String arg) throws BadArgs {
   27.50 +                int sep = opt.indexOf(":");
   27.51 +                for (String v: opt.substring(sep + 1).split("[,: ]+")) {
   27.52 +                    if (!handleArg(task, v))
   27.53 +                        throw task.new BadArgs("err.invalid.arg.for.option", v);
   27.54 +                }
   27.55 +            }
   27.56 +
   27.57 +            boolean handleArg(JavapTask task, String arg) {
   27.58 +                if (arg.length() == 0)
   27.59 +                    return true;
   27.60 +
   27.61 +                if (arg.equals("all")) {
   27.62 +                    task.options.details = EnumSet.allOf(InstructionDetailWriter.Kind.class);
   27.63 +                    return true;
   27.64 +                }
   27.65 +
   27.66 +                boolean on = true;
   27.67 +                if (arg.startsWith("-")) {
   27.68 +                    on = false;
   27.69 +                    arg = arg.substring(1);
   27.70 +                }
   27.71 +
   27.72 +                for (InstructionDetailWriter.Kind k: InstructionDetailWriter.Kind.values()) {
   27.73 +                    if (arg.equalsIgnoreCase(k.option)) {
   27.74 +                        if (on)
   27.75 +                            task.options.details.add(k);
   27.76 +                        else
   27.77 +                            task.options.details.remove(k);
   27.78 +                        return true;
   27.79 +                    }
   27.80 +                }
   27.81 +                return false;
   27.82 +            }
   27.83 +        },
   27.84 +
   27.85          new Option(false, "-constants") {
   27.86              void process(JavapTask task, String opt, String arg) {
   27.87                  task.options.showConstants = true;
   27.88 @@ -251,6 +300,7 @@
   27.89  
   27.90      JavapTask() {
   27.91          context = new Context();
   27.92 +        context.put(Messages.class, this);
   27.93          options = Options.instance(context);
   27.94      }
   27.95  
   27.96 @@ -469,6 +519,8 @@
   27.97  
   27.98          context.put(PrintWriter.class, log);
   27.99          ClassWriter classWriter = ClassWriter.instance(context);
  27.100 +        SourceWriter sourceWriter = SourceWriter.instance(context);
  27.101 +        sourceWriter.setFileManager(fileManager);
  27.102  
  27.103          boolean ok = true;
  27.104  
  27.105 @@ -651,11 +703,11 @@
  27.106  
  27.107      }
  27.108  
  27.109 -    private String getMessage(String key, Object... args) {
  27.110 +    public String getMessage(String key, Object... args) {
  27.111          return getMessage(task_locale, key, args);
  27.112      }
  27.113  
  27.114 -    private String getMessage(Locale locale, String key, Object... args) {
  27.115 +    public String getMessage(Locale locale, String key, Object... args) {
  27.116          if (bundles == null) {
  27.117              // could make this a HashMap<Locale,SoftReference<ResourceBundle>>
  27.118              // and for efficiency, keep a hard reference to the bundle for the task
    28.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.2 +++ b/src/share/classes/com/sun/tools/javap/LocalVariableTableWriter.java	Thu Jun 11 21:35:12 2009 -0700
    28.3 @@ -0,0 +1,158 @@
    28.4 +/*
    28.5 + * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
    28.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    28.7 + *
    28.8 + * This code is free software; you can redistribute it and/or modify it
    28.9 + * under the terms of the GNU General Public License version 2 only, as
   28.10 + * published by the Free Software Foundation.  Sun designates this
   28.11 + * particular file as subject to the "Classpath" exception as provided
   28.12 + * by Sun in the LICENSE file that accompanied this code.
   28.13 + *
   28.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
   28.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   28.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   28.17 + * version 2 for more details (a copy is included in the LICENSE file that
   28.18 + * accompanied this code).
   28.19 + *
   28.20 + * You should have received a copy of the GNU General Public License version
   28.21 + * 2 along with this work; if not, write to the Free Software Foundation,
   28.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   28.23 + *
   28.24 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   28.25 + * CA 95054 USA or visit www.sun.com if you need additional information or
   28.26 + * have any questions.
   28.27 + */
   28.28 +
   28.29 +package com.sun.tools.javap;
   28.30 +
   28.31 +import com.sun.tools.classfile.Attribute;
   28.32 +import com.sun.tools.classfile.Code_attribute;
   28.33 +import com.sun.tools.classfile.ConstantPool;
   28.34 +import com.sun.tools.classfile.ConstantPoolException;
   28.35 +import com.sun.tools.classfile.Descriptor;
   28.36 +import com.sun.tools.classfile.Descriptor.InvalidDescriptor;
   28.37 +import com.sun.tools.classfile.Instruction;
   28.38 +import com.sun.tools.classfile.LocalVariableTable_attribute;
   28.39 +import java.util.ArrayList;
   28.40 +import java.util.HashMap;
   28.41 +import java.util.List;
   28.42 +import java.util.ListIterator;
   28.43 +import java.util.Map;
   28.44 +
   28.45 +/**
   28.46 + * Annotate instructions with details about local variables.
   28.47 + *
   28.48 + *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
   28.49 + *  you write code that depends on this, you do so at your own risk.
   28.50 + *  This code and its internal interfaces are subject to change or
   28.51 + *  deletion without notice.</b>
   28.52 + */
   28.53 +public class LocalVariableTableWriter extends  InstructionDetailWriter {
   28.54 +    public enum NoteKind {
   28.55 +        START("start") {
   28.56 +            public boolean match(LocalVariableTable_attribute.Entry entry, int pc) {
   28.57 +                return (pc == entry.start_pc);
   28.58 +            }
   28.59 +        },
   28.60 +        END("end") {
   28.61 +            public boolean match(LocalVariableTable_attribute.Entry entry, int pc) {
   28.62 +                return (pc == entry.start_pc + entry.length);
   28.63 +            }
   28.64 +        };
   28.65 +        NoteKind(String text) {
   28.66 +            this.text = text;
   28.67 +        }
   28.68 +        public abstract boolean match(LocalVariableTable_attribute.Entry entry, int pc);
   28.69 +        public final String text;
   28.70 +    };
   28.71 +
   28.72 +    static LocalVariableTableWriter instance(Context context) {
   28.73 +        LocalVariableTableWriter instance = context.get(LocalVariableTableWriter.class);
   28.74 +        if (instance == null)
   28.75 +            instance = new LocalVariableTableWriter(context);
   28.76 +        return instance;
   28.77 +    }
   28.78 +
   28.79 +    protected LocalVariableTableWriter(Context context) {
   28.80 +        super(context);
   28.81 +        context.put(LocalVariableTableWriter.class, this);
   28.82 +        classWriter = ClassWriter.instance(context);
   28.83 +    }
   28.84 +
   28.85 +    public void reset(Code_attribute attr) {
   28.86 +        codeAttr = attr;
   28.87 +        pcMap = new HashMap<Integer, List<LocalVariableTable_attribute.Entry>>();
   28.88 +        LocalVariableTable_attribute lvt =
   28.89 +                (LocalVariableTable_attribute) (attr.attributes.get(Attribute.LocalVariableTable));
   28.90 +        if (lvt == null)
   28.91 +            return;
   28.92 +
   28.93 +        for (int i = 0; i < lvt.local_variable_table.length; i++) {
   28.94 +            LocalVariableTable_attribute.Entry entry = lvt.local_variable_table[i];
   28.95 +            put(entry.start_pc, entry);
   28.96 +            put(entry.start_pc + entry.length, entry);
   28.97 +        }
   28.98 +    }
   28.99 +
  28.100 +    public void writeDetails(Instruction instr) {
  28.101 +        int pc = instr.getPC();
  28.102 +        writeLocalVariables(pc, NoteKind.END);
  28.103 +        writeLocalVariables(pc, NoteKind.START);
  28.104 +    }
  28.105 +
  28.106 +    @Override
  28.107 +    public void flush() {
  28.108 +        int pc = codeAttr.code_length;
  28.109 +        writeLocalVariables(pc, NoteKind.END);
  28.110 +    }
  28.111 +
  28.112 +    public void writeLocalVariables(int pc, NoteKind kind) {
  28.113 +        ConstantPool constant_pool = classWriter.getClassFile().constant_pool;
  28.114 +        String indent = space(2); // get from Options?
  28.115 +        List<LocalVariableTable_attribute.Entry> entries = pcMap.get(pc);
  28.116 +        if (entries != null) {
  28.117 +            for (ListIterator<LocalVariableTable_attribute.Entry> iter =
  28.118 +                    entries.listIterator(kind == NoteKind.END ? entries.size() : 0);
  28.119 +                    kind == NoteKind.END ? iter.hasPrevious() : iter.hasNext() ; ) {
  28.120 +                LocalVariableTable_attribute.Entry entry =
  28.121 +                        kind == NoteKind.END ? iter.previous() : iter.next();
  28.122 +                if (kind.match(entry, pc)) {
  28.123 +                    print(indent);
  28.124 +                    print(kind.text);
  28.125 +                    print(" local ");
  28.126 +                    print(entry.index);
  28.127 +                    print(" // ");
  28.128 +                    Descriptor d = new Descriptor(entry.descriptor_index);
  28.129 +                    try {
  28.130 +                        print(d.getFieldType(constant_pool));
  28.131 +                    } catch (InvalidDescriptor e) {
  28.132 +                        print(report(e));
  28.133 +                    } catch (ConstantPoolException e) {
  28.134 +                        print(report(e));
  28.135 +                    }
  28.136 +                    print(" ");
  28.137 +                    try {
  28.138 +                        print(constant_pool.getUTF8Value(entry.name_index));
  28.139 +                    } catch (ConstantPoolException e) {
  28.140 +                        print(report(e));
  28.141 +                    }
  28.142 +                    println();
  28.143 +                }
  28.144 +            }
  28.145 +        }
  28.146 +    }
  28.147 +
  28.148 +    private void put(int pc, LocalVariableTable_attribute.Entry entry) {
  28.149 +        List<LocalVariableTable_attribute.Entry> list = pcMap.get(pc);
  28.150 +        if (list == null) {
  28.151 +            list = new ArrayList<LocalVariableTable_attribute.Entry>();
  28.152 +            pcMap.put(pc, list);
  28.153 +        }
  28.154 +        if (!list.contains(entry))
  28.155 +            list.add(entry);
  28.156 +    }
  28.157 +
  28.158 +    private ClassWriter classWriter;
  28.159 +    private Code_attribute codeAttr;
  28.160 +    private Map<Integer, List<LocalVariableTable_attribute.Entry>> pcMap;
  28.161 +}
    29.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.2 +++ b/src/share/classes/com/sun/tools/javap/LocalVariableTypeTableWriter.java	Thu Jun 11 21:35:12 2009 -0700
    29.3 @@ -0,0 +1,159 @@
    29.4 +/*
    29.5 + * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
    29.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    29.7 + *
    29.8 + * This code is free software; you can redistribute it and/or modify it
    29.9 + * under the terms of the GNU General Public License version 2 only, as
   29.10 + * published by the Free Software Foundation.  Sun designates this
   29.11 + * particular file as subject to the "Classpath" exception as provided
   29.12 + * by Sun in the LICENSE file that accompanied this code.
   29.13 + *
   29.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
   29.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   29.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   29.17 + * version 2 for more details (a copy is included in the LICENSE file that
   29.18 + * accompanied this code).
   29.19 + *
   29.20 + * You should have received a copy of the GNU General Public License version
   29.21 + * 2 along with this work; if not, write to the Free Software Foundation,
   29.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   29.23 + *
   29.24 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   29.25 + * CA 95054 USA or visit www.sun.com if you need additional information or
   29.26 + * have any questions.
   29.27 + */
   29.28 +
   29.29 +package com.sun.tools.javap;
   29.30 +
   29.31 +import com.sun.tools.classfile.Attribute;
   29.32 +import com.sun.tools.classfile.Code_attribute;
   29.33 +import com.sun.tools.classfile.ConstantPool;
   29.34 +import com.sun.tools.classfile.ConstantPoolException;
   29.35 +import com.sun.tools.classfile.Descriptor;
   29.36 +import com.sun.tools.classfile.Descriptor.InvalidDescriptor;
   29.37 +import com.sun.tools.classfile.Instruction;
   29.38 +import com.sun.tools.classfile.LocalVariableTypeTable_attribute;
   29.39 +import com.sun.tools.classfile.Signature;
   29.40 +import java.util.ArrayList;
   29.41 +import java.util.HashMap;
   29.42 +import java.util.List;
   29.43 +import java.util.ListIterator;
   29.44 +import java.util.Map;
   29.45 +
   29.46 +/**
   29.47 + * Annotate instructions with details about local variables.
   29.48 + *
   29.49 + *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
   29.50 + *  you write code that depends on this, you do so at your own risk.
   29.51 + *  This code and its internal interfaces are subject to change or
   29.52 + *  deletion without notice.</b>
   29.53 + */
   29.54 +public class LocalVariableTypeTableWriter extends  InstructionDetailWriter {
   29.55 +    public enum NoteKind {
   29.56 +        START("start") {
   29.57 +            public boolean match(LocalVariableTypeTable_attribute.Entry entry, int pc) {
   29.58 +                return (pc == entry.start_pc);
   29.59 +            }
   29.60 +        },
   29.61 +        END("end") {
   29.62 +            public boolean match(LocalVariableTypeTable_attribute.Entry entry, int pc) {
   29.63 +                return (pc == entry.start_pc + entry.length);
   29.64 +            }
   29.65 +        };
   29.66 +        NoteKind(String text) {
   29.67 +            this.text = text;
   29.68 +        }
   29.69 +        public abstract boolean match(LocalVariableTypeTable_attribute.Entry entry, int pc);
   29.70 +        public final String text;
   29.71 +    };
   29.72 +
   29.73 +    static LocalVariableTypeTableWriter instance(Context context) {
   29.74 +        LocalVariableTypeTableWriter instance = context.get(LocalVariableTypeTableWriter.class);
   29.75 +        if (instance == null)
   29.76 +            instance = new LocalVariableTypeTableWriter(context);
   29.77 +        return instance;
   29.78 +    }
   29.79 +
   29.80 +    protected LocalVariableTypeTableWriter(Context context) {
   29.81 +        super(context);
   29.82 +        context.put(LocalVariableTypeTableWriter.class, this);
   29.83 +        classWriter = ClassWriter.instance(context);
   29.84 +    }
   29.85 +
   29.86 +    public void reset(Code_attribute attr) {
   29.87 +        codeAttr = attr;
   29.88 +        pcMap = new HashMap<Integer, List<LocalVariableTypeTable_attribute.Entry>>();
   29.89 +        LocalVariableTypeTable_attribute lvt =
   29.90 +                (LocalVariableTypeTable_attribute) (attr.attributes.get(Attribute.LocalVariableTypeTable));
   29.91 +        if (lvt == null)
   29.92 +            return;
   29.93 +
   29.94 +        for (int i = 0; i < lvt.local_variable_table.length; i++) {
   29.95 +            LocalVariableTypeTable_attribute.Entry entry = lvt.local_variable_table[i];
   29.96 +            put(entry.start_pc, entry);
   29.97 +            put(entry.start_pc + entry.length, entry);
   29.98 +        }
   29.99 +    }
  29.100 +
  29.101 +    public void writeDetails(Instruction instr) {
  29.102 +        int pc = instr.getPC();
  29.103 +        writeLocalVariables(pc, NoteKind.END);
  29.104 +        writeLocalVariables(pc, NoteKind.START);
  29.105 +    }
  29.106 +
  29.107 +    @Override
  29.108 +    public void flush() {
  29.109 +        int pc = codeAttr.code_length;
  29.110 +        writeLocalVariables(pc, NoteKind.END);
  29.111 +    }
  29.112 +
  29.113 +    public void writeLocalVariables(int pc, NoteKind kind) {
  29.114 +        ConstantPool constant_pool = classWriter.getClassFile().constant_pool;
  29.115 +        String indent = space(2); // get from Options?
  29.116 +        List<LocalVariableTypeTable_attribute.Entry> entries = pcMap.get(pc);
  29.117 +        if (entries != null) {
  29.118 +            for (ListIterator<LocalVariableTypeTable_attribute.Entry> iter =
  29.119 +                    entries.listIterator(kind == NoteKind.END ? entries.size() : 0);
  29.120 +                    kind == NoteKind.END ? iter.hasPrevious() : iter.hasNext() ; ) {
  29.121 +                LocalVariableTypeTable_attribute.Entry entry =
  29.122 +                        kind == NoteKind.END ? iter.previous() : iter.next();
  29.123 +                if (kind.match(entry, pc)) {
  29.124 +                    print(indent);
  29.125 +                    print(kind.text);
  29.126 +                    print(" generic local ");
  29.127 +                    print(entry.index);
  29.128 +                    print(" // ");
  29.129 +                    Descriptor d = new Signature(entry.signature_index);
  29.130 +                    try {
  29.131 +                        print(d.getFieldType(constant_pool));
  29.132 +                    } catch (InvalidDescriptor e) {
  29.133 +                        print(report(e));
  29.134 +                    } catch (ConstantPoolException e) {
  29.135 +                        print(report(e));
  29.136 +                    }
  29.137 +                    print(" ");
  29.138 +                    try {
  29.139 +                        print(constant_pool.getUTF8Value(entry.name_index));
  29.140 +                    } catch (ConstantPoolException e) {
  29.141 +                        print(report(e));
  29.142 +                    }
  29.143 +                    println();
  29.144 +                }
  29.145 +            }
  29.146 +        }
  29.147 +    }
  29.148 +
  29.149 +    private void put(int pc, LocalVariableTypeTable_attribute.Entry entry) {
  29.150 +        List<LocalVariableTypeTable_attribute.Entry> list = pcMap.get(pc);
  29.151 +        if (list == null) {
  29.152 +            list = new ArrayList<LocalVariableTypeTable_attribute.Entry>();
  29.153 +            pcMap.put(pc, list);
  29.154 +        }
  29.155 +        if (!list.contains(entry))
  29.156 +            list.add(entry);
  29.157 +    }
  29.158 +
  29.159 +    private ClassWriter classWriter;
  29.160 +    private Code_attribute codeAttr;
  29.161 +    private Map<Integer, List<LocalVariableTypeTable_attribute.Entry>> pcMap;
  29.162 +}
    30.1 --- a/src/share/classes/com/sun/tools/javap/Main.java	Thu Jun 11 10:54:31 2009 -0700
    30.2 +++ b/src/share/classes/com/sun/tools/javap/Main.java	Thu Jun 11 21:35:12 2009 -0700
    30.3 @@ -42,13 +42,6 @@
    30.4       * @param args command line arguments
    30.5       */
    30.6      public static void main(String[] args) {
    30.7 -        if (args.length >= 1 && args[0].equals("-Xold")) {
    30.8 -            String[] nArgs = new String[args.length - 1];
    30.9 -            System.arraycopy(args, 1, nArgs, 0, nArgs.length);
   30.10 -            sun.tools.javap.Main.main(args);  // calls System.exit
   30.11 -            System.exit(1);
   30.12 -        }
   30.13 -
   30.14          JavapTask t = new JavapTask();
   30.15          int rc = t.run(args);
   30.16          System.exit(rc);
    31.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.2 +++ b/src/share/classes/com/sun/tools/javap/Messages.java	Thu Jun 11 21:35:12 2009 -0700
    31.3 @@ -0,0 +1,42 @@
    31.4 +/*
    31.5 + * Copyright 2007-2009 Sun Microsystems, Inc.  All Rights Reserved.
    31.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    31.7 + *
    31.8 + * This code is free software; you can redistribute it and/or modify it
    31.9 + * under the terms of the GNU General Public License version 2 only, as
   31.10 + * published by the Free Software Foundation.  Sun designates this
   31.11 + * particular file as subject to the "Classpath" exception as provided
   31.12 + * by Sun in the LICENSE file that accompanied this code.
   31.13 + *
   31.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
   31.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   31.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   31.17 + * version 2 for more details (a copy is included in the LICENSE file that
   31.18 + * accompanied this code).
   31.19 + *
   31.20 + * You should have received a copy of the GNU General Public License version
   31.21 + * 2 along with this work; if not, write to the Free Software Foundation,
   31.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   31.23 + *
   31.24 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   31.25 + * CA 95054 USA or visit www.sun.com if you need additional information or
   31.26 + * have any questions.
   31.27 + */
   31.28 +
   31.29 +package com.sun.tools.javap;
   31.30 +
   31.31 +import java.util.Locale;
   31.32 +
   31.33 +/**
   31.34 + *  Access to javap messages.
   31.35 + *
   31.36 + *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
   31.37 + *  you write code that depends on this, you do so at your own risk.
   31.38 + *  This code and its internal interfaces are subject to change or
   31.39 + *  deletion without notice.</b>
   31.40 + */
   31.41 +public interface Messages {
   31.42 +    String getMessage(String key, Object... args);
   31.43 +
   31.44 +    String getMessage(Locale locale, String key, Object... args);
   31.45 +}
    32.1 --- a/src/share/classes/com/sun/tools/javap/Options.java	Thu Jun 11 10:54:31 2009 -0700
    32.2 +++ b/src/share/classes/com/sun/tools/javap/Options.java	Thu Jun 11 21:35:12 2009 -0700
    32.3 @@ -25,8 +25,10 @@
    32.4  
    32.5  package com.sun.tools.javap;
    32.6  
    32.7 +import java.util.EnumSet;
    32.8  import java.util.HashSet;
    32.9  import java.util.Set;
   32.10 +
   32.11  import com.sun.tools.classfile.AccessFlags;
   32.12  
   32.13  /*
   32.14 @@ -77,6 +79,7 @@
   32.15      public boolean showLineAndLocalVariableTables;
   32.16      public int showAccess;
   32.17      public Set<String> accessOptions = new HashSet<String>();
   32.18 +    public Set<InstructionDetailWriter.Kind> details = EnumSet.noneOf(InstructionDetailWriter.Kind.class);
   32.19      public boolean showDisassembled;
   32.20      public boolean showInternalSignatures;
   32.21      public boolean showAllAttrs;
    33.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    33.2 +++ b/src/share/classes/com/sun/tools/javap/SourceWriter.java	Thu Jun 11 21:35:12 2009 -0700
    33.3 @@ -0,0 +1,207 @@
    33.4 +/*
    33.5 + * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
    33.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    33.7 + *
    33.8 + * This code is free software; you can redistribute it and/or modify it
    33.9 + * under the terms of the GNU General Public License version 2 only, as
   33.10 + * published by the Free Software Foundation.  Sun designates this
   33.11 + * particular file as subject to the "Classpath" exception as provided
   33.12 + * by Sun in the LICENSE file that accompanied this code.
   33.13 + *
   33.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
   33.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   33.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   33.17 + * version 2 for more details (a copy is included in the LICENSE file that
   33.18 + * accompanied this code).
   33.19 + *
   33.20 + * You should have received a copy of the GNU General Public License version
   33.21 + * 2 along with this work; if not, write to the Free Software Foundation,
   33.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   33.23 + *
   33.24 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   33.25 + * CA 95054 USA or visit www.sun.com if you need additional information or
   33.26 + * have any questions.
   33.27 + */
   33.28 +
   33.29 +package com.sun.tools.javap;
   33.30 +
   33.31 +import java.io.BufferedReader;
   33.32 +import java.io.IOException;
   33.33 +import java.io.StringReader;
   33.34 +import java.util.ArrayList;
   33.35 +import java.util.List;
   33.36 +import java.util.Set;
   33.37 +import java.util.SortedMap;
   33.38 +import java.util.SortedSet;
   33.39 +import java.util.TreeMap;
   33.40 +import java.util.TreeSet;
   33.41 +import javax.tools.JavaFileManager;
   33.42 +import javax.tools.JavaFileManager.Location;
   33.43 +import javax.tools.JavaFileObject;
   33.44 +import javax.tools.StandardLocation;
   33.45 +
   33.46 +import com.sun.tools.classfile.Attribute;
   33.47 +import com.sun.tools.classfile.ClassFile;
   33.48 +import com.sun.tools.classfile.Code_attribute;
   33.49 +import com.sun.tools.classfile.ConstantPoolException;
   33.50 +import com.sun.tools.classfile.Instruction;
   33.51 +import com.sun.tools.classfile.LineNumberTable_attribute;
   33.52 +import com.sun.tools.classfile.SourceFile_attribute;
   33.53 +
   33.54 +
   33.55 +/**
   33.56 + * Annotate instructions with source code.
   33.57 + *
   33.58 + *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
   33.59 + *  you write code that depends on this, you do so at your own risk.
   33.60 + *  This code and its internal interfaces are subject to change or
   33.61 + *  deletion without notice.</b>
   33.62 + */
   33.63 +public class SourceWriter extends InstructionDetailWriter {
   33.64 +    static SourceWriter instance(Context context) {
   33.65 +        SourceWriter instance = context.get(SourceWriter.class);
   33.66 +        if (instance == null)
   33.67 +            instance = new SourceWriter(context);
   33.68 +        return instance;
   33.69 +    }
   33.70 +
   33.71 +    protected SourceWriter(Context context) {
   33.72 +        super(context);
   33.73 +        context.put(SourceWriter.class, this);
   33.74 +    }
   33.75 +
   33.76 +    void setFileManager(JavaFileManager fileManager) {
   33.77 +        this.fileManager = fileManager;
   33.78 +    }
   33.79 +
   33.80 +    public void reset(ClassFile cf, Code_attribute attr) {
   33.81 +        setSource(cf);
   33.82 +        setLineMap(attr);
   33.83 +    }
   33.84 +
   33.85 +    public void writeDetails(Instruction instr) {
   33.86 +        String indent = space(40); // could get from Options?
   33.87 +        Set<Integer> lines = lineMap.get(instr.getPC());
   33.88 +        if (lines != null) {
   33.89 +            for (int line: lines) {
   33.90 +                print(indent);
   33.91 +                print(String.format(" %4d ", line));
   33.92 +                if (line < sourceLines.length)
   33.93 +                    print(sourceLines[line]);
   33.94 +                println();
   33.95 +                int nextLine = nextLine(line);
   33.96 +                for (int i = line + 1; i < nextLine; i++) {
   33.97 +                    print(indent);
   33.98 +                    print(String.format("(%4d)", i));
   33.99 +                    if (i < sourceLines.length)
  33.100 +                        print(sourceLines[i]);
  33.101 +                    println();
  33.102 +                }
  33.103 +            }
  33.104 +        }
  33.105 +
  33.106 +    }
  33.107 +
  33.108 +    private void setLineMap(Code_attribute attr) {
  33.109 +        SortedMap<Integer, SortedSet<Integer>> map =
  33.110 +                new TreeMap<Integer, SortedSet<Integer>>();
  33.111 +        SortedSet<Integer> allLines = new TreeSet<Integer>();
  33.112 +        for (Attribute a: attr.attributes) {
  33.113 +            if (a instanceof LineNumberTable_attribute) {
  33.114 +                LineNumberTable_attribute t = (LineNumberTable_attribute) a;
  33.115 +                for (LineNumberTable_attribute.Entry e: t.line_number_table) {
  33.116 +                    int start_pc = e.start_pc;
  33.117 +                    int line = e.line_number;
  33.118 +                    SortedSet<Integer> pcLines = map.get(start_pc);
  33.119 +                    if (pcLines == null) {
  33.120 +                        pcLines = new TreeSet<Integer>();
  33.121 +                        map.put(start_pc, pcLines);
  33.122 +                    }
  33.123 +                    pcLines.add(line);
  33.124 +                    allLines.add(line);
  33.125 +                }
  33.126 +            }
  33.127 +        }
  33.128 +        lineMap = map;
  33.129 +        lineList = new ArrayList<Integer>(allLines);
  33.130 +    }
  33.131 +
  33.132 +    private void setSource(ClassFile cf) {
  33.133 +        if (cf != classFile) {
  33.134 +            classFile = cf;
  33.135 +            sourceLines = splitLines(readSource(cf));
  33.136 +        }
  33.137 +    }
  33.138 +
  33.139 +    private String readSource(ClassFile cf) {
  33.140 +        Location location;
  33.141 +        if (fileManager.hasLocation((StandardLocation.SOURCE_PATH)))
  33.142 +            location = StandardLocation.SOURCE_PATH;
  33.143 +        else
  33.144 +            location = StandardLocation.CLASS_PATH;
  33.145 +
  33.146 +        // Guess the source file for a class from the package name for this
  33.147 +        // class and the base of the source file. This avoids having to read
  33.148 +        // additional classes to determine the outmost class from any
  33.149 +        // InnerClasses and EnclosingMethod attributes.
  33.150 +        try {
  33.151 +            String className = cf.getName();
  33.152 +            SourceFile_attribute sf =
  33.153 +                    (SourceFile_attribute) cf.attributes.get(Attribute.SourceFile);
  33.154 +            if (sf == null) {
  33.155 +                report(messages.getMessage("err.no.SourceFile.attribute"));
  33.156 +                return null;
  33.157 +            }
  33.158 +            String sourceFile = sf.getSourceFile(cf.constant_pool);
  33.159 +            String fileBase = sourceFile.endsWith(".java")
  33.160 +                ? sourceFile.substring(0, sourceFile.length() - 5) : sourceFile;
  33.161 +            int sep = className.lastIndexOf("/");
  33.162 +            String pkgName = (sep == -1 ? "" : className.substring(0, sep+1));
  33.163 +            String topClassName = (pkgName + fileBase).replace('/', '.');
  33.164 +            JavaFileObject fo =
  33.165 +                    fileManager.getJavaFileForInput(location,
  33.166 +                    topClassName,
  33.167 +                    JavaFileObject.Kind.SOURCE);
  33.168 +            if (fo == null) {
  33.169 +                report(messages.getMessage("err.source.file.not.found"));
  33.170 +                return null;
  33.171 +            }
  33.172 +            return fo.getCharContent(true).toString();
  33.173 +        } catch (ConstantPoolException e) {
  33.174 +            report(e);
  33.175 +            return null;
  33.176 +        } catch (IOException e) {
  33.177 +            report(e.getLocalizedMessage());
  33.178 +            return null;
  33.179 +        }
  33.180 +    }
  33.181 +
  33.182 +    private static String[] splitLines(String text) {
  33.183 +        if (text == null)
  33.184 +            return new String[0];
  33.185 +
  33.186 +        List<String> lines = new ArrayList<String>();
  33.187 +        lines.add(""); // dummy line 0
  33.188 +        try {
  33.189 +            BufferedReader r = new BufferedReader(new StringReader(text));
  33.190 +            String line;
  33.191 +            while ((line = r.readLine()) != null)
  33.192 +                lines.add(line);
  33.193 +        } catch (IOException ignore) {
  33.194 +        }
  33.195 +        return lines.toArray(new String[lines.size()]);
  33.196 +    }
  33.197 +
  33.198 +    private int nextLine(int line) {
  33.199 +        int i = lineList.indexOf(line);
  33.200 +        if (i == -1 || i == lineList.size() - 1)
  33.201 +            return - 1;
  33.202 +        return lineList.get(i + 1);
  33.203 +    }
  33.204 +
  33.205 +    private JavaFileManager fileManager;
  33.206 +    private ClassFile classFile;
  33.207 +    private SortedMap<Integer, SortedSet<Integer>> lineMap;
  33.208 +    private List<Integer> lineList;
  33.209 +    private String[] sourceLines;
  33.210 +}
    34.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.2 +++ b/src/share/classes/com/sun/tools/javap/StackMapWriter.java	Thu Jun 11 21:35:12 2009 -0700
    34.3 @@ -0,0 +1,291 @@
    34.4 +/*
    34.5 + * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
    34.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    34.7 + *
    34.8 + * This code is free software; you can redistribute it and/or modify it
    34.9 + * under the terms of the GNU General Public License version 2 only, as
   34.10 + * published by the Free Software Foundation.  Sun designates this
   34.11 + * particular file as subject to the "Classpath" exception as provided
   34.12 + * by Sun in the LICENSE file that accompanied this code.
   34.13 + *
   34.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
   34.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   34.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   34.17 + * version 2 for more details (a copy is included in the LICENSE file that
   34.18 + * accompanied this code).
   34.19 + *
   34.20 + * You should have received a copy of the GNU General Public License version
   34.21 + * 2 along with this work; if not, write to the Free Software Foundation,
   34.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   34.23 + *
   34.24 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   34.25 + * CA 95054 USA or visit www.sun.com if you need additional information or
   34.26 + * have any questions.
   34.27 + */
   34.28 +
   34.29 +package com.sun.tools.javap;
   34.30 +
   34.31 +import com.sun.tools.classfile.AccessFlags;
   34.32 +import java.util.HashMap;
   34.33 +import java.util.Map;
   34.34 +
   34.35 +import com.sun.tools.classfile.Attribute;
   34.36 +import com.sun.tools.classfile.Code_attribute;
   34.37 +import com.sun.tools.classfile.ConstantPool;
   34.38 +import com.sun.tools.classfile.ConstantPoolException;
   34.39 +import com.sun.tools.classfile.Descriptor;
   34.40 +import com.sun.tools.classfile.Descriptor.InvalidDescriptor;
   34.41 +import com.sun.tools.classfile.Instruction;
   34.42 +import com.sun.tools.classfile.Method;
   34.43 +import com.sun.tools.classfile.StackMapTable_attribute;
   34.44 +import com.sun.tools.classfile.StackMapTable_attribute.*;
   34.45 +
   34.46 +import static com.sun.tools.classfile.StackMapTable_attribute.verification_type_info.*;
   34.47 +
   34.48 +/**
   34.49 + * Annotate instructions with stack map.
   34.50 + *
   34.51 + *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
   34.52 + *  you write code that depends on this, you do so at your own risk.
   34.53 + *  This code and its internal interfaces are subject to change or
   34.54 + *  deletion without notice.</b>
   34.55 + */
   34.56 +public class StackMapWriter extends InstructionDetailWriter {
   34.57 +    static StackMapWriter instance(Context context) {
   34.58 +        StackMapWriter instance = context.get(StackMapWriter.class);
   34.59 +        if (instance == null)
   34.60 +            instance = new StackMapWriter(context);
   34.61 +        return instance;
   34.62 +    }
   34.63 +
   34.64 +    protected StackMapWriter(Context context) {
   34.65 +        super(context);
   34.66 +        context.put(StackMapWriter.class, this);
   34.67 +        classWriter = ClassWriter.instance(context);
   34.68 +    }
   34.69 +
   34.70 +    public void reset(Code_attribute attr) {
   34.71 +        setStackMap((StackMapTable_attribute) attr.attributes.get(Attribute.StackMapTable));
   34.72 +    }
   34.73 +
   34.74 +    void setStackMap(StackMapTable_attribute attr) {
   34.75 +        if (attr == null) {
   34.76 +            map = null;
   34.77 +            return;
   34.78 +        }
   34.79 +
   34.80 +        Method m = classWriter.getMethod();
   34.81 +        Descriptor d = m.descriptor;
   34.82 +        String[] args;
   34.83 +        try {
   34.84 +            ConstantPool cp = classWriter.getClassFile().constant_pool;
   34.85 +            String argString = d.getParameterTypes(cp);
   34.86 +            args = argString.substring(1, argString.length() - 1).split("[, ]+");
   34.87 +        } catch (ConstantPoolException e) {
   34.88 +            return;
   34.89 +        } catch (InvalidDescriptor e) {
   34.90 +            return;
   34.91 +        }
   34.92 +        boolean isStatic = m.access_flags.is(AccessFlags.ACC_STATIC);
   34.93 +
   34.94 +        verification_type_info[] initialLocals = new verification_type_info[(isStatic ? 0 : 1) + args.length];
   34.95 +        if (!isStatic)
   34.96 +            initialLocals[0] = new CustomVerificationTypeInfo("this");
   34.97 +        for (int i = 0; i < args.length; i++) {
   34.98 +            initialLocals[(isStatic ? 0 : 1) + i] =
   34.99 +                    new CustomVerificationTypeInfo(args[i].replace(".", "/"));
  34.100 +        }
  34.101 +
  34.102 +        map = new HashMap<Integer, StackMap>();
  34.103 +        StackMapBuilder builder = new StackMapBuilder();
  34.104 +
  34.105 +        // using -1 as the pc for the initial frame effectively compensates for
  34.106 +        // the difference in behavior for the first stack map frame (where the
  34.107 +        // pc offset is just offset_delta) compared to subsequent frames (where
  34.108 +        // the pc offset is always offset_delta+1).
  34.109 +        int pc = -1;
  34.110 +
  34.111 +        map.put(pc, new StackMap(initialLocals, empty));
  34.112 +
  34.113 +        for (int i = 0; i < attr.entries.length; i++)
  34.114 +            pc = attr.entries[i].accept(builder, pc);
  34.115 +    }
  34.116 +
  34.117 +    public void writeInitialDetails() {
  34.118 +        writeDetails(-1);
  34.119 +    }
  34.120 +
  34.121 +    public void writeDetails(Instruction instr) {
  34.122 +        writeDetails(instr.getPC());
  34.123 +    }
  34.124 +
  34.125 +    private void writeDetails(int pc) {
  34.126 +        if (map == null)
  34.127 +            return;
  34.128 +
  34.129 +        StackMap m = map.get(pc);
  34.130 +        if (m != null) {
  34.131 +            print("StackMap locals: ", m.locals);
  34.132 +            print("StackMap stack: ", m.stack);
  34.133 +        }
  34.134 +
  34.135 +    }
  34.136 +
  34.137 +    void print(String label, verification_type_info[] entries) {
  34.138 +        print(label);
  34.139 +        for (int i = 0; i < entries.length; i++) {
  34.140 +            print(" ");
  34.141 +            print(entries[i]);
  34.142 +        }
  34.143 +        println();
  34.144 +    }
  34.145 +
  34.146 +    void print(verification_type_info entry) {
  34.147 +        if (entry == null) {
  34.148 +            print("ERROR");
  34.149 +            return;
  34.150 +        }
  34.151 +
  34.152 +        switch (entry.tag) {
  34.153 +            case -1:
  34.154 +                print(((CustomVerificationTypeInfo) entry).text);
  34.155 +                break;
  34.156 +
  34.157 +            case ITEM_Top:
  34.158 +                print("top");
  34.159 +                break;
  34.160 +
  34.161 +            case ITEM_Integer:
  34.162 +                print("int");
  34.163 +                break;
  34.164 +
  34.165 +            case ITEM_Float:
  34.166 +                print("float");
  34.167 +                break;
  34.168 +
  34.169 +            case ITEM_Long:
  34.170 +                print("long");
  34.171 +                break;
  34.172 +
  34.173 +            case ITEM_Double:
  34.174 +                print("double");
  34.175 +                break;
  34.176 +
  34.177 +            case ITEM_Null:
  34.178 +                print("null");
  34.179 +                break;
  34.180 +
  34.181 +            case ITEM_UninitializedThis:
  34.182 +                print("uninit_this");
  34.183 +                break;
  34.184 +
  34.185 +            case ITEM_Object:
  34.186 +                try {
  34.187 +                    ConstantPool cp = classWriter.getClassFile().constant_pool;
  34.188 +                    ConstantPool.CONSTANT_Class_info class_info = cp.getClassInfo(((Object_variable_info) entry).cpool_index);
  34.189 +                    print(cp.getUTF8Value(class_info.name_index));
  34.190 +                } catch (ConstantPoolException e) {
  34.191 +                    print("??");
  34.192 +                }
  34.193 +                break;
  34.194 +
  34.195 +            case ITEM_Uninitialized:
  34.196 +                print(((Uninitialized_variable_info) entry).offset);
  34.197 +                break;
  34.198 +        }
  34.199 +
  34.200 +    }
  34.201 +
  34.202 +    private Map<Integer, StackMap> map;
  34.203 +    private ClassWriter classWriter;
  34.204 +
  34.205 +    class StackMapBuilder
  34.206 +            implements StackMapTable_attribute.stack_map_frame.Visitor<Integer, Integer> {
  34.207 +
  34.208 +        public Integer visit_same_frame(same_frame frame, Integer pc) {
  34.209 +            int new_pc = pc + frame.getOffsetDelta() + 1;
  34.210 +            StackMap m = map.get(pc);
  34.211 +            assert (m != null);
  34.212 +            map.put(new_pc, m);
  34.213 +            return new_pc;
  34.214 +        }
  34.215 +
  34.216 +        public Integer visit_same_locals_1_stack_item_frame(same_locals_1_stack_item_frame frame, Integer pc) {
  34.217 +            int new_pc = pc + frame.getOffsetDelta() + 1;
  34.218 +            StackMap prev = map.get(pc);
  34.219 +            assert (prev != null);
  34.220 +            StackMap m = new StackMap(prev.locals, frame.stack);
  34.221 +            map.put(new_pc, m);
  34.222 +            return new_pc;
  34.223 +        }
  34.224 +
  34.225 +        public Integer visit_same_locals_1_stack_item_frame_extended(same_locals_1_stack_item_frame_extended frame, Integer pc) {
  34.226 +            int new_pc = pc + frame.getOffsetDelta() + 1;
  34.227 +            StackMap prev = map.get(pc);
  34.228 +            assert (prev != null);
  34.229 +            StackMap m = new StackMap(prev.locals, frame.stack);
  34.230 +            map.put(new_pc, m);
  34.231 +            return new_pc;
  34.232 +        }
  34.233 +
  34.234 +        public Integer visit_chop_frame(chop_frame frame, Integer pc) {
  34.235 +            int new_pc = pc + frame.getOffsetDelta() + 1;
  34.236 +            StackMap prev = map.get(pc);
  34.237 +            assert (prev != null);
  34.238 +            int k = 251 - frame.frame_type;
  34.239 +            verification_type_info[] new_locals = new verification_type_info[prev.locals.length - k];
  34.240 +            System.arraycopy(prev.locals, 0, new_locals, 0, new_locals.length);
  34.241 +            StackMap m = new StackMap(new_locals, empty);
  34.242 +            map.put(new_pc, m);
  34.243 +            return new_pc;
  34.244 +        }
  34.245 +
  34.246 +        public Integer visit_same_frame_extended(same_frame_extended frame, Integer pc) {
  34.247 +            int new_pc = pc + frame.getOffsetDelta();
  34.248 +            StackMap m = map.get(pc);
  34.249 +            assert (m != null);
  34.250 +            map.put(new_pc, m);
  34.251 +            return new_pc;
  34.252 +        }
  34.253 +
  34.254 +        public Integer visit_append_frame(append_frame frame, Integer pc) {
  34.255 +            int new_pc = pc + frame.getOffsetDelta() + 1;
  34.256 +            StackMap prev = map.get(pc);
  34.257 +            assert (prev != null);
  34.258 +            verification_type_info[] new_locals = new verification_type_info[prev.locals.length + frame.locals.length];
  34.259 +            System.arraycopy(prev.locals, 0, new_locals, 0, prev.locals.length);
  34.260 +            System.arraycopy(frame.locals, 0, new_locals, prev.locals.length, frame.locals.length);
  34.261 +            StackMap m = new StackMap(new_locals, empty);
  34.262 +            map.put(new_pc, m);
  34.263 +            return new_pc;
  34.264 +        }
  34.265 +
  34.266 +        public Integer visit_full_frame(full_frame frame, Integer pc) {
  34.267 +            int new_pc = pc + frame.getOffsetDelta() + 1;
  34.268 +            StackMap m = new StackMap(frame.locals, frame.stack);
  34.269 +            map.put(new_pc, m);
  34.270 +            return new_pc;
  34.271 +        }
  34.272 +
  34.273 +    }
  34.274 +
  34.275 +    class StackMap {
  34.276 +        StackMap(verification_type_info[] locals, verification_type_info[] stack) {
  34.277 +            this.locals = locals;
  34.278 +            this.stack = stack;
  34.279 +        }
  34.280 +
  34.281 +        private final verification_type_info[] locals;
  34.282 +        private final verification_type_info[] stack;
  34.283 +    }
  34.284 +
  34.285 +    class CustomVerificationTypeInfo extends verification_type_info {
  34.286 +        public CustomVerificationTypeInfo(String text) {
  34.287 +            super(-1);
  34.288 +            this.text = text;
  34.289 +        }
  34.290 +        private String text;
  34.291 +    }
  34.292 +
  34.293 +    private final verification_type_info[] empty = { };
  34.294 +}
    35.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.2 +++ b/src/share/classes/com/sun/tools/javap/TryBlockWriter.java	Thu Jun 11 21:35:12 2009 -0700
    35.3 @@ -0,0 +1,142 @@
    35.4 +/*
    35.5 + * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
    35.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    35.7 + *
    35.8 + * This code is free software; you can redistribute it and/or modify it
    35.9 + * under the terms of the GNU General Public License version 2 only, as
   35.10 + * published by the Free Software Foundation.  Sun designates this
   35.11 + * particular file as subject to the "Classpath" exception as provided
   35.12 + * by Sun in the LICENSE file that accompanied this code.
   35.13 + *
   35.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
   35.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   35.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   35.17 + * version 2 for more details (a copy is included in the LICENSE file that
   35.18 + * accompanied this code).
   35.19 + *
   35.20 + * You should have received a copy of the GNU General Public License version
   35.21 + * 2 along with this work; if not, write to the Free Software Foundation,
   35.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   35.23 + *
   35.24 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   35.25 + * CA 95054 USA or visit www.sun.com if you need additional information or
   35.26 + * have any questions.
   35.27 + */
   35.28 +
   35.29 +package com.sun.tools.javap;
   35.30 +
   35.31 +import com.sun.tools.classfile.Code_attribute;
   35.32 +import com.sun.tools.classfile.Code_attribute.Exception_data;
   35.33 +import com.sun.tools.classfile.Instruction;
   35.34 +import java.util.ArrayList;
   35.35 +import java.util.HashMap;
   35.36 +import java.util.List;
   35.37 +import java.util.ListIterator;
   35.38 +import java.util.Map;
   35.39 +
   35.40 +/**
   35.41 + * Annotate instructions with details about try blocks.
   35.42 + *
   35.43 + *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
   35.44 + *  you write code that depends on this, you do so at your own risk.
   35.45 + *  This code and its internal interfaces are subject to change or
   35.46 + *  deletion without notice.</b>
   35.47 + */
   35.48 +public class TryBlockWriter extends InstructionDetailWriter {
   35.49 +    public enum NoteKind {
   35.50 +        START("try") {
   35.51 +            public boolean match(Exception_data entry, int pc) {
   35.52 +                return (pc == entry.start_pc);
   35.53 +            }
   35.54 +        },
   35.55 +        END("end try") {
   35.56 +            public boolean match(Exception_data entry, int pc) {
   35.57 +                return (pc == entry.end_pc);
   35.58 +            }
   35.59 +        },
   35.60 +        HANDLER("catch") {
   35.61 +            public boolean match(Exception_data entry, int pc) {
   35.62 +                return (pc == entry.handler_pc);
   35.63 +            }
   35.64 +        };
   35.65 +        NoteKind(String text) {
   35.66 +            this.text = text;
   35.67 +        }
   35.68 +        public abstract boolean match(Exception_data entry, int pc);
   35.69 +        public final String text;
   35.70 +    };
   35.71 +
   35.72 +    static TryBlockWriter instance(Context context) {
   35.73 +        TryBlockWriter instance = context.get(TryBlockWriter.class);
   35.74 +        if (instance == null)
   35.75 +            instance = new TryBlockWriter(context);
   35.76 +        return instance;
   35.77 +    }
   35.78 +
   35.79 +    protected TryBlockWriter(Context context) {
   35.80 +        super(context);
   35.81 +        context.put(TryBlockWriter.class, this);
   35.82 +        constantWriter = ConstantWriter.instance(context);
   35.83 +    }
   35.84 +
   35.85 +    public void reset(Code_attribute attr) {
   35.86 +        indexMap = new HashMap<Exception_data, Integer>();
   35.87 +        pcMap = new HashMap<Integer, List<Exception_data>>();
   35.88 +        for (int i = 0; i < attr.exception_table.length; i++) {
   35.89 +            Exception_data entry = attr.exception_table[i];
   35.90 +            indexMap.put(entry, i);
   35.91 +            put(entry.start_pc, entry);
   35.92 +            put(entry.end_pc, entry);
   35.93 +            put(entry.handler_pc, entry);
   35.94 +        }
   35.95 +    }
   35.96 +
   35.97 +    public void writeDetails(Instruction instr) {
   35.98 +        writeTrys(instr, NoteKind.END);
   35.99 +        writeTrys(instr, NoteKind.START);
  35.100 +        writeTrys(instr, NoteKind.HANDLER);
  35.101 +    }
  35.102 +
  35.103 +    public void writeTrys(Instruction instr, NoteKind kind) {
  35.104 +        String indent = space(2); // get from Options?
  35.105 +        int pc = instr.getPC();
  35.106 +        List<Exception_data> entries = pcMap.get(pc);
  35.107 +        if (entries != null) {
  35.108 +            for (ListIterator<Exception_data> iter =
  35.109 +                    entries.listIterator(kind == NoteKind.END ? entries.size() : 0);
  35.110 +                    kind == NoteKind.END ? iter.hasPrevious() : iter.hasNext() ; ) {
  35.111 +                Exception_data entry =
  35.112 +                        kind == NoteKind.END ? iter.previous() : iter.next();
  35.113 +                if (kind.match(entry, pc)) {
  35.114 +                    print(indent);
  35.115 +                    print(kind.text);
  35.116 +                    print("[");
  35.117 +                    print(indexMap.get(entry));
  35.118 +                    print("] ");
  35.119 +                    if (entry.catch_type == 0)
  35.120 +                        print("finally");
  35.121 +                    else {
  35.122 +                        print("#" + entry.catch_type);
  35.123 +                        print(" // ");
  35.124 +                        constantWriter.write(entry.catch_type);
  35.125 +                    }
  35.126 +                    println();
  35.127 +                }
  35.128 +            }
  35.129 +        }
  35.130 +    }
  35.131 +
  35.132 +    private void put(int pc, Exception_data entry) {
  35.133 +        List<Exception_data> list = pcMap.get(pc);
  35.134 +        if (list == null) {
  35.135 +            list = new ArrayList<Exception_data>();
  35.136 +            pcMap.put(pc, list);
  35.137 +        }
  35.138 +        if (!list.contains(entry))
  35.139 +            list.add(entry);
  35.140 +    }
  35.141 +
  35.142 +    private Map<Integer, List<Exception_data>> pcMap;
  35.143 +    private Map<Exception_data, Integer> indexMap;
  35.144 +    private ConstantWriter constantWriter;
  35.145 +}
    36.1 --- a/src/share/classes/com/sun/tools/javap/resources/javap.properties	Thu Jun 11 10:54:31 2009 -0700
    36.2 +++ b/src/share/classes/com/sun/tools/javap/resources/javap.properties	Thu Jun 11 21:35:12 2009 -0700
    36.3 @@ -9,13 +9,16 @@
    36.4  err.h.not.supported=-h is no longer available - use the 'javah' program
    36.5  err.incompatible.options=bad combination of options: {0}
    36.6  err.internal.error=internal error: {0} {1} {2}
    36.7 +err.invalid.arg.for.option=invalid argument for option: {0}
    36.8  err.ioerror=IO error reading {0}: {1}
    36.9  err.missing.arg=no value given for {0}
   36.10  err.no.classes.specified=no classes specified
   36.11  err.not.standard.file.manager=can only specify class files when using a standard file manager
   36.12  err.unknown.option=unknown option: {0}
   36.13  err.verify.not.supported=-verify not supported
   36.14 -err.Xold.not.supported.here=-Xold must be given as the first option
   36.15 +err.no.SourceFile.attribute=no SourceFile attribute
   36.16 +err.source.file.not.found=source file not found
   36.17 +warn.Xold.not.supported=-Xold is no longer available
   36.18  
   36.19  main.usage.summary=\
   36.20  Usage: {0} <options> <classes>\n\
    37.1 --- a/src/share/classes/sun/tools/javap/AttrData.java	Thu Jun 11 10:54:31 2009 -0700
    37.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.3 @@ -1,77 +0,0 @@
    37.4 -/*
    37.5 - * Copyright 2002 Sun Microsystems, Inc.  All Rights Reserved.
    37.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    37.7 - *
    37.8 - * This code is free software; you can redistribute it and/or modify it
    37.9 - * under the terms of the GNU General Public License version 2 only, as
   37.10 - * published by the Free Software Foundation.  Sun designates this
   37.11 - * particular file as subject to the "Classpath" exception as provided
   37.12 - * by Sun in the LICENSE file that accompanied this code.
   37.13 - *
   37.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
   37.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   37.16 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   37.17 - * version 2 for more details (a copy is included in the LICENSE file that
   37.18 - * accompanied this code).
   37.19 - *
   37.20 - * You should have received a copy of the GNU General Public License version
   37.21 - * 2 along with this work; if not, write to the Free Software Foundation,
   37.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   37.23 - *
   37.24 - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   37.25 - * CA 95054 USA or visit www.sun.com if you need additional information or
   37.26 - * have any questions.
   37.27 - */
   37.28 -
   37.29 -
   37.30 -
   37.31 -package sun.tools.javap;
   37.32 -
   37.33 -import java.io.*;
   37.34 -
   37.35 -/**
   37.36 - * Reads and stores attribute information.
   37.37 - *
   37.38 - * @author  Sucheta Dambalkar (Adopted code from jdis)
   37.39 - */
   37.40 -class AttrData {
   37.41 -    ClassData cls;
   37.42 -    int name_cpx;
   37.43 -    int datalen;
   37.44 -    byte data[];
   37.45 -
   37.46 -    public AttrData (ClassData cls) {
   37.47 -        this.cls=cls;
   37.48 -    }
   37.49 -
   37.50 -    /**
   37.51 -     * Reads unknown attribute.
   37.52 -     */
   37.53 -    public void read(int name_cpx, DataInputStream in) throws IOException {
   37.54 -        this.name_cpx=name_cpx;
   37.55 -        datalen=in.readInt();
   37.56 -        data=new byte[datalen];
   37.57 -        in.readFully(data);
   37.58 -    }
   37.59 -
   37.60 -    /**
   37.61 -     * Reads just the name of known attribute.
   37.62 -     */
   37.63 -    public void read(int name_cpx){
   37.64 -        this.name_cpx=name_cpx;
   37.65 -    }
   37.66 -
   37.67 -    /**
   37.68 -     * Returns attribute name.
   37.69 -     */
   37.70 -    public String getAttrName(){
   37.71 -        return cls.getString(name_cpx);
   37.72 -    }
   37.73 -
   37.74 -    /**
   37.75 -     * Returns attribute data.
   37.76 -     */
   37.77 -    public byte[] getData(){
   37.78 -        return data;
   37.79 -    }
   37.80 -}
    38.1 --- a/src/share/classes/sun/tools/javap/CPX.java	Thu Jun 11 10:54:31 2009 -0700
    38.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.3 @@ -1,40 +0,0 @@
    38.4 -/*
    38.5 - * Copyright 2002 Sun Microsystems, Inc.  All Rights Reserved.
    38.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    38.7 - *
    38.8 - * This code is free software; you can redistribute it and/or modify it
    38.9 - * under the terms of the GNU General Public License version 2 only, as
   38.10 - * published by the Free Software Foundation.  Sun designates this
   38.11 - * particular file as subject to the "Classpath" exception as provided
   38.12 - * by Sun in the LICENSE file that accompanied this code.
   38.13 - *
   38.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
   38.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   38.16 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   38.17 - * version 2 for more details (a copy is included in the LICENSE file that
   38.18 - * accompanied this code).
   38.19 - *
   38.20 - * You should have received a copy of the GNU General Public License version
   38.21 - * 2 along with this work; if not, write to the Free Software Foundation,
   38.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   38.23 - *
   38.24 - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   38.25 - * CA 95054 USA or visit www.sun.com if you need additional information or
   38.26 - * have any questions.
   38.27 - */
   38.28 -
   38.29 -
   38.30 -package sun.tools.javap;
   38.31 -
   38.32 -/**
   38.33 - * Stores constant pool entry information with one field.
   38.34 - *
   38.35 - * @author  Sucheta Dambalkar (Adopted code from jdis)
   38.36 - */
   38.37 -class CPX {
   38.38 -    int cpx;
   38.39 -
   38.40 -    CPX (int cpx) {
   38.41 -        this.cpx=cpx;
   38.42 -    }
   38.43 -}
    39.1 --- a/src/share/classes/sun/tools/javap/CPX2.java	Thu Jun 11 10:54:31 2009 -0700
    39.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    39.3 @@ -1,41 +0,0 @@
    39.4 -/*
    39.5 - * Copyright 2002 Sun Microsystems, Inc.  All Rights Reserved.
    39.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    39.7 - *
    39.8 - * This code is free software; you can redistribute it and/or modify it
    39.9 - * under the terms of the GNU General Public License version 2 only, as
   39.10 - * published by the Free Software Foundation.  Sun designates this
   39.11 - * particular file as subject to the "Classpath" exception as provided
   39.12 - * by Sun in the LICENSE file that accompanied this code.
   39.13 - *
   39.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
   39.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   39.16 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   39.17 - * version 2 for more details (a copy is included in the LICENSE file that
   39.18 - * accompanied this code).
   39.19 - *
   39.20 - * You should have received a copy of the GNU General Public License version
   39.21 - * 2 along with this work; if not, write to the Free Software Foundation,
   39.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   39.23 - *
   39.24 - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   39.25 - * CA 95054 USA or visit www.sun.com if you need additional information or
   39.26 - * have any questions.
   39.27 - */
   39.28 -
   39.29 -
   39.30 -package sun.tools.javap;
   39.31 -
   39.32 -/**
   39.33 - *  Stores constant pool entry information with two fields.
   39.34 - *
   39.35 - * @author  Sucheta Dambalkar (Adopted code from jdis)
   39.36 - */
   39.37 -class CPX2 {
   39.38 -    int cpx1,cpx2;
   39.39 -
   39.40 -    CPX2 (int cpx1, int cpx2) {
   39.41 -        this.cpx1=cpx1;
   39.42 -        this.cpx2=cpx2;
   39.43 -    }
   39.44 -}
    40.1 --- a/src/share/classes/sun/tools/javap/ClassData.java	Thu Jun 11 10:54:31 2009 -0700
    40.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    40.3 @@ -1,663 +0,0 @@
    40.4 -/*
    40.5 - * Copyright 2002-2008 Sun Microsystems, Inc.  All Rights Reserved.
    40.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    40.7 - *
    40.8 - * This code is free software; you can redistribute it and/or modify it
    40.9 - * under the terms of the GNU General Public License version 2 only, as
   40.10 - * published by the Free Software Foundation.  Sun designates this
   40.11 - * particular file as subject to the "Classpath" exception as provided
   40.12 - * by Sun in the LICENSE file that accompanied this code.
   40.13 - *
   40.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
   40.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   40.16 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   40.17 - * version 2 for more details (a copy is included in the LICENSE file that
   40.18 - * accompanied this code).
   40.19 - *
   40.20 - * You should have received a copy of the GNU General Public License version
   40.21 - * 2 along with this work; if not, write to the Free Software Foundation,
   40.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   40.23 - *
   40.24 - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   40.25 - * CA 95054 USA or visit www.sun.com if you need additional information or
   40.26 - * have any questions.
   40.27 - */
   40.28 -
   40.29 -
   40.30 -package sun.tools.javap;
   40.31 -
   40.32 -import java.util.*;
   40.33 -import java.io.*;
   40.34 -
   40.35 -/**
   40.36 - * Central data repository of the Java Disassembler.
   40.37 - * Stores all the information in java class file.
   40.38 - *
   40.39 - * @author  Sucheta Dambalkar (Adopted code from jdis)
   40.40 - */
   40.41 -public class ClassData implements RuntimeConstants {
   40.42 -
   40.43 -    private int magic;
   40.44 -    private int minor_version;
   40.45 -    private int major_version;
   40.46 -    private int cpool_count;
   40.47 -    private Object cpool[];
   40.48 -    private int access;
   40.49 -    private int this_class = 0;;
   40.50 -    private int super_class;
   40.51 -    private int interfaces_count;
   40.52 -    private int[] interfaces = new int[0];;
   40.53 -    private int fields_count;
   40.54 -    private FieldData[] fields;
   40.55 -    private int methods_count;
   40.56 -    private MethodData[] methods;
   40.57 -    private InnerClassData[] innerClasses;
   40.58 -    private int attributes_count;
   40.59 -    private AttrData[] attrs;
   40.60 -    private String classname;
   40.61 -    private String superclassname;
   40.62 -    private int source_cpx=0;
   40.63 -    private byte tags[];
   40.64 -    private Hashtable<Object,Integer> indexHashAscii = new Hashtable<Object,Integer>();
   40.65 -    private String pkgPrefix="";
   40.66 -    private int pkgPrefixLen=0;
   40.67 -
   40.68 -    /**
   40.69 -     * Read classfile to disassemble.
   40.70 -     */
   40.71 -    public ClassData(InputStream infile){
   40.72 -        try{
   40.73 -            this.read(new DataInputStream(infile));
   40.74 -        }catch (FileNotFoundException ee) {
   40.75 -            error("cant read file");
   40.76 -        }catch (Error ee) {
   40.77 -            ee.printStackTrace();
   40.78 -            error("fatal error");
   40.79 -        } catch (Exception ee) {
   40.80 -            ee.printStackTrace();
   40.81 -            error("fatal exception");
   40.82 -        }
   40.83 -    }
   40.84 -
   40.85 -    /**
   40.86 -     * Reads and stores class file information.
   40.87 -     */
   40.88 -    public void read(DataInputStream in) throws IOException {
   40.89 -        // Read the header
   40.90 -        magic = in.readInt();
   40.91 -        if (magic != JAVA_MAGIC) {
   40.92 -            throw new ClassFormatError("wrong magic: " +
   40.93 -                                       toHex(magic) + ", expected " +
   40.94 -                                       toHex(JAVA_MAGIC));
   40.95 -        }
   40.96 -        minor_version = in.readShort();
   40.97 -        major_version = in.readShort();
   40.98 -        if (major_version != JAVA_VERSION) {
   40.99 -        }
  40.100 -
  40.101 -        // Read the constant pool
  40.102 -        readCP(in);
  40.103 -        access = in.readUnsignedShort();
  40.104 -        this_class = in.readUnsignedShort();
  40.105 -        super_class = in.readUnsignedShort();
  40.106 -
  40.107 -        //Read interfaces.
  40.108 -        interfaces_count = in.readUnsignedShort();
  40.109 -        if(interfaces_count > 0){
  40.110 -            interfaces = new int[interfaces_count];
  40.111 -        }
  40.112 -        for (int i = 0; i < interfaces_count; i++) {
  40.113 -            interfaces[i]=in.readShort();
  40.114 -        }
  40.115 -
  40.116 -        // Read the fields
  40.117 -        readFields(in);
  40.118 -
  40.119 -        // Read the methods
  40.120 -        readMethods(in);
  40.121 -
  40.122 -        // Read the attributes
  40.123 -        attributes_count = in.readUnsignedShort();
  40.124 -        attrs=new AttrData[attributes_count];
  40.125 -        for (int k = 0; k < attributes_count; k++) {
  40.126 -            int name_cpx=in.readUnsignedShort();
  40.127 -            if (getTag(name_cpx)==CONSTANT_UTF8
  40.128 -                && getString(name_cpx).equals("SourceFile")
  40.129 -                ){      if (in.readInt()!=2)
  40.130 -                    throw new ClassFormatError("invalid attr length");
  40.131 -                source_cpx=in.readUnsignedShort();
  40.132 -                AttrData attr=new AttrData(this);
  40.133 -                attr.read(name_cpx);
  40.134 -                attrs[k]=attr;
  40.135 -
  40.136 -            } else if (getTag(name_cpx)==CONSTANT_UTF8
  40.137 -                       && getString(name_cpx).equals("InnerClasses")
  40.138 -                       ){       int length=in.readInt();
  40.139 -                       int num=in.readUnsignedShort();
  40.140 -                       if (2+num*8 != length)
  40.141 -                           throw new ClassFormatError("invalid attr length");
  40.142 -                       innerClasses=new InnerClassData[num];
  40.143 -                       for (int j = 0; j < num; j++) {
  40.144 -                           InnerClassData innerClass=new InnerClassData(this);
  40.145 -                           innerClass.read(in);
  40.146 -                           innerClasses[j]=innerClass;
  40.147 -                       }
  40.148 -                       AttrData attr=new AttrData(this);
  40.149 -                       attr.read(name_cpx);
  40.150 -                       attrs[k]=attr;
  40.151 -            } else {
  40.152 -                AttrData attr=new AttrData(this);
  40.153 -                attr.read(name_cpx, in);
  40.154 -                attrs[k]=attr;
  40.155 -            }
  40.156 -        }
  40.157 -        in.close();
  40.158 -    } // end ClassData.read()
  40.159 -
  40.160 -    /**
  40.161 -     * Reads and stores constant pool info.
  40.162 -     */
  40.163 -    void readCP(DataInputStream in) throws IOException {
  40.164 -        cpool_count = in.readUnsignedShort();
  40.165 -        tags = new byte[cpool_count];
  40.166 -        cpool = new Object[cpool_count];
  40.167 -        for (int i = 1; i < cpool_count; i++) {
  40.168 -            byte tag = in.readByte();
  40.169 -
  40.170 -            switch(tags[i] = tag) {
  40.171 -            case CONSTANT_UTF8:
  40.172 -                String str=in.readUTF();
  40.173 -                indexHashAscii.put(cpool[i] = str, i);
  40.174 -                break;
  40.175 -            case CONSTANT_INTEGER:
  40.176 -                cpool[i] = Integer.valueOf(in.readInt());
  40.177 -                break;
  40.178 -            case CONSTANT_FLOAT:
  40.179 -                cpool[i] = Float.valueOf(in.readFloat());
  40.180 -                break;
  40.181 -            case CONSTANT_LONG:
  40.182 -                cpool[i++] = Long.valueOf(in.readLong());
  40.183 -                break;
  40.184 -            case CONSTANT_DOUBLE:
  40.185 -                cpool[i++] = Double.valueOf(in.readDouble());
  40.186 -                break;
  40.187 -            case CONSTANT_CLASS:
  40.188 -            case CONSTANT_STRING:
  40.189 -                cpool[i] = new CPX(in.readUnsignedShort());
  40.190 -                break;
  40.191 -
  40.192 -            case CONSTANT_FIELD:
  40.193 -            case CONSTANT_METHOD:
  40.194 -            case CONSTANT_INTERFACEMETHOD:
  40.195 -            case CONSTANT_NAMEANDTYPE:
  40.196 -                cpool[i] = new CPX2(in.readUnsignedShort(), in.readUnsignedShort());
  40.197 -                break;
  40.198 -
  40.199 -            case 0:
  40.200 -            default:
  40.201 -                throw new ClassFormatError("invalid constant type: " + (int)tags[i]);
  40.202 -            }
  40.203 -        }
  40.204 -    }
  40.205 -
  40.206 -    /**
  40.207 -     * Reads and strores field info.
  40.208 -     */
  40.209 -    protected void readFields(DataInputStream in) throws IOException {
  40.210 -        int fields_count = in.readUnsignedShort();
  40.211 -        fields=new FieldData[fields_count];
  40.212 -        for (int k = 0; k < fields_count; k++) {
  40.213 -            FieldData field=new FieldData(this);
  40.214 -            field.read(in);
  40.215 -            fields[k]=field;
  40.216 -        }
  40.217 -    }
  40.218 -
  40.219 -    /**
  40.220 -     * Reads and strores Method info.
  40.221 -     */
  40.222 -    protected void readMethods(DataInputStream in) throws IOException {
  40.223 -        int methods_count = in.readUnsignedShort();
  40.224 -        methods=new MethodData[methods_count];
  40.225 -        for (int k = 0; k < methods_count ; k++) {
  40.226 -            MethodData method=new MethodData(this);
  40.227 -            method.read(in);
  40.228 -            methods[k]=method;
  40.229 -        }
  40.230 -    }
  40.231 -
  40.232 -    /**
  40.233 -     * get a string
  40.234 -     */
  40.235 -    public String getString(int n) {
  40.236 -        return (n == 0) ? null : (String)cpool[n];
  40.237 -    }
  40.238 -
  40.239 -    /**
  40.240 -     * get the type of constant given an index
  40.241 -     */
  40.242 -    public byte getTag(int n) {
  40.243 -        try{
  40.244 -            return tags[n];
  40.245 -        } catch (ArrayIndexOutOfBoundsException e) {
  40.246 -            return (byte)100;
  40.247 -        }
  40.248 -    }
  40.249 -
  40.250 -    static final String hexString="0123456789ABCDEF";
  40.251 -
  40.252 -    public static char hexTable[]=hexString.toCharArray();
  40.253 -
  40.254 -    static String toHex(long val, int width) {
  40.255 -        StringBuffer s = new StringBuffer();
  40.256 -        for (int i=width-1; i>=0; i--)
  40.257 -            s.append(hexTable[((int)(val>>(4*i)))&0xF]);
  40.258 -        return "0x"+s.toString();
  40.259 -    }
  40.260 -
  40.261 -    static String toHex(long val) {
  40.262 -        int width;
  40.263 -        for (width=16; width>0; width--) {
  40.264 -            if ((val>>(width-1)*4)!=0) break;
  40.265 -        }
  40.266 -        return toHex(val, width);
  40.267 -    }
  40.268 -
  40.269 -    static String toHex(int val) {
  40.270 -        int width;
  40.271 -        for (width=8; width>0; width--) {
  40.272 -            if ((val>>(width-1)*4)!=0) break;
  40.273 -        }
  40.274 -        return toHex(val, width);
  40.275 -    }
  40.276 -
  40.277 -    public void error(String msg) {
  40.278 -        System.err.println("ERROR:" +msg);
  40.279 -    }
  40.280 -
  40.281 -    /**
  40.282 -     * Returns the name of this class.
  40.283 -     */
  40.284 -    public String getClassName() {
  40.285 -        String res=null;
  40.286 -        if (this_class==0) {
  40.287 -            return res;
  40.288 -        }
  40.289 -        int tcpx;
  40.290 -        try {
  40.291 -            if (tags[this_class]!=CONSTANT_CLASS) {
  40.292 -                return res; //"<CP["+cpx+"] is not a Class> ";
  40.293 -            }
  40.294 -            tcpx=((CPX)cpool[this_class]).cpx;
  40.295 -        } catch (ArrayIndexOutOfBoundsException e) {
  40.296 -            return res; // "#"+cpx+"// invalid constant pool index";
  40.297 -        } catch (Throwable e) {
  40.298 -            return res; // "#"+cpx+"// ERROR IN DISASSEMBLER";
  40.299 -        }
  40.300 -
  40.301 -        try {
  40.302 -            return (String)(cpool[tcpx]);
  40.303 -        } catch (ArrayIndexOutOfBoundsException e) {
  40.304 -            return  res; // "class #"+scpx+"// invalid constant pool index";
  40.305 -        } catch (ClassCastException e) {
  40.306 -            return  res; // "class #"+scpx+"// invalid constant pool reference";
  40.307 -        } catch (Throwable e) {
  40.308 -            return res; // "#"+cpx+"// ERROR IN DISASSEMBLER";
  40.309 -        }
  40.310 -
  40.311 -    }
  40.312 -
  40.313 -    /**
  40.314 -     * Returns the name of class at perticular index.
  40.315 -     */
  40.316 -    public String getClassName(int cpx) {
  40.317 -        String res="#"+cpx;
  40.318 -        if (cpx==0) {
  40.319 -            return res;
  40.320 -        }
  40.321 -        int scpx;
  40.322 -        try {
  40.323 -            if (tags[cpx]!=CONSTANT_CLASS) {
  40.324 -                return res; //"<CP["+cpx+"] is not a Class> ";
  40.325 -            }
  40.326 -            scpx=((CPX)cpool[cpx]).cpx;
  40.327 -        } catch (ArrayIndexOutOfBoundsException e) {
  40.328 -            return res; // "#"+cpx+"// invalid constant pool index";
  40.329 -        } catch (Throwable e) {
  40.330 -            return res; // "#"+cpx+"// ERROR IN DISASSEMBLER";
  40.331 -        }
  40.332 -        res="#"+scpx;
  40.333 -        try {
  40.334 -            return (String)(cpool[scpx]);
  40.335 -        } catch (ArrayIndexOutOfBoundsException e) {
  40.336 -            return  res; // "class #"+scpx+"// invalid constant pool index";
  40.337 -        } catch (ClassCastException e) {
  40.338 -            return  res; // "class #"+scpx+"// invalid constant pool reference";
  40.339 -        } catch (Throwable e) {
  40.340 -            return res; // "#"+cpx+"// ERROR IN DISASSEMBLER";
  40.341 -        }
  40.342 -    }
  40.343 -
  40.344 -    /**
  40.345 -     * Returns true if it is a class
  40.346 -     */
  40.347 -    public boolean isClass() {
  40.348 -        if((access & ACC_INTERFACE) == 0) return true;
  40.349 -        return false;
  40.350 -    }
  40.351 -
  40.352 -    /**
  40.353 -     * Returns true if it is a interface.
  40.354 -     */
  40.355 -    public boolean isInterface(){
  40.356 -        if((access & ACC_INTERFACE) != 0) return true;
  40.357 -        return false;
  40.358 -    }
  40.359 -
  40.360 -    /**
  40.361 -     * Returns true if this member is public, false otherwise.
  40.362 -     */
  40.363 -    public boolean isPublic(){
  40.364 -        return (access & ACC_PUBLIC) != 0;
  40.365 -    }
  40.366 -
  40.367 -    /**
  40.368 -     * Returns the access of this class or interface.
  40.369 -     */
  40.370 -    public String[] getAccess(){
  40.371 -        Vector<String> v = new Vector<String>();
  40.372 -        if ((access & ACC_PUBLIC)   !=0) v.addElement("public");
  40.373 -        if ((access & ACC_FINAL)    !=0) v.addElement("final");
  40.374 -        if ((access & ACC_ABSTRACT) !=0) v.addElement("abstract");
  40.375 -        String[] accflags = new String[v.size()];
  40.376 -        v.copyInto(accflags);
  40.377 -        return accflags;
  40.378 -    }
  40.379 -
  40.380 -    /**
  40.381 -     * Returns list of innerclasses.
  40.382 -     */
  40.383 -    public InnerClassData[] getInnerClasses(){
  40.384 -        return innerClasses;
  40.385 -    }
  40.386 -
  40.387 -    /**
  40.388 -     * Returns list of attributes.
  40.389 -     */
  40.390 -    public AttrData[] getAttributes(){
  40.391 -        return attrs;
  40.392 -    }
  40.393 -
  40.394 -    /**
  40.395 -     * Returns true if superbit is set.
  40.396 -     */
  40.397 -    public boolean isSuperSet(){
  40.398 -        if ((access & ACC_SUPER)   !=0) return true;
  40.399 -        return false;
  40.400 -    }
  40.401 -
  40.402 -    /**
  40.403 -     * Returns super class name.
  40.404 -     */
  40.405 -    public String getSuperClassName(){
  40.406 -        String res=null;
  40.407 -        if (super_class==0) {
  40.408 -            return res;
  40.409 -        }
  40.410 -        int scpx;
  40.411 -        try {
  40.412 -            if (tags[super_class]!=CONSTANT_CLASS) {
  40.413 -                return res; //"<CP["+cpx+"] is not a Class> ";
  40.414 -            }
  40.415 -            scpx=((CPX)cpool[super_class]).cpx;
  40.416 -        } catch (ArrayIndexOutOfBoundsException e) {
  40.417 -            return res; // "#"+cpx+"// invalid constant pool index";
  40.418 -        } catch (Throwable e) {
  40.419 -            return res; // "#"+cpx+"// ERROR IN DISASSEMBLER";
  40.420 -        }
  40.421 -
  40.422 -        try {
  40.423 -            return (String)(cpool[scpx]);
  40.424 -        } catch (ArrayIndexOutOfBoundsException e) {
  40.425 -            return  res; // "class #"+scpx+"// invalid constant pool index";
  40.426 -        } catch (ClassCastException e) {
  40.427 -            return  res; // "class #"+scpx+"// invalid constant pool reference";
  40.428 -        } catch (Throwable e) {
  40.429 -            return res; // "#"+cpx+"// ERROR IN DISASSEMBLER";
  40.430 -        }
  40.431 -    }
  40.432 -
  40.433 -    /**
  40.434 -     * Returns list of super interfaces.
  40.435 -     */
  40.436 -    public String[] getSuperInterfaces(){
  40.437 -        String interfacenames[] = new String[interfaces.length];
  40.438 -        int interfacecpx = -1;
  40.439 -        for(int i = 0; i < interfaces.length; i++){
  40.440 -            interfacecpx=((CPX)cpool[interfaces[i]]).cpx;
  40.441 -            interfacenames[i] = (String)(cpool[interfacecpx]);
  40.442 -        }
  40.443 -        return interfacenames;
  40.444 -    }
  40.445 -
  40.446 -    /**
  40.447 -     * Returns string at prticular constant pool index.
  40.448 -     */
  40.449 -    public String getStringValue(int cpoolx) {
  40.450 -        try {
  40.451 -            return ((String)cpool[cpoolx]);
  40.452 -        } catch (ArrayIndexOutOfBoundsException e) {
  40.453 -            return "//invalid constant pool index:"+cpoolx;
  40.454 -        } catch (ClassCastException e) {
  40.455 -            return "//invalid constant pool ref:"+cpoolx;
  40.456 -        }
  40.457 -    }
  40.458 -
  40.459 -    /**
  40.460 -     * Returns list of field info.
  40.461 -     */
  40.462 -    public  FieldData[] getFields(){
  40.463 -        return fields;
  40.464 -    }
  40.465 -
  40.466 -    /**
  40.467 -     * Returns list of method info.
  40.468 -     */
  40.469 -    public  MethodData[] getMethods(){
  40.470 -        return methods;
  40.471 -    }
  40.472 -
  40.473 -    /**
  40.474 -     * Returns constant pool entry at that index.
  40.475 -     */
  40.476 -    public CPX2 getCpoolEntry(int cpx){
  40.477 -        return ((CPX2)(cpool[cpx]));
  40.478 -    }
  40.479 -
  40.480 -    public Object getCpoolEntryobj(int cpx){
  40.481 -        return (cpool[cpx]);
  40.482 -    }
  40.483 -
  40.484 -    /**
  40.485 -     * Returns index of this class.
  40.486 -     */
  40.487 -    public int getthis_cpx(){
  40.488 -        return this_class;
  40.489 -    }
  40.490 -
  40.491 -    public String TagString (int tag) {
  40.492 -        String res=Tables.tagName(tag);
  40.493 -        if (res==null)  return "BOGUS_TAG:"+tag;
  40.494 -        return res;
  40.495 -    }
  40.496 -
  40.497 -    /**
  40.498 -     * Returns string at that index.
  40.499 -     */
  40.500 -    public String StringValue(int cpx) {
  40.501 -        if (cpx==0) return "#0";
  40.502 -        int tag;
  40.503 -        Object x;
  40.504 -        String suffix="";
  40.505 -        try {
  40.506 -            tag=tags[cpx];
  40.507 -            x=cpool[cpx];
  40.508 -        } catch (IndexOutOfBoundsException e) {
  40.509 -            return "<Incorrect CP index:"+cpx+">";
  40.510 -        }
  40.511 -
  40.512 -        if (x==null) return "<NULL>";
  40.513 -        switch (tag) {
  40.514 -        case CONSTANT_UTF8: {
  40.515 -            StringBuffer sb=new StringBuffer();
  40.516 -            String s=(String)x;
  40.517 -            for (int k=0; k<s.length(); k++) {
  40.518 -                char c=s.charAt(k);
  40.519 -                switch (c) {
  40.520 -                case '\t': sb.append('\\').append('t'); break;
  40.521 -                case '\n': sb.append('\\').append('n'); break;
  40.522 -                case '\r': sb.append('\\').append('r'); break;
  40.523 -                case '\"': sb.append('\\').append('\"'); break;
  40.524 -                default: sb.append(c);
  40.525 -                }
  40.526 -            }
  40.527 -            return sb.toString();
  40.528 -        }
  40.529 -        case CONSTANT_DOUBLE: {
  40.530 -            Double d=(Double)x;
  40.531 -            String sd=d.toString();
  40.532 -            return sd+"d";
  40.533 -        }
  40.534 -        case CONSTANT_FLOAT: {
  40.535 -            Float f=(Float)x;
  40.536 -            String sf=(f).toString();
  40.537 -            return sf+"f";
  40.538 -        }
  40.539 -        case CONSTANT_LONG: {
  40.540 -            Long ln = (Long)x;
  40.541 -            return ln.toString()+'l';
  40.542 -        }
  40.543 -        case CONSTANT_INTEGER: {
  40.544 -            Integer in = (Integer)x;
  40.545 -            return in.toString();
  40.546 -        }
  40.547 -        case CONSTANT_CLASS:
  40.548 -            return javaName(getClassName(cpx));
  40.549 -        case CONSTANT_STRING:
  40.550 -            return StringValue(((CPX)x).cpx);
  40.551 -        case CONSTANT_FIELD:
  40.552 -        case CONSTANT_METHOD:
  40.553 -        case CONSTANT_INTERFACEMETHOD:
  40.554 -            //return getShortClassName(((CPX2)x).cpx1)+"."+StringValue(((CPX2)x).cpx2);
  40.555 -             return javaName(getClassName(((CPX2)x).cpx1))+"."+StringValue(((CPX2)x).cpx2);
  40.556 -
  40.557 -        case CONSTANT_NAMEANDTYPE:
  40.558 -            return getName(((CPX2)x).cpx1)+":"+StringValue(((CPX2)x).cpx2);
  40.559 -        default:
  40.560 -            return "UnknownTag"; //TBD
  40.561 -        }
  40.562 -    }
  40.563 -
  40.564 -    /**
  40.565 -     * Returns resolved java type name.
  40.566 -     */
  40.567 -    public String javaName(String name) {
  40.568 -        if( name==null) return "null";
  40.569 -        int len=name.length();
  40.570 -        if (len==0) return "\"\"";
  40.571 -        int cc='/';
  40.572 -    fullname: { // xxx/yyy/zzz
  40.573 -            int cp;
  40.574 -            for (int k=0; k<len; k += Character.charCount(cp)) {
  40.575 -                cp=name.codePointAt(k);
  40.576 -                if (cc=='/') {
  40.577 -                    if (!Character.isJavaIdentifierStart(cp)) break fullname;
  40.578 -                } else if (cp!='/') {
  40.579 -                    if (!Character.isJavaIdentifierPart(cp)) break fullname;
  40.580 -                }
  40.581 -                cc=cp;
  40.582 -            }
  40.583 -            return name;
  40.584 -        }
  40.585 -        return "\""+name+"\"";
  40.586 -    }
  40.587 -
  40.588 -    public String getName(int cpx) {
  40.589 -        String res;
  40.590 -        try {
  40.591 -            return javaName((String)cpool[cpx]); //.replace('/','.');
  40.592 -        } catch (ArrayIndexOutOfBoundsException e) {
  40.593 -            return "<invalid constant pool index:"+cpx+">";
  40.594 -        } catch (ClassCastException e) {
  40.595 -            return "<invalid constant pool ref:"+cpx+">";
  40.596 -        }
  40.597 -    }
  40.598 -
  40.599 -    /**
  40.600 -     * Returns unqualified class name.
  40.601 -     */
  40.602 -    public String getShortClassName(int cpx) {
  40.603 -        String classname=javaName(getClassName(cpx));
  40.604 -        pkgPrefixLen=classname.lastIndexOf("/")+1;
  40.605 -        if (pkgPrefixLen!=0) {
  40.606 -            pkgPrefix=classname.substring(0,pkgPrefixLen);
  40.607 -            if (classname.startsWith(pkgPrefix)) {
  40.608 -                return classname.substring(pkgPrefixLen);
  40.609 -            }
  40.610 -        }
  40.611 -        return classname;
  40.612 -    }
  40.613 -
  40.614 -    /**
  40.615 -     * Returns source file name.
  40.616 -     */
  40.617 -    public String getSourceName(){
  40.618 -        return getName(source_cpx);
  40.619 -    }
  40.620 -
  40.621 -    /**
  40.622 -     * Returns package name.
  40.623 -     */
  40.624 -    public String getPkgName(){
  40.625 -        String classname=getClassName(this_class);
  40.626 -        pkgPrefixLen=classname.lastIndexOf("/")+1;
  40.627 -        if (pkgPrefixLen!=0) {
  40.628 -            pkgPrefix=classname.substring(0,pkgPrefixLen);
  40.629 -            return("package  "+pkgPrefix.substring(0,pkgPrefixLen-1)+";\n");
  40.630 -        }else return null;
  40.631 -    }
  40.632 -
  40.633 -    /**
  40.634 -     * Returns total constant pool entry count.
  40.635 -     */
  40.636 -    public int getCpoolCount(){
  40.637 -        return cpool_count;
  40.638 -    }
  40.639 -
  40.640 -    public String StringTag(int cpx) {
  40.641 -        byte tag=0;
  40.642 -        String str=null;
  40.643 -        try {
  40.644 -            if (cpx==0) throw new IndexOutOfBoundsException();
  40.645 -            tag=tags[cpx];
  40.646 -            return      TagString(tag);
  40.647 -        } catch (IndexOutOfBoundsException e) {
  40.648 -            str="Incorrect CP index:"+cpx;
  40.649 -        }
  40.650 -        return str;
  40.651 -    }
  40.652 -
  40.653 -    /**
  40.654 -     * Returns minor version of class file.
  40.655 -     */
  40.656 -    public int getMinor_version(){
  40.657 -        return minor_version;
  40.658 -    }
  40.659 -
  40.660 -    /**
  40.661 -     * Returns major version of class file.
  40.662 -     */
  40.663 -    public int getMajor_version(){
  40.664 -        return major_version;
  40.665 -    }
  40.666 -}
    41.1 --- a/src/share/classes/sun/tools/javap/Constants.java	Thu Jun 11 10:54:31 2009 -0700
    41.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    41.3 @@ -1,372 +0,0 @@
    41.4 -/*
    41.5 - * Copyright 2002 Sun Microsystems, Inc.  All Rights Reserved.
    41.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    41.7 - *
    41.8 - * This code is free software; you can redistribute it and/or modify it
    41.9 - * under the terms of the GNU General Public License version 2 only, as
   41.10 - * published by the Free Software Foundation.  Sun designates this
   41.11 - * particular file as subject to the "Classpath" exception as provided
   41.12 - * by Sun in the LICENSE file that accompanied this code.
   41.13 - *
   41.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
   41.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   41.16 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   41.17 - * version 2 for more details (a copy is included in the LICENSE file that
   41.18 - * accompanied this code).
   41.19 - *
   41.20 - * You should have received a copy of the GNU General Public License version
   41.21 - * 2 along with this work; if not, write to the Free Software Foundation,
   41.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   41.23 - *
   41.24 - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   41.25 - * CA 95054 USA or visit www.sun.com if you need additional information or
   41.26 - * have any questions.
   41.27 - */
   41.28 -
   41.29 -
   41.30 -
   41.31 -package sun.tools.javap;
   41.32 -
   41.33 -/**
   41.34 - * This interface defines constant that are used
   41.35 - * throughout the compiler. It inherits from RuntimeConstants,
   41.36 - * which is an autogenerated class that contains contstants
   41.37 - * defined in the interpreter.
   41.38 - */
   41.39 -
   41.40 -public
   41.41 -interface Constants extends RuntimeConstants {
   41.42 -
   41.43 -     /**
   41.44 -     * End of input
   41.45 -     */
   41.46 -    public static final int EOF = -1;
   41.47 -
   41.48 -   /*
   41.49 -     * Flags
   41.50 -     */
   41.51 -    public static final int F_VERBOSE           = 1 << 0;
   41.52 -    public static final int F_DUMP              = 1 << 1;
   41.53 -    public static final int F_WARNINGS          = 1 << 2;
   41.54 -    public static final int F_DEBUG             = 1 << 3;
   41.55 -    public static final int F_OPTIMIZE          = 1 << 4;
   41.56 -    public static final int F_DEPENDENCIES      = 1 << 5;
   41.57 -
   41.58 -    /*
   41.59 -     * Type codes
   41.60 -     */
   41.61 -    public static final int TC_BOOLEAN   = 0;
   41.62 -    public static final int TC_BYTE      = 1;
   41.63 -    public static final int TC_CHAR      = 2;
   41.64 -    public static final int TC_SHORT     = 3;
   41.65 -    public static final int TC_INT       = 4;
   41.66 -    public static final int TC_LONG      = 5;
   41.67 -    public static final int TC_FLOAT     = 6;
   41.68 -    public static final int TC_DOUBLE    = 7;
   41.69 -    public static final int TC_NULL      = 8;
   41.70 -    public static final int TC_ARRAY     = 9;
   41.71 -    public static final int TC_CLASS     = 10;
   41.72 -    public static final int TC_VOID      = 11;
   41.73 -    public static final int TC_METHOD    = 12;
   41.74 -    public static final int TC_ERROR     = 13;
   41.75 -
   41.76 -    /*
   41.77 -     * Type Masks
   41.78 -     */
   41.79 -    public static final int TM_NULL      = 1 << TC_NULL;
   41.80 -    public static final int TM_VOID      = 1 << TC_VOID;
   41.81 -    public static final int TM_BOOLEAN   = 1 << TC_BOOLEAN;
   41.82 -    public static final int TM_BYTE      = 1 << TC_BYTE;
   41.83 -    public static final int TM_CHAR      = 1 << TC_CHAR;
   41.84 -    public static final int TM_SHORT     = 1 << TC_SHORT;
   41.85 -    public static final int TM_INT       = 1 << TC_INT;
   41.86 -    public static final int TM_LONG      = 1 << TC_LONG;
   41.87 -    public static final int TM_FLOAT     = 1 << TC_FLOAT;
   41.88 -    public static final int TM_DOUBLE    = 1 << TC_DOUBLE;
   41.89 -    public static final int TM_ARRAY     = 1 << TC_ARRAY;
   41.90 -    public static final int TM_CLASS     = 1 << TC_CLASS;
   41.91 -    public static final int TM_METHOD    = 1 << TC_METHOD;
   41.92 -    public static final int TM_ERROR     = 1 << TC_ERROR;
   41.93 -
   41.94 -    public static final int TM_INT32     = TM_BYTE | TM_SHORT | TM_CHAR | TM_INT;
   41.95 -    public static final int TM_NUM32     = TM_INT32 | TM_FLOAT;
   41.96 -    public static final int TM_NUM64     = TM_LONG | TM_DOUBLE;
   41.97 -    public static final int TM_INTEGER   = TM_INT32 | TM_LONG;
   41.98 -    public static final int TM_REAL      = TM_FLOAT | TM_DOUBLE;
   41.99 -    public static final int TM_NUMBER    = TM_INTEGER | TM_REAL;
  41.100 -    public static final int TM_REFERENCE = TM_ARRAY | TM_CLASS | TM_NULL;
  41.101 -
  41.102 -    /*
  41.103 -     * Class status
  41.104 -     */
  41.105 -    public static final int CS_UNDEFINED        = 0;
  41.106 -    public static final int CS_UNDECIDED        = 1;
  41.107 -    public static final int CS_BINARY           = 2;
  41.108 -    public static final int CS_SOURCE           = 3;
  41.109 -    public static final int CS_PARSED           = 4;
  41.110 -    public static final int CS_COMPILED         = 5;
  41.111 -    public static final int CS_NOTFOUND         = 6;
  41.112 -
  41.113 -    /*
  41.114 -     * Attributes
  41.115 -     */
  41.116 -    public static final int ATT_ALL             = -1;
  41.117 -    public static final int ATT_CODE            = 1;
  41.118 -
  41.119 -    /*
  41.120 -     * Number of bits used in file offsets
  41.121 -     */
  41.122 -    public static final int OFFSETBITS          = 19;
  41.123 -    public static final int MAXFILESIZE         = (1 << OFFSETBITS) - 1;
  41.124 -    public static final int MAXLINENUMBER       = (1 << (32 - OFFSETBITS)) - 1;
  41.125 -
  41.126 -    /*
  41.127 -     * Operators
  41.128 -     */
  41.129 -    public final int COMMA              = 0;
  41.130 -    public final int ASSIGN             = 1;
  41.131 -
  41.132 -    public final int ASGMUL             = 2;
  41.133 -    public final int ASGDIV             = 3;
  41.134 -    public final int ASGREM             = 4;
  41.135 -    public final int ASGADD             = 5;
  41.136 -    public final int ASGSUB             = 6;
  41.137 -    public final int ASGLSHIFT          = 7;
  41.138 -    public final int ASGRSHIFT          = 8;
  41.139 -    public final int ASGURSHIFT         = 9;
  41.140 -    public final int ASGBITAND          = 10;
  41.141 -    public final int ASGBITOR           = 11;
  41.142 -    public final int ASGBITXOR          = 12;
  41.143 -
  41.144 -    public final int COND               = 13;
  41.145 -    public final int OR                 = 14;
  41.146 -    public final int AND                = 15;
  41.147 -    public final int BITOR              = 16;
  41.148 -    public final int BITXOR             = 17;
  41.149 -    public final int BITAND             = 18;
  41.150 -    public final int NE                 = 19;
  41.151 -    public final int EQ                 = 20;
  41.152 -    public final int GE                 = 21;
  41.153 -    public final int GT                 = 22;
  41.154 -    public final int LE                 = 23;
  41.155 -    public final int LT                 = 24;
  41.156 -    public final int INSTANCEOF         = 25;
  41.157 -    public final int LSHIFT             = 26;
  41.158 -    public final int RSHIFT             = 27;
  41.159 -    public final int URSHIFT            = 28;
  41.160 -    public final int ADD                = 29;
  41.161 -    public final int SUB                = 30;
  41.162 -    public final int DIV                = 31;
  41.163 -    public final int REM                = 32;
  41.164 -    public final int MUL                = 33;
  41.165 -    public final int CAST               = 34;           // (x)y
  41.166 -    public final int POS                = 35;           // +x
  41.167 -    public final int NEG                = 36;           // -x
  41.168 -    public final int NOT                = 37;
  41.169 -    public final int BITNOT             = 38;
  41.170 -    public final int PREINC             = 39;           // ++x
  41.171 -    public final int PREDEC             = 40;           // --x
  41.172 -    public final int NEWARRAY           = 41;
  41.173 -    public final int NEWINSTANCE        = 42;
  41.174 -    public final int NEWFROMNAME        = 43;
  41.175 -    public final int POSTINC            = 44;           // x++
  41.176 -    public final int POSTDEC            = 45;           // x--
  41.177 -    public final int FIELD              = 46;
  41.178 -    public final int METHOD             = 47;           // x(y)
  41.179 -    public final int ARRAYACCESS        = 48;           // x[y]
  41.180 -    public final int NEW                = 49;
  41.181 -    public final int INC                = 50;
  41.182 -    public final int DEC                = 51;
  41.183 -
  41.184 -    public final int CONVERT            = 55;           // implicit conversion
  41.185 -    public final int EXPR               = 56;           // (x)
  41.186 -    public final int ARRAY              = 57;           // {x, y, ...}
  41.187 -    public final int GOTO               = 58;
  41.188 -
  41.189 -    /*
  41.190 -     * Value tokens
  41.191 -     */
  41.192 -    public final int IDENT              = 60;
  41.193 -    public final int BOOLEANVAL         = 61;
  41.194 -    public final int BYTEVAL            = 62;
  41.195 -    public final int CHARVAL            = 63;
  41.196 -    public final int SHORTVAL           = 64;
  41.197 -    public final int INTVAL                     = 65;
  41.198 -    public final int LONGVAL            = 66;
  41.199 -    public final int FLOATVAL           = 67;
  41.200 -    public final int DOUBLEVAL          = 68;
  41.201 -    public final int STRINGVAL          = 69;
  41.202 -
  41.203 -    /*
  41.204 -     * Type keywords
  41.205 -     */
  41.206 -    public final int BYTE               = 70;
  41.207 -    public final int CHAR               = 71;
  41.208 -    public final int SHORT              = 72;
  41.209 -    public final int INT                = 73;
  41.210 -    public final int LONG               = 74;
  41.211 -    public final int FLOAT              = 75;
  41.212 -    public final int DOUBLE             = 76;
  41.213 -    public final int VOID               = 77;
  41.214 -    public final int BOOLEAN            = 78;
  41.215 -
  41.216 -    /*
  41.217 -     * Expression keywords
  41.218 -     */
  41.219 -    public final int TRUE               = 80;
  41.220 -    public final int FALSE              = 81;
  41.221 -    public final int THIS               = 82;
  41.222 -    public final int SUPER              = 83;
  41.223 -    public final int NULL               = 84;
  41.224 -
  41.225 -    /*
  41.226 -     * Statement keywords
  41.227 -     */
  41.228 -    public final int IF                 = 90;
  41.229 -    public final int ELSE               = 91;
  41.230 -    public final int FOR                = 92;
  41.231 -    public final int WHILE              = 93;
  41.232 -    public final int DO                 = 94;
  41.233 -    public final int SWITCH             = 95;
  41.234 -    public final int CASE               = 96;
  41.235 -    public final int DEFAULT            = 97;
  41.236 -    public final int BREAK              = 98;
  41.237 -    public final int CONTINUE           = 99;
  41.238 -    public final int RETURN             = 100;
  41.239 -    public final int TRY                = 101;
  41.240 -    public final int CATCH              = 102;
  41.241 -    public final int FINALLY            = 103;
  41.242 -    public final int THROW              = 104;
  41.243 -    public final int STAT               = 105;
  41.244 -    public final int EXPRESSION         = 106;
  41.245 -    public final int DECLARATION        = 107;
  41.246 -    public final int VARDECLARATION     = 108;
  41.247 -
  41.248 -    /*
  41.249 -     * Declaration keywords
  41.250 -     */
  41.251 -    public final int IMPORT             = 110;
  41.252 -    public final int CLASS              = 111;
  41.253 -    public final int EXTENDS            = 112;
  41.254 -    public final int IMPLEMENTS         = 113;
  41.255 -    public final int INTERFACE          = 114;
  41.256 -    public final int PACKAGE            = 115;
  41.257 -
  41.258 -    /*
  41.259 -     * Modifier keywords
  41.260 -     */
  41.261 -    public final int PRIVATE    = 120;
  41.262 -    public final int PUBLIC             = 121;
  41.263 -    public final int PROTECTED  = 122;
  41.264 -    public final int CONST              = 123;
  41.265 -    public final int STATIC             = 124;
  41.266 -    public final int TRANSIENT          = 125;
  41.267 -    public final int SYNCHRONIZED       = 126;
  41.268 -    public final int NATIVE             = 127;
  41.269 -    public final int FINAL              = 128;
  41.270 -    public final int VOLATILE   = 129;
  41.271 -    public final int ABSTRACT   = 130;
  41.272 -    public final int STRICT             = 165;
  41.273 -
  41.274 -    /*
  41.275 -     * Punctuation
  41.276 -     */
  41.277 -    public final int SEMICOLON  = 135;
  41.278 -    public final int COLON              = 136;
  41.279 -    public final int QUESTIONMARK       = 137;
  41.280 -    public final int LBRACE             = 138;
  41.281 -    public final int RBRACE             = 139;
  41.282 -    public final int LPAREN             = 140;
  41.283 -    public final int RPAREN             = 141;
  41.284 -    public final int LSQBRACKET = 142;
  41.285 -    public final int RSQBRACKET = 143;
  41.286 -    public final int THROWS     = 144;
  41.287 -
  41.288 -    /*
  41.289 -     * Special tokens
  41.290 -     */
  41.291 -    public final int ERROR              = 145;          // an error
  41.292 -    public final int COMMENT    = 146;          // not used anymore.
  41.293 -    public final int TYPE               = 147;
  41.294 -    public final int LENGTH             = 148;
  41.295 -    public final int INLINERETURN       = 149;
  41.296 -    public final int INLINEMETHOD       = 150;
  41.297 -    public final int INLINENEWINSTANCE  = 151;
  41.298 -
  41.299 -    /*
  41.300 -     * Added for jasm
  41.301 -     */
  41.302 -        public final int METHODREF      = 152;
  41.303 -        public final int FIELDREF       = 153;
  41.304 -    public final int STACK              = 154;
  41.305 -    public final int LOCAL              = 155;
  41.306 -    public final int CPINDEX    = 156;
  41.307 -    public final int CPNAME             = 157;
  41.308 -    public final int SIGN               = 158;
  41.309 -    public final int BITS               = 159;
  41.310 -    public final int INF                = 160;
  41.311 -    public final int NAN                = 161;
  41.312 -    public final int INNERCLASS = 162;
  41.313 -    public final int OF         = 163;
  41.314 -    public final int SYNTHETIC          = 164;
  41.315 -// last used=165;
  41.316 -
  41.317 -   /*
  41.318 -     * Operator precedence
  41.319 -     */
  41.320 -    public static final int opPrecedence[] = {
  41.321 -        10,     11,     11,     11,     11,     11,     11,     11,     11,     11,
  41.322 -        11,     11,     11,     12,     13,     14,     15,     16,     17,     18,
  41.323 -        18,     19,     19,     19,     19,     19,     20,     20,     20,     21,
  41.324 -        21,     22,     22,     22,     23,     24,     24,     24,     24,     24,
  41.325 -        24,     25,     25,     26,     26,     26,     26,     26,     26
  41.326 -    };
  41.327 -
  41.328 -    /*
  41.329 -     * Operator names
  41.330 -     */
  41.331 -    public static final String opNames[] = {
  41.332 -        ",",            "=",            "*=",           "/=",           "%=",
  41.333 -        "+=",           "-=",           "<<=",          ">>=",          "<<<=",
  41.334 -        "&=",           "|=",           "^=",           "?:",           "||",
  41.335 -        "&&",           "|",            "^",            "&",            "!=",
  41.336 -        "==",           ">=",           ">",            "<=",           "<",
  41.337 -        "instanceof",   "<<",           ">>",           "<<<",          "+",
  41.338 -        "-",            "/",            "%",            "*",            "cast",
  41.339 -        "+",            "-",            "!",            "~",            "++",
  41.340 -        "--",           "new",          "new",          "new",          "++",
  41.341 -        "--",           "field",        "method",       "[]",           "new",
  41.342 -        "++",           "--",           null,           null,           null,
  41.343 -
  41.344 -        "convert",      "expr",         "array",        "goto",         null,
  41.345 -
  41.346 -        "Identifier",   "Boolean",      "Byte",         "Char",         "Short",
  41.347 -        "Integer",              "Long",         "Float",        "Double",       "String",
  41.348 -
  41.349 -        "byte",         "char",         "short",        "int",          "long",
  41.350 -        "float",        "double",       "void",         "boolean",      null,
  41.351 -
  41.352 -        "true",         "false",        "this",         "super",        "null",
  41.353 -        null,           null,           null,           null,           null,
  41.354 -
  41.355 -        "if",           "else",         "for",          "while",        "do",
  41.356 -        "switch",       "case",         "default",      "break",        "continue",
  41.357 -        "return",       "try",          "catch",        "finally",      "throw",
  41.358 -        "stat",         "expression",   "declaration",  "declaration",  null,
  41.359 -
  41.360 -        "import",       "class",        "extends",      "implements",   "interface",
  41.361 -        "package",      null,           null,           null,           null,
  41.362 -
  41.363 -        "private",      "public",       "protected",    "const",        "static",
  41.364 -        "transient",    "synchronized", "native",       "final",        "volatile",
  41.365 -        "abstract",     null,           null,           null,           null,
  41.366 -
  41.367 -        ";",            ":",            "?",            "{",            "}",
  41.368 -        "(",            ")",            "[",            "]",            "throws",
  41.369 -        "error",        "comment",      "type",         "length",       "inline-return",
  41.370 -        "inline-method", "inline-new",
  41.371 -        "method", "field", "stack", "locals", "CPINDEX", "CPName", "SIGN",
  41.372 -        "bits", "INF", "NaN", "InnerClass", "of", "synthetic"
  41.373 -    };
  41.374 -
  41.375 -}
    42.1 --- a/src/share/classes/sun/tools/javap/FieldData.java	Thu Jun 11 10:54:31 2009 -0700
    42.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    42.3 @@ -1,163 +0,0 @@
    42.4 -/*
    42.5 - * Copyright 2002-2008 Sun Microsystems, Inc.  All Rights Reserved.
    42.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    42.7 - *
    42.8 - * This code is free software; you can redistribute it and/or modify it
    42.9 - * under the terms of the GNU General Public License version 2 only, as
   42.10 - * published by the Free Software Foundation.  Sun designates this
   42.11 - * particular file as subject to the "Classpath" exception as provided
   42.12 - * by Sun in the LICENSE file that accompanied this code.
   42.13 - *
   42.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
   42.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   42.16 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   42.17 - * version 2 for more details (a copy is included in the LICENSE file that
   42.18 - * accompanied this code).
   42.19 - *
   42.20 - * You should have received a copy of the GNU General Public License version
   42.21 - * 2 along with this work; if not, write to the Free Software Foundation,
   42.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   42.23 - *
   42.24 - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   42.25 - * CA 95054 USA or visit www.sun.com if you need additional information or
   42.26 - * have any questions.
   42.27 - */
   42.28 -
   42.29 -
   42.30 -package sun.tools.javap;
   42.31 -
   42.32 -import java.util.*;
   42.33 -import java.io.*;
   42.34 -
   42.35 -/**
   42.36 - * Strores field data informastion.
   42.37 - *
   42.38 - * @author  Sucheta Dambalkar (Adopted code from jdis)
   42.39 - */
   42.40 -
   42.41 -public class FieldData implements RuntimeConstants  {
   42.42 -
   42.43 -    ClassData cls;
   42.44 -    int access;
   42.45 -    int name_index;
   42.46 -    int descriptor_index;
   42.47 -    int attributes_count;
   42.48 -    int value_cpx=0;
   42.49 -    boolean isSynthetic=false;
   42.50 -    boolean isDeprecated=false;
   42.51 -    Vector<AttrData> attrs;
   42.52 -
   42.53 -    public FieldData(ClassData cls){
   42.54 -        this.cls=cls;
   42.55 -    }
   42.56 -
   42.57 -    /**
   42.58 -     * Read and store field info.
   42.59 -     */
   42.60 -    public void read(DataInputStream in) throws IOException {
   42.61 -        access = in.readUnsignedShort();
   42.62 -        name_index = in.readUnsignedShort();
   42.63 -        descriptor_index = in.readUnsignedShort();
   42.64 -        // Read the attributes
   42.65 -        int attributes_count = in.readUnsignedShort();
   42.66 -        attrs=new Vector<AttrData>(attributes_count);
   42.67 -        for (int i = 0; i < attributes_count; i++) {
   42.68 -            int attr_name_index=in.readUnsignedShort();
   42.69 -            if (cls.getTag(attr_name_index)!=CONSTANT_UTF8) continue;
   42.70 -            String attr_name=cls.getString(attr_name_index);
   42.71 -            if (attr_name.equals("ConstantValue")){
   42.72 -                if (in.readInt()!=2)
   42.73 -                    throw new ClassFormatError("invalid ConstantValue attr length");
   42.74 -                value_cpx=in.readUnsignedShort();
   42.75 -                AttrData attr=new AttrData(cls);
   42.76 -                attr.read(attr_name_index);
   42.77 -                attrs.addElement(attr);
   42.78 -            } else if (attr_name.equals("Synthetic")){
   42.79 -                if (in.readInt()!=0)
   42.80 -                    throw new ClassFormatError("invalid Synthetic attr length");
   42.81 -                isSynthetic=true;
   42.82 -                AttrData attr=new AttrData(cls);
   42.83 -                attr.read(attr_name_index);
   42.84 -                attrs.addElement(attr);
   42.85 -            } else if (attr_name.equals("Deprecated")){
   42.86 -                if (in.readInt()!=0)
   42.87 -                    throw new ClassFormatError("invalid Synthetic attr length");
   42.88 -                isDeprecated = true;
   42.89 -                AttrData attr=new AttrData(cls);
   42.90 -                attr.read(attr_name_index);
   42.91 -                attrs.addElement(attr);
   42.92 -            } else {
   42.93 -                AttrData attr=new AttrData(cls);
   42.94 -                attr.read(attr_name_index, in);
   42.95 -                attrs.addElement(attr);
   42.96 -            }
   42.97 -        }
   42.98 -
   42.99 -    }  // end read
  42.100 -
  42.101 -    /**
  42.102 -     * Returns access of a field.
  42.103 -     */
  42.104 -    public String[] getAccess(){
  42.105 -        Vector<String> v = new Vector<String>();
  42.106 -        if ((access & ACC_PUBLIC)   !=0) v.addElement("public");
  42.107 -        if ((access & ACC_PRIVATE)   !=0) v.addElement("private");
  42.108 -        if ((access & ACC_PROTECTED)   !=0) v.addElement("protected");
  42.109 -        if ((access & ACC_STATIC)   !=0) v.addElement("static");
  42.110 -        if ((access & ACC_FINAL)    !=0) v.addElement("final");
  42.111 -        if ((access & ACC_VOLATILE) !=0) v.addElement("volatile");
  42.112 -        if ((access & ACC_TRANSIENT) !=0) v.addElement("transient");
  42.113 -        String[] accflags = new String[v.size()];
  42.114 -        v.copyInto(accflags);
  42.115 -        return accflags;
  42.116 -    }
  42.117 -
  42.118 -    /**
  42.119 -     * Returns name of a field.
  42.120 -     */
  42.121 -    public String getName(){
  42.122 -        return cls.getStringValue(name_index);
  42.123 -    }
  42.124 -
  42.125 -    /**
  42.126 -     * Returns internal signature of a field
  42.127 -     */
  42.128 -    public String getInternalSig(){
  42.129 -        return cls.getStringValue(descriptor_index);
  42.130 -    }
  42.131 -
  42.132 -    /**
  42.133 -     * Returns java type signature of a field.
  42.134 -     */
  42.135 -    public String getType(){
  42.136 -        return new TypeSignature(getInternalSig()).getFieldType();
  42.137 -    }
  42.138 -
  42.139 -    /**
  42.140 -     * Returns true if field is synthetic.
  42.141 -     */
  42.142 -    public boolean isSynthetic(){
  42.143 -        return isSynthetic;
  42.144 -    }
  42.145 -
  42.146 -    /**
  42.147 -     * Returns true if field is deprecated.
  42.148 -     */
  42.149 -    public boolean isDeprecated(){
  42.150 -        return isDeprecated;
  42.151 -    }
  42.152 -
  42.153 -    /**
  42.154 -     * Returns index of constant value in cpool.
  42.155 -     */
  42.156 -    public int getConstantValueIndex(){
  42.157 -        return (value_cpx);
  42.158 -    }
  42.159 -
  42.160 -    /**
  42.161 -     * Returns list of attributes of field.
  42.162 -     */
  42.163 -    public Vector<?> getAttributes(){
  42.164 -        return attrs;
  42.165 -    }
  42.166 -}
    43.1 --- a/src/share/classes/sun/tools/javap/InnerClassData.java	Thu Jun 11 10:54:31 2009 -0700
    43.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    43.3 @@ -1,75 +0,0 @@
    43.4 -/*
    43.5 - * Copyright 2002-2008 Sun Microsystems, Inc.  All Rights Reserved.
    43.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    43.7 - *
    43.8 - * This code is free software; you can redistribute it and/or modify it
    43.9 - * under the terms of the GNU General Public License version 2 only, as
   43.10 - * published by the Free Software Foundation.  Sun designates this
   43.11 - * particular file as subject to the "Classpath" exception as provided
   43.12 - * by Sun in the LICENSE file that accompanied this code.
   43.13 - *
   43.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
   43.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   43.16 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   43.17 - * version 2 for more details (a copy is included in the LICENSE file that
   43.18 - * accompanied this code).
   43.19 - *
   43.20 - * You should have received a copy of the GNU General Public License version
   43.21 - * 2 along with this work; if not, write to the Free Software Foundation,
   43.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   43.23 - *
   43.24 - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   43.25 - * CA 95054 USA or visit www.sun.com if you need additional information or
   43.26 - * have any questions.
   43.27 - */
   43.28 -
   43.29 -
   43.30 -package sun.tools.javap;
   43.31 -
   43.32 -import java.io.*;
   43.33 -import java.util.*;
   43.34 -
   43.35 -/**
   43.36 - * Strores InnerClass data informastion.
   43.37 - *
   43.38 - * @author  Sucheta Dambalkar (Adopted code from jdis)
   43.39 - */
   43.40 -class InnerClassData  implements RuntimeConstants {
   43.41 -    ClassData cls;
   43.42 -
   43.43 -
   43.44 -    int inner_class_info_index
   43.45 -        ,outer_class_info_index
   43.46 -        ,inner_name_index
   43.47 -        ,access
   43.48 -        ;
   43.49 -
   43.50 -    public InnerClassData(ClassData cls) {
   43.51 -        this.cls=cls;
   43.52 -
   43.53 -    }
   43.54 -
   43.55 -    /**
   43.56 -     * Read Innerclass attribute data.
   43.57 -     */
   43.58 -    public void read(DataInputStream in) throws IOException {
   43.59 -        inner_class_info_index = in.readUnsignedShort();
   43.60 -        outer_class_info_index = in.readUnsignedShort();
   43.61 -        inner_name_index = in.readUnsignedShort();
   43.62 -        access = in.readUnsignedShort();
   43.63 -    }  // end read
   43.64 -
   43.65 -    /**
   43.66 -     * Returns the access of this class or interface.
   43.67 -     */
   43.68 -    public String[] getAccess(){
   43.69 -        Vector<String> v = new Vector<String>();
   43.70 -        if ((access & ACC_PUBLIC)   !=0) v.addElement("public");
   43.71 -        if ((access & ACC_FINAL)    !=0) v.addElement("final");
   43.72 -        if ((access & ACC_ABSTRACT) !=0) v.addElement("abstract");
   43.73 -        String[] accflags = new String[v.size()];
   43.74 -        v.copyInto(accflags);
   43.75 -        return accflags;
   43.76 -    }
   43.77 -
   43.78 -} // end InnerClassData
    44.1 --- a/src/share/classes/sun/tools/javap/JavapEnvironment.java	Thu Jun 11 10:54:31 2009 -0700
    44.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    44.3 @@ -1,355 +0,0 @@
    44.4 -/*
    44.5 - * Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
    44.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44.7 - *
    44.8 - * This code is free software; you can redistribute it and/or modify it
    44.9 - * under the terms of the GNU General Public License version 2 only, as
   44.10 - * published by the Free Software Foundation.  Sun designates this
   44.11 - * particular file as subject to the "Classpath" exception as provided
   44.12 - * by Sun in the LICENSE file that accompanied this code.
   44.13 - *
   44.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
   44.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   44.16 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   44.17 - * version 2 for more details (a copy is included in the LICENSE file that
   44.18 - * accompanied this code).
   44.19 - *
   44.20 - * You should have received a copy of the GNU General Public License version
   44.21 - * 2 along with this work; if not, write to the Free Software Foundation,
   44.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   44.23 - *
   44.24 - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   44.25 - * CA 95054 USA or visit www.sun.com if you need additional information or
   44.26 - * have any questions.
   44.27 - */
   44.28 -
   44.29 -
   44.30 -package sun.tools.javap;
   44.31 -
   44.32 -import java.util.*;
   44.33 -import java.io.*;
   44.34 -import java.util.jar.*;
   44.35 -
   44.36 -
   44.37 -/**
   44.38 - * Strores flag values according to command line options
   44.39 - * and sets path where to find classes.
   44.40 - *
   44.41 - * @author  Sucheta Dambalkar
   44.42 - */
   44.43 -public class JavapEnvironment {
   44.44 -
   44.45 -    //Access flags
   44.46 -    public static final int PRIVATE = 0;
   44.47 -    public static final int PROTECTED  = 1;
   44.48 -    public static final int PACKAGE = 2;
   44.49 -    public static final int PUBLIC  = 3;
   44.50 -
   44.51 -    //search path flags.
   44.52 -    private static final int start = 0;
   44.53 -    private static final int  cmdboot= 1;
   44.54 -    private static final int sunboot = 2;
   44.55 -    private static final int  javaclass= 3;
   44.56 -    private static final int  cmdextdir= 4;
   44.57 -    private static final int  javaext= 5;
   44.58 -    private static final int  cmdclasspath= 6;
   44.59 -    private static final int  envclasspath= 7;
   44.60 -    private static final int  javaclasspath= 8;
   44.61 -    private static final int  currentdir = 9;
   44.62 -
   44.63 -
   44.64 -    // JavapEnvironment flag settings
   44.65 -    boolean showLineAndLocal = false;
   44.66 -    int showAccess = PACKAGE;
   44.67 -    boolean showDisassembled = false;
   44.68 -    boolean showVerbose = false;
   44.69 -    boolean showInternalSigs = false;
   44.70 -    String classPathString = null;
   44.71 -    String bootClassPathString = null;
   44.72 -    String extDirsString = null;
   44.73 -    boolean extDirflag = false;
   44.74 -    boolean nothingToDo = true;
   44.75 -    boolean showallAttr = false;
   44.76 -    String classpath = null;
   44.77 -    int searchpath = start;
   44.78 -
   44.79 -    /**
   44.80 -     *  According to which flags are set,
   44.81 -     *  returns file input stream for classfile to disassemble.
   44.82 -     */
   44.83 -
   44.84 -    public InputStream getFileInputStream(String Name){
   44.85 -        InputStream fileInStream = null;
   44.86 -        searchpath = cmdboot;
   44.87 -        try{
   44.88 -            if(searchpath == cmdboot){
   44.89 -                if(bootClassPathString != null){
   44.90 -                    //search in specified bootclasspath.
   44.91 -                    classpath = bootClassPathString;
   44.92 -                    if((fileInStream = resolvefilename(Name)) != null) return fileInStream;
   44.93 -                    //no classes found in search path.
   44.94 -                    else searchpath = cmdextdir;
   44.95 -                }
   44.96 -                else searchpath = sunboot;
   44.97 -            }
   44.98 -
   44.99 -            if(searchpath == sunboot){
  44.100 -                if(System.getProperty("sun.boot.class.path") != null){
  44.101 -                    //search in sun.boot.class.path
  44.102 -                    classpath = System.getProperty("sun.boot.class.path");
  44.103 -                    if((fileInStream = resolvefilename(Name)) != null) return fileInStream;
  44.104 -                    //no classes found in search path
  44.105 -                    else searchpath = cmdextdir;
  44.106 -                }
  44.107 -                else searchpath = javaclass;
  44.108 -            }
  44.109 -
  44.110 -            if(searchpath == javaclass){
  44.111 -                if(System.getProperty("java.class.path") != null){
  44.112 -                    //search in java.class.path
  44.113 -                    classpath =System.getProperty("java.class.path");
  44.114 -                    if((fileInStream = resolvefilename(Name)) != null) return fileInStream;
  44.115 -                    //no classes found in search path
  44.116 -                    else searchpath = cmdextdir;
  44.117 -                }
  44.118 -                else searchpath = cmdextdir;
  44.119 -            }
  44.120 -
  44.121 -            if(searchpath == cmdextdir){
  44.122 -                if(extDirsString != null){
  44.123 -                    //search in specified extdir.
  44.124 -                    classpath = extDirsString;
  44.125 -                    extDirflag = true;
  44.126 -                    if((fileInStream = resolvefilename(Name)) != null) return fileInStream;
  44.127 -                    //no classes found in search path
  44.128 -                    else {
  44.129 -                        searchpath = cmdclasspath;
  44.130 -                        extDirflag = false;
  44.131 -                    }
  44.132 -                }
  44.133 -                else searchpath = javaext;
  44.134 -            }
  44.135 -
  44.136 -            if(searchpath == javaext){
  44.137 -                if(System.getProperty("java.ext.dirs") != null){
  44.138 -                    //search in java.ext.dirs
  44.139 -                    classpath = System.getProperty("java.ext.dirs");
  44.140 -                    extDirflag = true;
  44.141 -                    if((fileInStream = resolvefilename(Name)) != null) return fileInStream;
  44.142 -                    //no classes found in search path
  44.143 -                    else {
  44.144 -                        searchpath = cmdclasspath;
  44.145 -                        extDirflag = false;
  44.146 -                    }
  44.147 -                }
  44.148 -                else searchpath = cmdclasspath;
  44.149 -            }
  44.150 -            if(searchpath == cmdclasspath){
  44.151 -                if(classPathString != null){
  44.152 -                    //search in specified classpath.
  44.153 -                    classpath = classPathString;
  44.154 -                    if((fileInStream = resolvefilename(Name)) != null) return fileInStream;
  44.155 -                    //no classes found in search path
  44.156 -                    else searchpath = 8;
  44.157 -                }
  44.158 -                else searchpath = envclasspath;
  44.159 -            }
  44.160 -
  44.161 -            if(searchpath == envclasspath){
  44.162 -                if(System.getProperty("env.class.path")!= null){
  44.163 -                    //search in env.class.path
  44.164 -                    classpath = System.getProperty("env.class.path");
  44.165 -                    if((fileInStream = resolvefilename(Name)) != null) return fileInStream;
  44.166 -                    //no classes found in search path.
  44.167 -                    else searchpath = javaclasspath;
  44.168 -                }
  44.169 -                else searchpath = javaclasspath;
  44.170 -            }
  44.171 -
  44.172 -            if(searchpath == javaclasspath){
  44.173 -                if(("application.home") == null){
  44.174 -                    //search in java.class.path
  44.175 -                    classpath = System.getProperty("java.class.path");
  44.176 -                    if((fileInStream = resolvefilename(Name)) != null) return fileInStream;
  44.177 -                    //no classes found in search path.
  44.178 -                    else searchpath = currentdir;
  44.179 -                }
  44.180 -                else searchpath = currentdir;
  44.181 -            }
  44.182 -
  44.183 -            if(searchpath == currentdir){
  44.184 -                classpath = ".";
  44.185 -                //search in current dir.
  44.186 -                if((fileInStream = resolvefilename(Name)) != null) return fileInStream;
  44.187 -                else {
  44.188 -                    //no classes found in search path.
  44.189 -                    error("Could not find "+ Name);
  44.190 -                    System.exit(1);
  44.191 -                }
  44.192 -            }
  44.193 -        }catch(SecurityException excsec){
  44.194 -            excsec.printStackTrace();
  44.195 -            error("fatal exception");
  44.196 -        }catch(NullPointerException excnull){
  44.197 -            excnull.printStackTrace();
  44.198 -            error("fatal exception");
  44.199 -        }catch(IllegalArgumentException excill){
  44.200 -            excill.printStackTrace();
  44.201 -            error("fatal exception");
  44.202 -        }
  44.203 -
  44.204 -        return null;
  44.205 -    }
  44.206 -
  44.207 -
  44.208 -    public void error(String msg) {
  44.209 -        System.err.println("ERROR:" +msg);
  44.210 -    }
  44.211 -
  44.212 -    /**
  44.213 -     * Resolves file name for classfile to disassemble.
  44.214 -     */
  44.215 -    public InputStream resolvefilename(String name){
  44.216 -        String classname = name.replace('.', '/') + ".class";
  44.217 -        while (true) {
  44.218 -            InputStream instream = extDirflag
  44.219 -                ? resolveExdirFilename(classname)
  44.220 -                : resolveclasspath(classname);
  44.221 -            if (instream != null)
  44.222 -                return instream;
  44.223 -            int lastindex = classname.lastIndexOf('/');
  44.224 -            if (lastindex == -1) return null;
  44.225 -            classname = classname.substring(0, lastindex) + "$" +
  44.226 -                classname.substring(lastindex + 1);
  44.227 -        }
  44.228 -    }
  44.229 -
  44.230 -    /**
  44.231 -     * Resolves file name for classfile to disassemble if flag exdir is set.
  44.232 -     */
  44.233 -    public InputStream resolveExdirFilename(String classname){
  44.234 -        if(classpath.indexOf(File.pathSeparator) != -1){
  44.235 -            //separates path
  44.236 -            StringTokenizer st = new StringTokenizer(classpath, File.pathSeparator);
  44.237 -            while(st.hasMoreTokens()){
  44.238 -                String path = st.nextToken();
  44.239 -                InputStream in = resolveExdirFilenamehelper(path, classname);
  44.240 -                if (in != null)
  44.241 -                    return in;
  44.242 -            }
  44.243 -        }else return (resolveExdirFilenamehelper(classpath, classname));
  44.244 -
  44.245 -        return null;
  44.246 -    }
  44.247 -
  44.248 -    /**
  44.249 -     * Resolves file name for classfile to disassemble.
  44.250 -     */
  44.251 -    public InputStream resolveclasspath(String classname){
  44.252 -        if(classpath.indexOf(File.pathSeparator) != -1){
  44.253 -            StringTokenizer st = new StringTokenizer(classpath, File.pathSeparator);
  44.254 -            //separates path.
  44.255 -            while(st.hasMoreTokens()){
  44.256 -                String path = (st.nextToken()).trim();
  44.257 -                InputStream in = resolveclasspathhelper(path, classname);
  44.258 -                if(in != null) return in;
  44.259 -
  44.260 -            }
  44.261 -            return null;
  44.262 -        }
  44.263 -        else return (resolveclasspathhelper(classpath, classname));
  44.264 -    }
  44.265 -
  44.266 -
  44.267 -    /**
  44.268 -     * Returns file input stream for classfile to disassemble if exdir is set.
  44.269 -     */
  44.270 -    public InputStream resolveExdirFilenamehelper(String path, String classname){
  44.271 -        File fileobj = new File(path);
  44.272 -        if(fileobj.isDirectory()){
  44.273 -            // gets list of files in that directory.
  44.274 -            File[] filelist = fileobj.listFiles();
  44.275 -            for(int i = 0; i < filelist.length; i++){
  44.276 -                try{
  44.277 -                    //file is a jar file.
  44.278 -                    if(filelist[i].toString().endsWith(".jar")){
  44.279 -                        JarFile jfile = new JarFile(filelist[i]);
  44.280 -                        if((jfile.getEntry(classname)) != null){
  44.281 -
  44.282 -                            InputStream filein = jfile.getInputStream(jfile.getEntry(classname));
  44.283 -                            int bytearraysize = filein.available();
  44.284 -                            byte []b =  new byte[bytearraysize];
  44.285 -                            int totalread = 0;
  44.286 -                            while(totalread < bytearraysize){
  44.287 -                                totalread += filein.read(b, totalread, bytearraysize-totalread);
  44.288 -                            }
  44.289 -                            InputStream inbyte = new ByteArrayInputStream(b);
  44.290 -                            filein.close();
  44.291 -                            return inbyte;
  44.292 -                        }
  44.293 -                    } else {
  44.294 -                        //not a jar file.
  44.295 -                        String filename = path+"/"+ classname;
  44.296 -                        File file = new File(filename);
  44.297 -                        if(file.isFile()){
  44.298 -                            return (new FileInputStream(file));
  44.299 -                        }
  44.300 -                    }
  44.301 -                }catch(FileNotFoundException fnexce){
  44.302 -                    fnexce.printStackTrace();
  44.303 -                    error("cant read file");
  44.304 -                    error("fatal exception");
  44.305 -                }catch(IOException ioexc){
  44.306 -                    ioexc.printStackTrace();
  44.307 -                    error("fatal exception");
  44.308 -                }
  44.309 -            }
  44.310 -        }
  44.311 -
  44.312 -        return null;
  44.313 -    }
  44.314 -
  44.315 -
  44.316 -    /**
  44.317 -     * Returns file input stream for classfile to disassemble.
  44.318 -     */
  44.319 -    public InputStream resolveclasspathhelper(String path, String classname){
  44.320 -        File fileobj = new File(path);
  44.321 -        try{
  44.322 -            if(fileobj.isDirectory()){
  44.323 -                //is a directory.
  44.324 -                String filename = path+"/"+ classname;
  44.325 -                File file = new File(filename);
  44.326 -                if(file.isFile()){
  44.327 -                    return (new FileInputStream(file));
  44.328 -                }
  44.329 -
  44.330 -            }else if(fileobj.isFile()){
  44.331 -                if(fileobj.toString().endsWith(".jar")){
  44.332 -                    //is a jar file.
  44.333 -                    JarFile jfile = new JarFile(fileobj);
  44.334 -                    if((jfile.getEntry(classname)) != null){
  44.335 -                        InputStream filein = jfile.getInputStream(jfile.getEntry(classname));
  44.336 -                        int bytearraysize = filein.available();
  44.337 -                        byte []b =  new byte[bytearraysize];
  44.338 -                        int totalread = 0;
  44.339 -                        while(totalread < bytearraysize){
  44.340 -                                totalread += filein.read(b, totalread, bytearraysize-totalread);
  44.341 -                        }
  44.342 -                        InputStream inbyte = new ByteArrayInputStream(b);
  44.343 -                        filein.close();
  44.344 -                         return inbyte;
  44.345 -                    }
  44.346 -                }
  44.347 -            }
  44.348 -        }catch(FileNotFoundException fnexce){
  44.349 -            fnexce.printStackTrace();
  44.350 -            error("cant read file");
  44.351 -            error("fatal exception");
  44.352 -        }catch(IOException ioexce){
  44.353 -            ioexce.printStackTrace();
  44.354 -            error("fatal exception");
  44.355 -        }
  44.356 -        return null;
  44.357 -    }
  44.358 -}
    45.1 --- a/src/share/classes/sun/tools/javap/JavapPrinter.java	Thu Jun 11 10:54:31 2009 -0700
    45.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    45.3 @@ -1,919 +0,0 @@
    45.4 -/*
    45.5 - * Copyright 2002-2009 Sun Microsystems, Inc.  All Rights Reserved.
    45.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    45.7 - *
    45.8 - * This code is free software; you can redistribute it and/or modify it
    45.9 - * under the terms of the GNU General Public License version 2 only, as
   45.10 - * published by the Free Software Foundation.  Sun designates this
   45.11 - * particular file as subject to the "Classpath" exception as provided
   45.12 - * by Sun in the LICENSE file that accompanied this code.
   45.13 - *
   45.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
   45.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   45.16 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   45.17 - * version 2 for more details (a copy is included in the LICENSE file that
   45.18 - * accompanied this code).
   45.19 - *
   45.20 - * You should have received a copy of the GNU General Public License version
   45.21 - * 2 along with this work; if not, write to the Free Software Foundation,
   45.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   45.23 - *
   45.24 - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   45.25 - * CA 95054 USA or visit www.sun.com if you need additional information or
   45.26 - * have any questions.
   45.27 - */
   45.28 -
   45.29 -
   45.30 -package sun.tools.javap;
   45.31 -
   45.32 -import java.util.*;
   45.33 -import java.io.*;
   45.34 -
   45.35 -import static sun.tools.javap.RuntimeConstants.*;
   45.36 -
   45.37 -/**
   45.38 - * Program to print information about class files
   45.39 - *
   45.40 - * @author  Sucheta Dambalkar
   45.41 - */
   45.42 -public class JavapPrinter {
   45.43 -    JavapEnvironment env;
   45.44 -    ClassData cls;
   45.45 -    byte[] code;
   45.46 -    String lP= "";
   45.47 -    PrintWriter out;
   45.48 -
   45.49 -    public JavapPrinter(InputStream cname, PrintWriter out, JavapEnvironment env){
   45.50 -        this.out = out;
   45.51 -        this.cls =  new ClassData(cname);
   45.52 -        this.env = env;
   45.53 -    }
   45.54 -
   45.55 -    /**
   45.56 -     *  Entry point to print class file information.
   45.57 -     */
   45.58 -    public void print(){
   45.59 -        printclassHeader();
   45.60 -        printfields();
   45.61 -        printMethods();
   45.62 -        printend();
   45.63 -    }
   45.64 -
   45.65 -    /**
   45.66 -     * Print a description of the class (not members).
   45.67 -     */
   45.68 -    public void printclassHeader(){
   45.69 -        String srcName="";
   45.70 -        if ((srcName = cls.getSourceName()) != "null") // requires debug info
   45.71 -            out.println("Compiled from " + javaclassname(srcName));
   45.72 -
   45.73 -        if(cls.isInterface())   {
   45.74 -            // The only useful access modifier of an interface is
   45.75 -            // public; interfaces are always marked as abstract and
   45.76 -            // cannot be final.
   45.77 -            out.print((cls.isPublic()?"public ":"") +
   45.78 -                      "interface "+ javaclassname(cls.getClassName()));
   45.79 -        }
   45.80 -        else if(cls.isClass()) {
   45.81 -            String []accflags =  cls.getAccess();
   45.82 -            printAccess(accflags);
   45.83 -            out.print("class "+ javaclassname(cls.getClassName()));
   45.84 -
   45.85 -            if(cls.getSuperClassName() != null){
   45.86 -                out.print(" extends " + javaclassname(cls.getSuperClassName()));
   45.87 -            }
   45.88 -        }
   45.89 -
   45.90 -        String []interfacelist =  cls.getSuperInterfaces();
   45.91 -        if(interfacelist.length > 0){
   45.92 -            if(cls.isClass()) {
   45.93 -                out.print(" implements ");
   45.94 -            }
   45.95 -            else if(cls.isInterface()){
   45.96 -                out.print(" extends ");
   45.97 -            }
   45.98 -
   45.99 -            for(int j = 0; j < interfacelist.length; j++){
  45.100 -                out.print(javaclassname(interfacelist[j]));
  45.101 -
  45.102 -                if((j+1) < interfacelist.length) {
  45.103 -                    out.print(",");
  45.104 -                }
  45.105 -            }
  45.106 -        }
  45.107 -
  45.108 -        // Print class attribute information.
  45.109 -        if((env.showallAttr) || (env.showVerbose)){
  45.110 -            printClassAttributes();
  45.111 -        }
  45.112 -        // Print verbose output.
  45.113 -        if(env.showVerbose){
  45.114 -            printverbosecls();
  45.115 -        }
  45.116 -        out.println("{");
  45.117 -    }
  45.118 -
  45.119 -    /**
  45.120 -     * Print verbose output.
  45.121 -     */
  45.122 -    public void printverbosecls(){
  45.123 -        out.println("  minor version: "+cls.getMinor_version());
  45.124 -        out.println("  major version: "+cls.getMajor_version());
  45.125 -        out.println("  Constant pool:");
  45.126 -        printcp();
  45.127 -        env.showallAttr = true;
  45.128 -    }
  45.129 -
  45.130 -    /**
  45.131 -     * Print class attribute information.
  45.132 -     */
  45.133 -    public void printClassAttributes(){
  45.134 -        out.println();
  45.135 -        AttrData[] clsattrs = cls.getAttributes();
  45.136 -        for(int i = 0; i < clsattrs.length; i++){
  45.137 -            String clsattrname = clsattrs[i].getAttrName();
  45.138 -            if(clsattrname.equals("SourceFile")){
  45.139 -                out.println("  SourceFile: "+ cls.getSourceName());
  45.140 -            }else if(clsattrname.equals("InnerClasses")){
  45.141 -                printInnerClasses();
  45.142 -            }else {
  45.143 -                printAttrData(clsattrs[i]);
  45.144 -            }
  45.145 -        }
  45.146 -    }
  45.147 -
  45.148 -    /**
  45.149 -     * Print the fields
  45.150 -     */
  45.151 -    public void printfields(){
  45.152 -        FieldData[] fields = cls.getFields();
  45.153 -        for(int f = 0; f < fields.length; f++){
  45.154 -            String[] accflags = fields[f].getAccess();
  45.155 -            if(checkAccess(accflags)){
  45.156 -                if(!(env. showLineAndLocal || env.showDisassembled || env.showVerbose
  45.157 -                     ||  env.showInternalSigs || env.showallAttr)){
  45.158 -                    out.print("    ");
  45.159 -                }
  45.160 -                printAccess(accflags);
  45.161 -                out.println(fields[f].getType()+" " +fields[f].getName()+";");
  45.162 -                if (env.showInternalSigs) {
  45.163 -                    out.println("  Signature: " + (fields[f].getInternalSig()));
  45.164 -                }
  45.165 -
  45.166 -                // print field attribute information.
  45.167 -                if (env.showallAttr){
  45.168 -                    printFieldAttributes(fields[f]);
  45.169 -
  45.170 -                }
  45.171 -                if((env.showDisassembled) || (env.showLineAndLocal)){
  45.172 -                    out.println();
  45.173 -                }
  45.174 -            }
  45.175 -        }
  45.176 -    }
  45.177 -
  45.178 -
  45.179 -    /* print field attribute information. */
  45.180 -    public void printFieldAttributes(FieldData field){
  45.181 -        Vector<?> fieldattrs = field.getAttributes();
  45.182 -        for(int j = 0; j < fieldattrs.size(); j++){
  45.183 -            String fieldattrname = ((AttrData)fieldattrs.elementAt(j)).getAttrName();
  45.184 -            if(fieldattrname.equals("ConstantValue")){
  45.185 -                printConstantValue(field);
  45.186 -            }else if (fieldattrname.equals("Deprecated")){
  45.187 -                out.println("Deprecated: "+ field.isDeprecated());
  45.188 -            }else if (fieldattrname.equals("Synthetic")){
  45.189 -                out.println("  Synthetic: "+ field.isSynthetic());
  45.190 -            }else {
  45.191 -                printAttrData((AttrData)fieldattrs.elementAt(j));
  45.192 -            }
  45.193 -        }
  45.194 -        out.println();
  45.195 -    }
  45.196 -
  45.197 -    /**
  45.198 -     * Print the methods
  45.199 -     */
  45.200 -    public void printMethods(){
  45.201 -        MethodData[] methods = cls.getMethods();
  45.202 -        for(int m = 0; m < methods.length; m++){
  45.203 -            String[] accflags = methods[m].getAccess();
  45.204 -            if(checkAccess(accflags)){
  45.205 -                if(!(env. showLineAndLocal || env.showDisassembled || env.showVerbose
  45.206 -                     ||  env.showInternalSigs || env.showallAttr)){
  45.207 -                    out.print("    ");
  45.208 -                }
  45.209 -                printMethodSignature(methods[m], accflags);
  45.210 -                printExceptions(methods[m]);
  45.211 -                out.println(";");
  45.212 -
  45.213 -                // Print internal signature of method.
  45.214 -                if (env.showInternalSigs){
  45.215 -                    out.println("  Signature: " + (methods[m].getInternalSig()));
  45.216 -                }
  45.217 -
  45.218 -                //Print disassembled code.
  45.219 -                if(env.showDisassembled && ! env.showallAttr) {
  45.220 -                    printcodeSequence(methods[m]);
  45.221 -                    printExceptionTable(methods[m]);
  45.222 -                    out.println();
  45.223 -                }
  45.224 -
  45.225 -                // Print line and local variable attribute information.
  45.226 -                if (env.showLineAndLocal) {
  45.227 -                    printLineNumTable(methods[m]);
  45.228 -                    printLocVarTable(methods[m]);
  45.229 -                    out.println();
  45.230 -                }
  45.231 -
  45.232 -                // Print  method attribute information.
  45.233 -                if (env.showallAttr){
  45.234 -                    printMethodAttributes(methods[m]);
  45.235 -                }
  45.236 -            }
  45.237 -        }
  45.238 -    }
  45.239 -
  45.240 -    /**
  45.241 -     * Print method signature.
  45.242 -     */
  45.243 -    public void printMethodSignature(MethodData method, String[] accflags){
  45.244 -        printAccess(accflags);
  45.245 -
  45.246 -        if((method.getName()).equals("<init>")){
  45.247 -            out.print(javaclassname(cls.getClassName()));
  45.248 -            out.print(method.getParameters());
  45.249 -        }else if((method.getName()).equals("<clinit>")){
  45.250 -            out.print("{}");
  45.251 -        }else{
  45.252 -            out.print(method.getReturnType()+" ");
  45.253 -            out.print(method.getName());
  45.254 -            out.print(method.getParameters());
  45.255 -        }
  45.256 -    }
  45.257 -
  45.258 -    /**
  45.259 -     * print method attribute information.
  45.260 -     */
  45.261 -    public void printMethodAttributes(MethodData method){
  45.262 -        Vector<?> methodattrs = method.getAttributes();
  45.263 -        Vector<?> codeattrs =  method.getCodeAttributes();
  45.264 -        for(int k = 0; k < methodattrs.size(); k++){
  45.265 -            String methodattrname = ((AttrData)methodattrs.elementAt(k)).getAttrName();
  45.266 -            if(methodattrname.equals("Code")){
  45.267 -                printcodeSequence(method);
  45.268 -                printExceptionTable(method);
  45.269 -                for(int c = 0; c < codeattrs.size(); c++){
  45.270 -                    String codeattrname = ((AttrData)codeattrs.elementAt(c)).getAttrName();
  45.271 -                    if(codeattrname.equals("LineNumberTable")){
  45.272 -                        printLineNumTable(method);
  45.273 -                    }else if(codeattrname.equals("LocalVariableTable")){
  45.274 -                        printLocVarTable(method);
  45.275 -                    }else if(codeattrname.equals("StackMapTable")) {
  45.276 -                        // Java SE JSR 202 stack map tables
  45.277 -                        printStackMapTable(method);
  45.278 -                    }else if(codeattrname.equals("StackMap")) {
  45.279 -                        // Java ME CLDC stack maps
  45.280 -                        printStackMap(method);
  45.281 -                    } else {
  45.282 -                        printAttrData((AttrData)codeattrs.elementAt(c));
  45.283 -                    }
  45.284 -                }
  45.285 -            }else if(methodattrname.equals("Exceptions")){
  45.286 -                out.println("  Exceptions: ");
  45.287 -                printExceptions(method);
  45.288 -            }else if (methodattrname.equals("Deprecated")){
  45.289 -                out.println("  Deprecated: "+ method.isDeprecated());
  45.290 -            }else if (methodattrname.equals("Synthetic")){
  45.291 -                out.println("  Synthetic: "+ method.isSynthetic());
  45.292 -            }else {
  45.293 -                printAttrData((AttrData)methodattrs.elementAt(k));
  45.294 -            }
  45.295 -        }
  45.296 -        out.println();
  45.297 -    }
  45.298 -
  45.299 -    /**
  45.300 -     * Print exceptions.
  45.301 -     */
  45.302 -    public void printExceptions(MethodData method){
  45.303 -        int []exc_index_table = method.get_exc_index_table();
  45.304 -        if (exc_index_table != null) {
  45.305 -            if(!(env. showLineAndLocal || env.showDisassembled || env.showVerbose
  45.306 -                 ||  env.showInternalSigs || env.showallAttr)){
  45.307 -                out.print("    ");
  45.308 -            }
  45.309 -            out.print("   throws ");
  45.310 -            int k;
  45.311 -            int l = exc_index_table.length;
  45.312 -
  45.313 -            for (k=0; k<l; k++) {
  45.314 -                out.print(javaclassname(cls.getClassName(exc_index_table[k])));
  45.315 -                if (k<l-1) out.print(", ");
  45.316 -            }
  45.317 -        }
  45.318 -    }
  45.319 -
  45.320 -    /**
  45.321 -     * Print code sequence.
  45.322 -     */
  45.323 -    public void  printcodeSequence(MethodData method){
  45.324 -        code = method.getCode();
  45.325 -        if(code != null){
  45.326 -            out.println("  Code:");
  45.327 -            if(env.showVerbose){
  45.328 -                printVerboseHeader(method);
  45.329 -            }
  45.330 -
  45.331 -            for (int pc=0; pc < code.length; ) {
  45.332 -                out.print("   "+pc+":\t");
  45.333 -                pc=pc+printInstr(pc);
  45.334 -                out.println();
  45.335 -            }
  45.336 -        }
  45.337 -    }
  45.338 -
  45.339 -    /**
  45.340 -     * Print instructions.
  45.341 -     */
  45.342 -    public int printInstr(int pc){
  45.343 -        int opcode = getUbyte(pc);
  45.344 -        int opcode2;
  45.345 -        String mnem;
  45.346 -        switch (opcode) {
  45.347 -        case opc_nonpriv:
  45.348 -        case opc_priv:
  45.349 -            opcode2 = getUbyte(pc+1);
  45.350 -            mnem=Tables.opcName((opcode<<8)+opcode2);
  45.351 -            if (mnem==null)
  45.352 -                // assume all (even nonexistent) priv and nonpriv instructions
  45.353 -                // are 2 bytes long
  45.354 -                mnem=Tables.opcName(opcode)+" "+opcode2;
  45.355 -            out.print(mnem);
  45.356 -            return 2;
  45.357 -        case opc_wide: {
  45.358 -            opcode2 = getUbyte(pc+1);
  45.359 -            mnem=Tables.opcName((opcode<<8)+opcode2);
  45.360 -            if (mnem==null) {
  45.361 -                // nonexistent opcode - but we have to print something
  45.362 -                out.print("bytecode "+opcode);
  45.363 -                return 1;
  45.364 -            }
  45.365 -            out.print(mnem+" "+getUShort(pc+2));
  45.366 -            if (opcode2==opc_iinc) {
  45.367 -                out.print(", "+getShort(pc+4));
  45.368 -                return 6;
  45.369 -            }
  45.370 -            return 4;
  45.371 -        }
  45.372 -        }
  45.373 -        mnem=Tables.opcName(opcode);
  45.374 -        if (mnem==null) {
  45.375 -            // nonexistent opcode - but we have to print something
  45.376 -            out.print("bytecode "+opcode);
  45.377 -            return 1;
  45.378 -        }
  45.379 -        if (opcode>opc_jsr_w) {
  45.380 -            // pseudo opcodes should be printed as bytecodes
  45.381 -            out.print("bytecode "+opcode);
  45.382 -            return 1;
  45.383 -        }
  45.384 -        out.print(Tables.opcName(opcode));
  45.385 -        switch (opcode) {
  45.386 -        case opc_aload: case opc_astore:
  45.387 -        case opc_fload: case opc_fstore:
  45.388 -        case opc_iload: case opc_istore:
  45.389 -        case opc_lload: case opc_lstore:
  45.390 -        case opc_dload: case opc_dstore:
  45.391 -        case opc_ret:
  45.392 -            out.print("\t"+getUbyte(pc+1));
  45.393 -            return  2;
  45.394 -        case opc_iinc:
  45.395 -            out.print("\t"+getUbyte(pc+1)+", "+getbyte(pc+2));
  45.396 -            return  3;
  45.397 -        case opc_tableswitch:{
  45.398 -            int tb=align(pc+1);
  45.399 -            int default_skip = getInt(tb); /* default skip pamount */
  45.400 -            int low = getInt(tb+4);
  45.401 -            int high = getInt(tb+8);
  45.402 -            int count = high - low;
  45.403 -            out.print("{ //"+low+" to "+high);
  45.404 -            for (int i = 0; i <= count; i++)
  45.405 -                out.print( "\n\t\t" + (i+low) + ": "+lP+(pc+getInt(tb+12+4*i))+";");
  45.406 -            out.print("\n\t\tdefault: "+lP+(default_skip + pc) + " }");
  45.407 -            return tb-pc+16+count*4;
  45.408 -        }
  45.409 -
  45.410 -        case opc_lookupswitch:{
  45.411 -            int tb=align(pc+1);
  45.412 -            int default_skip = getInt(tb);
  45.413 -            int npairs = getInt(tb+4);
  45.414 -            out.print("{ //"+npairs);
  45.415 -            for (int i = 1; i <= npairs; i++)
  45.416 -                out.print("\n\t\t"+getInt(tb+i*8)
  45.417 -                                 +": "+lP+(pc+getInt(tb+4+i*8))+";"
  45.418 -                                 );
  45.419 -            out.print("\n\t\tdefault: "+lP+(default_skip + pc) + " }");
  45.420 -            return tb-pc+(npairs+1)*8;
  45.421 -        }
  45.422 -        case opc_newarray:
  45.423 -            int type=getUbyte(pc+1);
  45.424 -            switch (type) {
  45.425 -            case T_BOOLEAN:out.print(" boolean");break;
  45.426 -            case T_BYTE:   out.print(" byte");   break;
  45.427 -            case T_CHAR:   out.print(" char");   break;
  45.428 -            case T_SHORT:  out.print(" short");  break;
  45.429 -            case T_INT:    out.print(" int");    break;
  45.430 -            case T_LONG:   out.print(" long");   break;
  45.431 -            case T_FLOAT:  out.print(" float");  break;
  45.432 -            case T_DOUBLE: out.print(" double"); break;
  45.433 -            case T_CLASS:  out.print(" class"); break;
  45.434 -            default:       out.print(" BOGUS TYPE:"+type);
  45.435 -            }
  45.436 -            return 2;
  45.437 -
  45.438 -        case opc_anewarray: {
  45.439 -            int index =  getUShort(pc+1);
  45.440 -            out.print("\t#"+index+"; //");
  45.441 -            PrintConstant(index);
  45.442 -            return 3;
  45.443 -        }
  45.444 -
  45.445 -        case opc_sipush:
  45.446 -            out.print("\t"+getShort(pc+1));
  45.447 -            return 3;
  45.448 -
  45.449 -        case opc_bipush:
  45.450 -            out.print("\t"+getbyte(pc+1));
  45.451 -            return 2;
  45.452 -
  45.453 -        case opc_ldc: {
  45.454 -            int index = getUbyte(pc+1);
  45.455 -            out.print("\t#"+index+"; //");
  45.456 -            PrintConstant(index);
  45.457 -            return 2;
  45.458 -        }
  45.459 -
  45.460 -        case opc_ldc_w: case opc_ldc2_w:
  45.461 -        case opc_instanceof: case opc_checkcast:
  45.462 -        case opc_new:
  45.463 -        case opc_putstatic: case opc_getstatic:
  45.464 -        case opc_putfield: case opc_getfield:
  45.465 -        case opc_invokevirtual:
  45.466 -        case opc_invokespecial:
  45.467 -        case opc_invokestatic: {
  45.468 -            int index = getUShort(pc+1);
  45.469 -            out.print("\t#"+index+"; //");
  45.470 -            PrintConstant(index);
  45.471 -            return 3;
  45.472 -        }
  45.473 -
  45.474 -        case opc_invokeinterface: {
  45.475 -            int index = getUShort(pc+1), nargs=getUbyte(pc+3);
  45.476 -            out.print("\t#"+index+",  "+nargs+"; //");
  45.477 -            PrintConstant(index);
  45.478 -            return 5;
  45.479 -        }
  45.480 -
  45.481 -        case opc_invokedynamic: {
  45.482 -            int index = getUShort(pc+1);
  45.483 -            out.print("\t#"+index+"; //");
  45.484 -            PrintConstant(index);
  45.485 -            return 5;
  45.486 -        }
  45.487 -
  45.488 -        case opc_multianewarray: {
  45.489 -            int index = getUShort(pc+1), dimensions=getUbyte(pc+3);
  45.490 -            out.print("\t#"+index+",  "+dimensions+"; //");
  45.491 -            PrintConstant(index);
  45.492 -            return 4;
  45.493 -        }
  45.494 -        case opc_jsr: case opc_goto:
  45.495 -        case opc_ifeq: case opc_ifge: case opc_ifgt:
  45.496 -        case opc_ifle: case opc_iflt: case opc_ifne:
  45.497 -        case opc_if_icmpeq: case opc_if_icmpne: case opc_if_icmpge:
  45.498 -        case opc_if_icmpgt: case opc_if_icmple: case opc_if_icmplt:
  45.499 -        case opc_if_acmpeq: case opc_if_acmpne:
  45.500 -        case opc_ifnull: case opc_ifnonnull:
  45.501 -            out.print("\t"+lP+(pc + getShort(pc+1)) );
  45.502 -            return 3;
  45.503 -
  45.504 -        case opc_jsr_w:
  45.505 -        case opc_goto_w:
  45.506 -            out.print("\t"+lP+(pc + getInt(pc+1)));
  45.507 -            return 5;
  45.508 -
  45.509 -        default:
  45.510 -            return 1;
  45.511 -        }
  45.512 -    }
  45.513 -    /**
  45.514 -     * Print code attribute details.
  45.515 -     */
  45.516 -    public void printVerboseHeader(MethodData method) {
  45.517 -        int argCount = method.getArgumentlength();
  45.518 -        if (!method.isStatic())
  45.519 -            ++argCount;  // for 'this'
  45.520 -
  45.521 -        out.println("   Stack=" + method.getMaxStack()
  45.522 -                           + ", Locals=" + method.getMaxLocals()
  45.523 -                           + ", Args_size=" + argCount);
  45.524 -
  45.525 -    }
  45.526 -
  45.527 -
  45.528 -    /**
  45.529 -     * Print the exception table for this method code
  45.530 -     */
  45.531 -    void printExceptionTable(MethodData method){//throws IOException
  45.532 -        Vector<?> exception_table = method.getexception_table();
  45.533 -        if (exception_table.size() > 0) {
  45.534 -            out.println("  Exception table:");
  45.535 -            out.println("   from   to  target type");
  45.536 -            for (int idx = 0; idx < exception_table.size(); ++idx) {
  45.537 -                TrapData handler = (TrapData)exception_table.elementAt(idx);
  45.538 -                printFixedWidthInt(handler.start_pc, 6);
  45.539 -                printFixedWidthInt(handler.end_pc, 6);
  45.540 -                printFixedWidthInt(handler.handler_pc, 6);
  45.541 -                out.print("   ");
  45.542 -                int catch_cpx = handler.catch_cpx;
  45.543 -                if (catch_cpx == 0) {
  45.544 -                    out.println("any");
  45.545 -                }else {
  45.546 -                    out.print("Class ");
  45.547 -                    out.println(cls.getClassName(catch_cpx));
  45.548 -                    out.println("");
  45.549 -                }
  45.550 -            }
  45.551 -        }
  45.552 -    }
  45.553 -
  45.554 -    /**
  45.555 -     * Print LineNumberTable attribute information.
  45.556 -     */
  45.557 -    public void printLineNumTable(MethodData method) {
  45.558 -        int numlines = method.getnumlines();
  45.559 -        Vector<?> lin_num_tb = method.getlin_num_tb();
  45.560 -        if( lin_num_tb.size() > 0){
  45.561 -            out.println("  LineNumberTable: ");
  45.562 -            for (int i=0; i<numlines; i++) {
  45.563 -                LineNumData linnumtb_entry=(LineNumData)lin_num_tb.elementAt(i);
  45.564 -                out.println("   line " + linnumtb_entry.line_number + ": "
  45.565 -                               + linnumtb_entry.start_pc);
  45.566 -            }
  45.567 -        }
  45.568 -        out.println();
  45.569 -    }
  45.570 -
  45.571 -    /**
  45.572 -     * Print LocalVariableTable attribute information.
  45.573 -     */
  45.574 -    public void printLocVarTable(MethodData method){
  45.575 -        int siz = method.getloc_var_tbsize();
  45.576 -        if(siz > 0){
  45.577 -            out.println("  LocalVariableTable: ");
  45.578 -            out.print("   ");
  45.579 -            out.println("Start  Length  Slot  Name   Signature");
  45.580 -        }
  45.581 -        Vector<?> loc_var_tb = method.getloc_var_tb();
  45.582 -
  45.583 -        for (int i=0; i<siz; i++) {
  45.584 -            LocVarData entry=(LocVarData)loc_var_tb.elementAt(i);
  45.585 -
  45.586 -            out.println("   "+entry.start_pc+"      "+entry.length+"      "+
  45.587 -                               entry.slot+"    "+cls.StringValue(entry.name_cpx)  +
  45.588 -                               "       "+cls.StringValue(entry.sig_cpx));
  45.589 -        }
  45.590 -        out.println();
  45.591 -    }
  45.592 -
  45.593 -    /**
  45.594 -     * Print StackMap attribute information.
  45.595 -     */
  45.596 -    public void printStackMap(MethodData method) {
  45.597 -        StackMapData[] stack_map_tb = method.getStackMap();
  45.598 -        int number_of_entries = stack_map_tb.length;
  45.599 -        if (number_of_entries > 0) {
  45.600 -            out.println("  StackMap: number_of_entries = " + number_of_entries);
  45.601 -
  45.602 -            for (StackMapData frame : stack_map_tb) {
  45.603 -                frame.print(this);
  45.604 -            }
  45.605 -        }
  45.606 -       out.println();
  45.607 -    }
  45.608 -
  45.609 -    /**
  45.610 -     * Print StackMapTable attribute information.
  45.611 -     */
  45.612 -    public void printStackMapTable(MethodData method) {
  45.613 -        StackMapTableData[] stack_map_tb = method.getStackMapTable();
  45.614 -        int number_of_entries = stack_map_tb.length;
  45.615 -        if (number_of_entries > 0) {
  45.616 -            out.println("  StackMapTable: number_of_entries = " + number_of_entries);
  45.617 -
  45.618 -            for (StackMapTableData frame : stack_map_tb) {
  45.619 -                frame.print(this);
  45.620 -            }
  45.621 -        }
  45.622 -        out.println();
  45.623 -    }
  45.624 -
  45.625 -    void printMap(String name, int[] map) {
  45.626 -        out.print(name);
  45.627 -        for (int i=0; i<map.length; i++) {
  45.628 -            int fulltype = map[i];
  45.629 -            int type = fulltype & 0xFF;
  45.630 -            int argument = fulltype >> 8;
  45.631 -            switch (type) {
  45.632 -                case ITEM_Object:
  45.633 -                    out.print(" ");
  45.634 -                    PrintConstant(argument);
  45.635 -                    break;
  45.636 -                case ITEM_NewObject:
  45.637 -                    out.print(" " + Tables.mapTypeName(type));
  45.638 -                    out.print(" " + argument);
  45.639 -                    break;
  45.640 -                default:
  45.641 -                    out.print(" " + Tables.mapTypeName(type));
  45.642 -            }
  45.643 -            out.print( (i==(map.length-1)? ' ' : ','));
  45.644 -        }
  45.645 -        out.println("]");
  45.646 -    }
  45.647 -
  45.648 -    /**
  45.649 -     * Print ConstantValue attribute information.
  45.650 -     */
  45.651 -    public void printConstantValue(FieldData field){
  45.652 -        out.print("  Constant value: ");
  45.653 -        int cpx = (field.getConstantValueIndex());
  45.654 -        byte tag=0;
  45.655 -        try {
  45.656 -            tag=cls.getTag(cpx);
  45.657 -
  45.658 -        } catch (IndexOutOfBoundsException e) {
  45.659 -            out.print("Error:");
  45.660 -            return;
  45.661 -        }
  45.662 -        switch (tag) {
  45.663 -        case CONSTANT_METHOD:
  45.664 -        case CONSTANT_INTERFACEMETHOD:
  45.665 -        case CONSTANT_FIELD: {
  45.666 -            CPX2 x = cls.getCpoolEntry(cpx);
  45.667 -            if (x.cpx1 == cls.getthis_cpx()) {
  45.668 -                // don't print class part for local references
  45.669 -                cpx=x.cpx2;
  45.670 -            }
  45.671 -        }
  45.672 -        }
  45.673 -        out.print(cls.TagString(tag)+" "+ cls.StringValue(cpx));
  45.674 -    }
  45.675 -
  45.676 -    /**
  45.677 -     * Print InnerClass attribute information.
  45.678 -     */
  45.679 -    public void printInnerClasses(){//throws ioexception
  45.680 -
  45.681 -        InnerClassData[] innerClasses = cls.getInnerClasses();
  45.682 -        if(innerClasses != null){
  45.683 -            if(innerClasses.length > 0){
  45.684 -                out.print("  ");
  45.685 -                out.println("InnerClass: ");
  45.686 -                for(int i = 0 ; i < innerClasses.length; i++){
  45.687 -                    out.print("   ");
  45.688 -                    //access
  45.689 -                    String[] accflags = innerClasses[i].getAccess();
  45.690 -                    if(checkAccess(accflags)){
  45.691 -                        printAccess(accflags);
  45.692 -                        if (innerClasses[i].inner_name_index!=0) {
  45.693 -                            out.print("#"+innerClasses[i].inner_name_index+"= ");
  45.694 -                        }
  45.695 -                        out.print("#"+innerClasses[i].inner_class_info_index);
  45.696 -                        if (innerClasses[i].outer_class_info_index!=0) {
  45.697 -                            out.print(" of #"+innerClasses[i].outer_class_info_index);
  45.698 -                        }
  45.699 -                        out.print("; //");
  45.700 -                        if (innerClasses[i].inner_name_index!=0) {
  45.701 -                            out.print(cls.getName(innerClasses[i].inner_name_index)+"=");
  45.702 -                        }
  45.703 -                        PrintConstant(innerClasses[i].inner_class_info_index);
  45.704 -                        if (innerClasses[i].outer_class_info_index!=0) {
  45.705 -                            out.print(" of ");
  45.706 -                            PrintConstant(innerClasses[i].outer_class_info_index);
  45.707 -                        }
  45.708 -                        out.println();
  45.709 -                    }
  45.710 -                }
  45.711 -
  45.712 -            }
  45.713 -        }
  45.714 -    }
  45.715 -
  45.716 -    /**
  45.717 -     * Print constant pool information.
  45.718 -     */
  45.719 -    public void printcp(){
  45.720 -        int cpx = 1 ;
  45.721 -
  45.722 -        while (cpx < cls.getCpoolCount()) {
  45.723 -            out.print("const #"+cpx+" = ");
  45.724 -            cpx+=PrintlnConstantEntry(cpx);
  45.725 -        }
  45.726 -        out.println();
  45.727 -    }
  45.728 -
  45.729 -    /**
  45.730 -     * Print constant pool entry information.
  45.731 -     */
  45.732 -    @SuppressWarnings("fallthrough")
  45.733 -    public int PrintlnConstantEntry(int cpx) {
  45.734 -        int size=1;
  45.735 -        byte tag=0;
  45.736 -        try {
  45.737 -            tag=cls.getTag(cpx);
  45.738 -        } catch (IndexOutOfBoundsException e) {
  45.739 -            out.println("  <Incorrect CP index>");
  45.740 -            return 1;
  45.741 -        }
  45.742 -        out.print(cls.StringTag(cpx)+"\t");
  45.743 -        Object x=cls.getCpoolEntryobj(cpx);
  45.744 -        if (x==null) {
  45.745 -            switch (tag) {
  45.746 -            case CONSTANT_LONG:
  45.747 -            case CONSTANT_DOUBLE:
  45.748 -                size=2;
  45.749 -            }
  45.750 -            out.println("null;");
  45.751 -            return size;
  45.752 -        }
  45.753 -        String str=cls.StringValue(cpx);
  45.754 -
  45.755 -        switch (tag) {
  45.756 -        case CONSTANT_CLASS:
  45.757 -        case CONSTANT_STRING:
  45.758 -            out.println("#"+(((CPX)x).cpx)+";\t//  "+str);
  45.759 -            break;
  45.760 -        case CONSTANT_FIELD:
  45.761 -        case CONSTANT_METHOD:
  45.762 -        case CONSTANT_INTERFACEMETHOD:
  45.763 -            out.println("#"+((CPX2)x).cpx1+".#"+((CPX2)x).cpx2+";\t//  "+str);
  45.764 -            break;
  45.765 -        case CONSTANT_NAMEANDTYPE:
  45.766 -            out.println("#"+((CPX2)x).cpx1+":#"+((CPX2)x).cpx2+";//  "+str);
  45.767 -            break;
  45.768 -        case CONSTANT_LONG:
  45.769 -        case CONSTANT_DOUBLE:
  45.770 -            size=2;
  45.771 -            // fall through
  45.772 -        default:
  45.773 -            out.println(str+";");
  45.774 -        }
  45.775 -        return size;
  45.776 -    }
  45.777 -
  45.778 -    /**
  45.779 -     * Checks access of class, field or method.
  45.780 -     */
  45.781 -    public boolean checkAccess(String accflags[]){
  45.782 -
  45.783 -        boolean ispublic = false;
  45.784 -        boolean isprotected = false;
  45.785 -        boolean isprivate = false;
  45.786 -        boolean ispackage = false;
  45.787 -
  45.788 -        for(int i= 0; i < accflags.length; i++){
  45.789 -            if(accflags[i].equals("public")) ispublic = true;
  45.790 -            else if (accflags[i].equals("protected")) isprotected = true;
  45.791 -            else if (accflags[i].equals("private")) isprivate = true;
  45.792 -        }
  45.793 -
  45.794 -        if(!(ispublic || isprotected || isprivate)) ispackage = true;
  45.795 -
  45.796 -        if((env.showAccess == env.PUBLIC) && (isprotected || isprivate || ispackage)) return false;
  45.797 -        else if((env.showAccess == env.PROTECTED) && (isprivate || ispackage)) return false;
  45.798 -        else if((env.showAccess == env.PACKAGE) && (isprivate)) return false;
  45.799 -        else return true;
  45.800 -    }
  45.801 -
  45.802 -    /**
  45.803 -     * Prints access of class, field or method.
  45.804 -     */
  45.805 -    public void printAccess(String []accflags){
  45.806 -        for(int j = 0; j < accflags.length; j++){
  45.807 -            out.print(accflags[j]+" ");
  45.808 -        }
  45.809 -    }
  45.810 -
  45.811 -    /**
  45.812 -     * Print an integer so that it takes 'length' characters in
  45.813 -     * the output.  Temporary until formatting code is stable.
  45.814 -     */
  45.815 -    public void printFixedWidthInt(long x, int length) {
  45.816 -        CharArrayWriter baStream = new CharArrayWriter();
  45.817 -        PrintWriter pStream = new PrintWriter(baStream);
  45.818 -        pStream.print(x);
  45.819 -        String str = baStream.toString();
  45.820 -        for (int cnt = length - str.length(); cnt > 0; --cnt)
  45.821 -            out.print(' ');
  45.822 -        out.print(str);
  45.823 -    }
  45.824 -
  45.825 -    protected int getbyte (int pc) {
  45.826 -        return code[pc];
  45.827 -    }
  45.828 -
  45.829 -    protected int getUbyte (int pc) {
  45.830 -        return code[pc]&0xFF;
  45.831 -    }
  45.832 -
  45.833 -    int getShort (int pc) {
  45.834 -        return (code[pc]<<8) | (code[pc+1]&0xFF);
  45.835 -    }
  45.836 -
  45.837 -    int getUShort (int pc) {
  45.838 -        return ((code[pc]<<8) | (code[pc+1]&0xFF))&0xFFFF;
  45.839 -    }
  45.840 -
  45.841 -    protected int getInt (int pc) {
  45.842 -        return (getShort(pc)<<16) | (getShort(pc+2)&0xFFFF);
  45.843 -    }
  45.844 -
  45.845 -    /**
  45.846 -     * Print constant value at that index.
  45.847 -     */
  45.848 -    void PrintConstant(int cpx) {
  45.849 -        if (cpx==0) {
  45.850 -            out.print("#0");
  45.851 -            return;
  45.852 -        }
  45.853 -        byte tag=0;
  45.854 -        try {
  45.855 -            tag=cls.getTag(cpx);
  45.856 -
  45.857 -        } catch (IndexOutOfBoundsException e) {
  45.858 -            out.print("#"+cpx);
  45.859 -            return;
  45.860 -        }
  45.861 -        switch (tag) {
  45.862 -        case CONSTANT_METHOD:
  45.863 -        case CONSTANT_INTERFACEMETHOD:
  45.864 -        case CONSTANT_FIELD: {
  45.865 -            // CPX2 x=(CPX2)(cpool[cpx]);
  45.866 -            CPX2 x = cls.getCpoolEntry(cpx);
  45.867 -            if (x.cpx1 == cls.getthis_cpx()) {
  45.868 -                // don't print class part for local references
  45.869 -                cpx=x.cpx2;
  45.870 -            }
  45.871 -        }
  45.872 -        }
  45.873 -        out.print(cls.TagString(tag)+" "+ cls.StringValue(cpx));
  45.874 -    }
  45.875 -
  45.876 -    protected static int  align (int n) {
  45.877 -        return (n+3) & ~3 ;
  45.878 -    }
  45.879 -
  45.880 -    public void printend(){
  45.881 -        out.println("}");
  45.882 -        out.println();
  45.883 -    }
  45.884 -
  45.885 -    public String javaclassname(String name){
  45.886 -        return name.replace('/','.');
  45.887 -    }
  45.888 -
  45.889 -    /**
  45.890 -     * Print attribute data in hex.
  45.891 -     */
  45.892 -    public void printAttrData(AttrData attr){
  45.893 -        byte []data = attr.getData();
  45.894 -        int i = 0;
  45.895 -        int j = 0;
  45.896 -        out.print("  "+attr.getAttrName()+": ");
  45.897 -        out.println("length = " + cls.toHex(attr.datalen));
  45.898 -
  45.899 -        out.print("   ");
  45.900 -
  45.901 -
  45.902 -        while (i < data.length){
  45.903 -            String databytestring = cls.toHex(data[i]);
  45.904 -            if(databytestring.equals("0x")) out.print("00");
  45.905 -            else if(databytestring.substring(2).length() == 1){
  45.906 -                out.print("0"+databytestring.substring(2));
  45.907 -            } else{
  45.908 -                out.print(databytestring.substring(2));
  45.909 -            }
  45.910 -
  45.911 -             j++;
  45.912 -            if(j == 16) {
  45.913 -                out.println();
  45.914 -                out.print("   ");
  45.915 -                j = 0;
  45.916 -            }
  45.917 -            else out.print(" ");
  45.918 -            i++;
  45.919 -        }
  45.920 -        out.println();
  45.921 -    }
  45.922 -}
    46.1 --- a/src/share/classes/sun/tools/javap/LineNumData.java	Thu Jun 11 10:54:31 2009 -0700
    46.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    46.3 @@ -1,50 +0,0 @@
    46.4 -/*
    46.5 - * Copyright 2002 Sun Microsystems, Inc.  All Rights Reserved.
    46.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    46.7 - *
    46.8 - * This code is free software; you can redistribute it and/or modify it
    46.9 - * under the terms of the GNU General Public License version 2 only, as
   46.10 - * published by the Free Software Foundation.  Sun designates this
   46.11 - * particular file as subject to the "Classpath" exception as provided
   46.12 - * by Sun in the LICENSE file that accompanied this code.
   46.13 - *
   46.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
   46.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   46.16 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   46.17 - * version 2 for more details (a copy is included in the LICENSE file that
   46.18 - * accompanied this code).
   46.19 - *
   46.20 - * You should have received a copy of the GNU General Public License version
   46.21 - * 2 along with this work; if not, write to the Free Software Foundation,
   46.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   46.23 - *
   46.24 - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   46.25 - * CA 95054 USA or visit www.sun.com if you need additional information or
   46.26 - * have any questions.
   46.27 - */
   46.28 -
   46.29 -
   46.30 -package sun.tools.javap;
   46.31 -
   46.32 -import java.util.*;
   46.33 -import java.io.*;
   46.34 -
   46.35 -/**
   46.36 - * Strores LineNumberTable data information.
   46.37 - *
   46.38 - * @author  Sucheta Dambalkar (Adopted code from jdis)
   46.39 - */
   46.40 -class LineNumData {
   46.41 -    short start_pc, line_number;
   46.42 -
   46.43 -    public LineNumData() {}
   46.44 -
   46.45 -    /**
   46.46 -     * Read LineNumberTable attribute.
   46.47 -     */
   46.48 -    public LineNumData(DataInputStream in) throws IOException {
   46.49 -        start_pc = in.readShort();
   46.50 -        line_number=in.readShort();
   46.51 -
   46.52 -    }
   46.53 -}
    47.1 --- a/src/share/classes/sun/tools/javap/LocVarData.java	Thu Jun 11 10:54:31 2009 -0700
    47.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    47.3 @@ -1,54 +0,0 @@
    47.4 -/*
    47.5 - * Copyright 2002 Sun Microsystems, Inc.  All Rights Reserved.
    47.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    47.7 - *
    47.8 - * This code is free software; you can redistribute it and/or modify it
    47.9 - * under the terms of the GNU General Public License version 2 only, as
   47.10 - * published by the Free Software Foundation.  Sun designates this
   47.11 - * particular file as subject to the "Classpath" exception as provided
   47.12 - * by Sun in the LICENSE file that accompanied this code.
   47.13 - *
   47.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
   47.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   47.16 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   47.17 - * version 2 for more details (a copy is included in the LICENSE file that
   47.18 - * accompanied this code).
   47.19 - *
   47.20 - * You should have received a copy of the GNU General Public License version
   47.21 - * 2 along with this work; if not, write to the Free Software Foundation,
   47.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   47.23 - *
   47.24 - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   47.25 - * CA 95054 USA or visit www.sun.com if you need additional information or
   47.26 - * have any questions.
   47.27 - */
   47.28 -
   47.29 -
   47.30 -package sun.tools.javap;
   47.31 -
   47.32 -import java.util.*;
   47.33 -import java.io.*;
   47.34 -
   47.35 -/**
   47.36 - * Strores LocalVariableTable data information.
   47.37 - *
   47.38 - * @author  Sucheta Dambalkar (Adopted code from jdis)
   47.39 - */
   47.40 -class LocVarData {
   47.41 -    short start_pc, length, name_cpx, sig_cpx, slot;
   47.42 -
   47.43 -    public LocVarData() {
   47.44 -    }
   47.45 -
   47.46 -    /**
   47.47 -     * Read LocalVariableTable attribute.
   47.48 -     */
   47.49 -    public LocVarData(DataInputStream in) throws IOException {
   47.50 -        start_pc = in.readShort();
   47.51 -        length=in.readShort();
   47.52 -        name_cpx=in.readShort();
   47.53 -        sig_cpx=in.readShort();
   47.54 -        slot=in.readShort();
   47.55 -
   47.56 -    }
   47.57 -}
    48.1 --- a/src/share/classes/sun/tools/javap/Main.java	Thu Jun 11 10:54:31 2009 -0700
    48.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    48.3 @@ -1,224 +0,0 @@
    48.4 -/*
    48.5 - * Copyright 2002-2008 Sun Microsystems, Inc.  All Rights Reserved.
    48.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    48.7 - *
    48.8 - * This code is free software; you can redistribute it and/or modify it
    48.9 - * under the terms of the GNU General Public License version 2 only, as
   48.10 - * published by the Free Software Foundation.  Sun designates this
   48.11 - * particular file as subject to the "Classpath" exception as provided
   48.12 - * by Sun in the LICENSE file that accompanied this code.
   48.13 - *
   48.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
   48.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   48.16 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   48.17 - * version 2 for more details (a copy is included in the LICENSE file that
   48.18 - * accompanied this code).
   48.19 - *
   48.20 - * You should have received a copy of the GNU General Public License version
   48.21 - * 2 along with this work; if not, write to the Free Software Foundation,
   48.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   48.23 - *
   48.24 - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   48.25 - * CA 95054 USA or visit www.sun.com if you need additional information or
   48.26 - * have any questions.
   48.27 - */
   48.28 -
   48.29 -
   48.30 -
   48.31 -package sun.tools.javap;
   48.32 -
   48.33 -import java.util.*;
   48.34 -import java.io.*;
   48.35 -
   48.36 -/**
   48.37 - * Entry point for javap, class file disassembler.
   48.38 - *
   48.39 - * @author  Sucheta Dambalkar (Adopted code from old javap)
   48.40 - */
   48.41 -public class Main {
   48.42 -
   48.43 -    private Vector<String> classList = new Vector<String>();
   48.44 -    private PrintWriter out;
   48.45 -    JavapEnvironment env = new JavapEnvironment();
   48.46 -    private static boolean errorOccurred = false;
   48.47 -    private static final String progname = "javap";
   48.48 -
   48.49 -
   48.50 -    public Main(PrintWriter out){
   48.51 -        this.out = out;
   48.52 -    }
   48.53 -
   48.54 -    public static void main(String argv[]) {
   48.55 -        // unless first arg is -Xold, use new javap
   48.56 -        if (!(argv.length >= 1 && argv[0].equals("-Xold"))) {
   48.57 -            com.sun.tools.javap.Main.main(argv);
   48.58 -            return;
   48.59 -        }
   48.60 -
   48.61 -        entry(argv);
   48.62 -        if (errorOccurred) {
   48.63 -            System.exit(1);
   48.64 -        }
   48.65 -    }
   48.66 -
   48.67 -
   48.68 -    /**
   48.69 -     * Entry point for tool if you don't want System.exit() called.
   48.70 -     */
   48.71 -    public static void entry(String argv[]) {
   48.72 -        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
   48.73 -        try {
   48.74 -
   48.75 -            Main jpmain = new Main(out);
   48.76 -            jpmain.perform(argv);
   48.77 -
   48.78 -        } finally {
   48.79 -            out.close();
   48.80 -        }
   48.81 -    }
   48.82 -
   48.83 -    /**
   48.84 -     * Process the arguments and perform the desired action
   48.85 -     */
   48.86 -    private void perform(String argv[]) {
   48.87 -        if (parseArguments(argv)) {
   48.88 -            displayResults();
   48.89 -
   48.90 -        }
   48.91 -    }
   48.92 -
   48.93 -    private void error(String msg) {
   48.94 -        errorOccurred = true;
   48.95 -        System.err.println(msg);
   48.96 -        System.err.flush();
   48.97 -    }
   48.98 -
   48.99 -    /**
  48.100 -     * Print usage information
  48.101 -     */
  48.102 -    private void usage() {
  48.103 -        java.io.PrintStream out = System.out;
  48.104 -        out.println("Usage: " + progname + " <options> <classes>...");
  48.105 -        out.println();
  48.106 -        out.println("where options include:");
  48.107 -        out.println("   -c                        Disassemble the code");
  48.108 -        out.println("   -classpath <pathlist>     Specify where to find user class files");
  48.109 -        out.println("   -extdirs <dirs>           Override location of installed extensions");
  48.110 -        out.println("   -help                     Print this usage message");
  48.111 -        out.println("   -J<flag>                  Pass <flag> directly to the runtime system");
  48.112 -        out.println("   -l                        Print line number and local variable tables");
  48.113 -        out.println("   -public                   Show only public classes and members");
  48.114 -        out.println("   -protected                Show protected/public classes and members");
  48.115 -        out.println("   -package                  Show package/protected/public classes");
  48.116 -        out.println("                             and members (default)");
  48.117 -        out.println("   -private                  Show all classes and members");
  48.118 -        out.println("   -s                        Print internal type signatures");
  48.119 -        out.println("   -bootclasspath <pathlist> Override location of class files loaded");
  48.120 -        out.println("                             by the bootstrap class loader");
  48.121 -        out.println("   -verbose                  Print stack size, number of locals and args for methods");
  48.122 -        out.println("                             If verifying, print reasons for failure");
  48.123 -        out.println();
  48.124 -    }
  48.125 -
  48.126 -    /**
  48.127 -     * Parse the command line arguments.
  48.128 -     * Set flags, construct the class list and create environment.
  48.129 -     */
  48.130 -    private boolean parseArguments(String argv[]) {
  48.131 -        for (int i = 0 ; i < argv.length ; i++) {
  48.132 -            String arg = argv[i];
  48.133 -            if (arg.startsWith("-")) {
  48.134 -                if (arg.equals("-l")) {
  48.135 -                    env.showLineAndLocal = true;
  48.136 -                } else if (arg.equals("-private") || arg.equals("-p")) {
  48.137 -                    env.showAccess = env.PRIVATE;
  48.138 -                } else if (arg.equals("-package")) {
  48.139 -                    env.showAccess = env.PACKAGE;
  48.140 -                } else if (arg.equals("-protected")) {
  48.141 -                    env.showAccess = env.PROTECTED;
  48.142 -                } else if (arg.equals("-public")) {
  48.143 -                    env.showAccess = env.PUBLIC;
  48.144 -                } else if (arg.equals("-c")) {
  48.145 -                    env.showDisassembled = true;
  48.146 -                } else if (arg.equals("-s")) {
  48.147 -                    env.showInternalSigs = true;
  48.148 -                } else if (arg.equals("-verbose"))  {
  48.149 -                    env.showVerbose = true;
  48.150 -                } else if (arg.equals("-v")) {
  48.151 -                    env.showVerbose = true;
  48.152 -                } else if (arg.equals("-h")) {
  48.153 -                    error("-h is no longer available - use the 'javah' program");
  48.154 -                    return false;
  48.155 -                } else if (arg.equals("-verify")) {
  48.156 -                    error("-verify is no longer available - use 'java -verify'");
  48.157 -                    return false;
  48.158 -                } else if (arg.equals("-verify-verbose")) {
  48.159 -                    error("-verify is no longer available - use 'java -verify'");
  48.160 -                    return false;
  48.161 -                } else if (arg.equals("-help")) {
  48.162 -                    usage();
  48.163 -                    return false;
  48.164 -                } else if (arg.equals("-classpath")) {
  48.165 -                    if ((i + 1) < argv.length) {
  48.166 -                        env.classPathString = argv[++i];
  48.167 -                    } else {
  48.168 -                        error("-classpath requires argument");
  48.169 -                        usage();
  48.170 -                        return false;
  48.171 -                    }
  48.172 -                } else if (arg.equals("-bootclasspath")) {
  48.173 -                    if ((i + 1) < argv.length) {
  48.174 -                        env.bootClassPathString = argv[++i];
  48.175 -                    } else {
  48.176 -                        error("-bootclasspath requires argument");
  48.177 -                        usage();
  48.178 -                        return false;
  48.179 -                    }
  48.180 -                } else if (arg.equals("-extdirs")) {
  48.181 -                    if ((i + 1) < argv.length) {
  48.182 -                        env.extDirsString = argv[++i];
  48.183 -                    } else {
  48.184 -                        error("-extdirs requires argument");
  48.185 -                        usage();
  48.186 -                        return false;
  48.187 -                    }
  48.188 -                } else if (arg.equals("-all")) {
  48.189 -                    env.showallAttr = true;
  48.190 -                } else if (arg.equals("-Xold")) {
  48.191 -                    // ignore: this is old javap
  48.192 -                } else {
  48.193 -                    error("invalid flag: " + arg);
  48.194 -                    usage();
  48.195 -                    return false;
  48.196 -                }
  48.197 -            } else {
  48.198 -                classList.addElement(arg);
  48.199 -                env.nothingToDo = false;
  48.200 -            }
  48.201 -        }
  48.202 -        if (env.nothingToDo) {
  48.203 -            System.out.println("No classes were specified on the command line.  Try -help.");
  48.204 -            errorOccurred = true;
  48.205 -            return false;
  48.206 -        }
  48.207 -        return true;
  48.208 -    }
  48.209 -
  48.210 -    /**
  48.211 -     * Display results
  48.212 -     */
  48.213 -    private void displayResults() {
  48.214 -        for (int i = 0; i < classList.size() ; i++ ) {
  48.215 -            String Name = classList.elementAt(i);
  48.216 -            InputStream classin = env.getFileInputStream(Name);
  48.217 -
  48.218 -            try {
  48.219 -                JavapPrinter printer = new JavapPrinter(classin, out, env);
  48.220 -                printer.print();                // actual do display
  48.221 -
  48.222 -            } catch (IllegalArgumentException exc) {
  48.223 -                error(exc.getMessage());
  48.224 -            }
  48.225 -        }
  48.226 -    }
  48.227 -}
    49.1 --- a/src/share/classes/sun/tools/javap/MethodData.java	Thu Jun 11 10:54:31 2009 -0700
    49.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    49.3 @@ -1,416 +0,0 @@
    49.4 -/*
    49.5 - * Copyright 2002-2008 Sun Microsystems, Inc.  All Rights Reserved.
    49.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    49.7 - *
    49.8 - * This code is free software; you can redistribute it and/or modify it
    49.9 - * under the terms of the GNU General Public License version 2 only, as
   49.10 - * published by the Free Software Foundation.  Sun designates this
   49.11 - * particular file as subject to the "Classpath" exception as provided
   49.12 - * by Sun in the LICENSE file that accompanied this code.
   49.13 - *
   49.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
   49.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   49.16 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   49.17 - * version 2 for more details (a copy is included in the LICENSE file that
   49.18 - * accompanied this code).
   49.19 - *
   49.20 - * You should have received a copy of the GNU General Public License version
   49.21 - * 2 along with this work; if not, write to the Free Software Foundation,
   49.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   49.23 - *
   49.24 - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   49.25 - * CA 95054 USA or visit www.sun.com if you need additional information or
   49.26 - * have any questions.
   49.27 - */
   49.28 -
   49.29 -package sun.tools.javap;
   49.30 -
   49.31 -import java.util.*;
   49.32 -import java.io.*;
   49.33 -
   49.34 -import static sun.tools.javap.RuntimeConstants.*;
   49.35 -
   49.36 -/**
   49.37 - * Strores method data informastion.
   49.38 - *
   49.39 - * @author  Sucheta Dambalkar (Adopted code from jdis)
   49.40 - */
   49.41 -public class MethodData {
   49.42 -
   49.43 -    ClassData cls;
   49.44 -    int access;
   49.45 -    int name_index;
   49.46 -    int descriptor_index;
   49.47 -    int attributes_count;
   49.48 -    byte[] code;
   49.49 -    Vector<TrapData> exception_table = new Vector<TrapData>(0);
   49.50 -    Vector<LineNumData> lin_num_tb = new Vector<LineNumData>(0);
   49.51 -    Vector<LocVarData> loc_var_tb = new Vector<LocVarData>(0);
   49.52 -    StackMapTableData[] stackMapTable;
   49.53 -    StackMapData[] stackMap;
   49.54 -    int[] exc_index_table=null;
   49.55 -    Vector<AttrData> attrs=new Vector<AttrData>(0);
   49.56 -    Vector<AttrData> code_attrs=new Vector<AttrData>(0);
   49.57 -    int max_stack,  max_locals;
   49.58 -    boolean isSynthetic=false;
   49.59 -    boolean isDeprecated=false;
   49.60 -
   49.61 -    public MethodData(ClassData cls){
   49.62 -        this.cls=cls;
   49.63 -    }
   49.64 -
   49.65 -    /**
   49.66 -     * Read method info.
   49.67 -     */
   49.68 -    public void read(DataInputStream in) throws IOException {
   49.69 -        access = in.readUnsignedShort();
   49.70 -        name_index=in.readUnsignedShort();
   49.71 -        descriptor_index =in.readUnsignedShort();
   49.72 -        int attributes_count = in.readUnsignedShort();
   49.73 -        for (int i = 0; i < attributes_count; i++) {
   49.74 -            int attr_name_index=in.readUnsignedShort();
   49.75 -
   49.76 -        readAttr: {
   49.77 -                if (cls.getTag(attr_name_index)==CONSTANT_UTF8) {
   49.78 -                    String  attr_name=cls.getString(attr_name_index);
   49.79 -                    if ( attr_name.equals("Code")){
   49.80 -                        readCode (in);
   49.81 -                        AttrData attr=new AttrData(cls);
   49.82 -                        attr.read(attr_name_index);
   49.83 -                        attrs.addElement(attr);
   49.84 -                        break readAttr;
   49.85 -                    } else if ( attr_name.equals("Exceptions")){
   49.86 -                        readExceptions(in);
   49.87 -                        AttrData attr=new AttrData(cls);
   49.88 -                        attr.read(attr_name_index);
   49.89 -                        attrs.addElement(attr);
   49.90 -                        break readAttr;
   49.91 -                    } else if (attr_name.equals("Synthetic")){
   49.92 -                        if (in.readInt()!=0)
   49.93 -                            throw new ClassFormatError("invalid Synthetic attr length");
   49.94 -                        isSynthetic=true;
   49.95 -                        AttrData attr=new AttrData(cls);
   49.96 -                        attr.read(attr_name_index);
   49.97 -                        attrs.addElement(attr);
   49.98 -                        break readAttr;
   49.99 -                    } else if (attr_name.equals("Deprecated")){
  49.100 -                        if (in.readInt()!=0)
  49.101 -                            throw new ClassFormatError("invalid Synthetic attr length");
  49.102 -                        isDeprecated = true;
  49.103 -                        AttrData attr=new AttrData(cls);
  49.104 -                        attr.read(attr_name_index);
  49.105 -                        attrs.addElement(attr);
  49.106 -                        break readAttr;
  49.107 -                    }
  49.108 -                }
  49.109 -                AttrData attr=new AttrData(cls);
  49.110 -                attr.read(attr_name_index, in);
  49.111 -                attrs.addElement(attr);
  49.112 -            }
  49.113 -        }
  49.114 -    }
  49.115 -
  49.116 -    /**
  49.117 -     * Read code attribute info.
  49.118 -     */
  49.119 -    public void readCode(DataInputStream in) throws IOException {
  49.120 -
  49.121 -        int attr_length = in.readInt();
  49.122 -        max_stack=in.readUnsignedShort();
  49.123 -        max_locals=in.readUnsignedShort();
  49.124 -        int codelen=in.readInt();
  49.125 -
  49.126 -        code=new byte[codelen];
  49.127 -        int totalread = 0;
  49.128 -        while(totalread < codelen){
  49.129 -            totalread += in.read(code, totalread, codelen-totalread);
  49.130 -        }
  49.131 -        //      in.read(code, 0, codelen);
  49.132 -        int clen = 0;
  49.133 -        readExceptionTable(in);
  49.134 -        int code_attributes_count = in.readUnsignedShort();
  49.135 -
  49.136 -        for (int k = 0 ; k < code_attributes_count ; k++) {
  49.137 -            int table_name_index=in.readUnsignedShort();
  49.138 -            int table_name_tag=cls.getTag(table_name_index);
  49.139 -            AttrData attr=new AttrData(cls);
  49.140 -            if (table_name_tag==CONSTANT_UTF8) {
  49.141 -                String table_name_tstr=cls.getString(table_name_index);
  49.142 -                if (table_name_tstr.equals("LineNumberTable")) {
  49.143 -                    readLineNumTable(in);
  49.144 -                    attr.read(table_name_index);
  49.145 -                } else if (table_name_tstr.equals("LocalVariableTable")) {
  49.146 -                    readLocVarTable(in);
  49.147 -                    attr.read(table_name_index);
  49.148 -                } else if (table_name_tstr.equals("StackMapTable")) {
  49.149 -                    readStackMapTable(in);
  49.150 -                    attr.read(table_name_index);
  49.151 -                } else if (table_name_tstr.equals("StackMap")) {
  49.152 -                    readStackMap(in);
  49.153 -                    attr.read(table_name_index);
  49.154 -                } else {
  49.155 -                    attr.read(table_name_index, in);
  49.156 -                }
  49.157 -                code_attrs.addElement(attr);
  49.158 -                continue;
  49.159 -            }
  49.160 -
  49.161 -            attr.read(table_name_index, in);
  49.162 -            code_attrs.addElement(attr);
  49.163 -        }
  49.164 -    }
  49.165 -
  49.166 -    /**
  49.167 -     * Read exception table info.
  49.168 -     */
  49.169 -    void readExceptionTable (DataInputStream in) throws IOException {
  49.170 -        int exception_table_len=in.readUnsignedShort();
  49.171 -        exception_table=new Vector<TrapData>(exception_table_len);
  49.172 -        for (int l = 0; l < exception_table_len; l++) {
  49.173 -            exception_table.addElement(new TrapData(in, l));
  49.174 -        }
  49.175 -    }
  49.176 -
  49.177 -    /**
  49.178 -     * Read LineNumberTable attribute info.
  49.179 -     */
  49.180 -    void readLineNumTable (DataInputStream in) throws IOException {
  49.181 -        int attr_len = in.readInt(); // attr_length
  49.182 -        int lin_num_tb_len = in.readUnsignedShort();
  49.183 -        lin_num_tb=new Vector<LineNumData>(lin_num_tb_len);
  49.184 -        for (int l = 0; l < lin_num_tb_len; l++) {
  49.185 -            lin_num_tb.addElement(new LineNumData(in));
  49.186 -        }
  49.187 -    }
  49.188 -
  49.189 -    /**
  49.190 -     * Read LocalVariableTable attribute info.
  49.191 -     */
  49.192 -    void readLocVarTable (DataInputStream in) throws IOException {
  49.193 -        int attr_len=in.readInt(); // attr_length
  49.194 -        int loc_var_tb_len = in.readUnsignedShort();
  49.195 -        loc_var_tb = new Vector<LocVarData>(loc_var_tb_len);
  49.196 -        for (int l = 0; l < loc_var_tb_len; l++) {
  49.197 -            loc_var_tb.addElement(new LocVarData(in));
  49.198 -        }
  49.199 -    }
  49.200 -
  49.201 -    /**
  49.202 -     * Read Exception attribute info.
  49.203 -     */
  49.204 -    public void readExceptions(DataInputStream in) throws IOException {
  49.205 -        int attr_len=in.readInt(); // attr_length in prog
  49.206 -        int num_exceptions = in.readUnsignedShort();
  49.207 -        exc_index_table=new int[num_exceptions];
  49.208 -        for (int l = 0; l < num_exceptions; l++) {
  49.209 -            int exc=in.readShort();
  49.210 -            exc_index_table[l]=exc;
  49.211 -        }
  49.212 -    }
  49.213 -
  49.214 -    /**
  49.215 -     * Read StackMapTable attribute info.
  49.216 -     */
  49.217 -    void readStackMapTable(DataInputStream in) throws IOException {
  49.218 -        int attr_len = in.readInt();  //attr_length
  49.219 -        int stack_map_tb_len = in.readUnsignedShort();
  49.220 -        stackMapTable = new StackMapTableData[stack_map_tb_len];
  49.221 -        for (int i=0; i<stack_map_tb_len; i++) {
  49.222 -            stackMapTable[i] = StackMapTableData.getInstance(in, this);
  49.223 -        }
  49.224 -    }
  49.225 -
  49.226 -    /**
  49.227 -     * Read StackMap attribute info.
  49.228 -     */
  49.229 -    void readStackMap(DataInputStream in) throws IOException {
  49.230 -        int attr_len = in.readInt();  //attr_length
  49.231 -        int stack_map_len = in.readUnsignedShort();
  49.232 -        stackMap = new StackMapData[stack_map_len];
  49.233 -        for (int i = 0; i<stack_map_len; i++) {
  49.234 -            stackMap[i] = new StackMapData(in, this);
  49.235 -        }
  49.236 -    }
  49.237 -
  49.238 -    /**
  49.239 -     * Return access of the method.
  49.240 -     */
  49.241 -    public String[] getAccess(){
  49.242 -
  49.243 -        Vector<String> v = new Vector<String>();
  49.244 -        if ((access & ACC_PUBLIC)   !=0) v.addElement("public");
  49.245 -        if ((access & ACC_PRIVATE)   !=0) v.addElement("private");
  49.246 -        if ((access & ACC_PROTECTED)   !=0) v.addElement("protected");
  49.247 -        if ((access & ACC_STATIC)   !=0) v.addElement("static");
  49.248 -        if ((access & ACC_FINAL)    !=0) v.addElement("final");
  49.249 -        if ((access & ACC_SYNCHRONIZED) !=0) v.addElement("synchronized");
  49.250 -        if ((access & ACC_NATIVE) !=0) v.addElement("native");
  49.251 -        if ((access & ACC_ABSTRACT) !=0) v.addElement("abstract");
  49.252 -        if ((access & ACC_STRICT) !=0) v.addElement("strictfp");
  49.253 -
  49.254 -        String[] accflags = new String[v.size()];
  49.255 -        v.copyInto(accflags);
  49.256 -        return accflags;
  49.257 -    }
  49.258 -
  49.259 -    /**
  49.260 -     * Return name of the method.
  49.261 -     */
  49.262 -    public String getName(){
  49.263 -        return cls.getStringValue(name_index);
  49.264 -    }
  49.265 -
  49.266 -    /**
  49.267 -     * Return internal siganature of the method.
  49.268 -     */
  49.269 -    public String getInternalSig(){
  49.270 -        return cls.getStringValue(descriptor_index);
  49.271 -    }
  49.272 -
  49.273 -    /**
  49.274 -     * Return java return type signature of method.
  49.275 -     */
  49.276 -    public String getReturnType(){
  49.277 -
  49.278 -        String rttype = (new TypeSignature(getInternalSig())).getReturnType();
  49.279 -        return rttype;
  49.280 -    }
  49.281 -
  49.282 -    /**
  49.283 -     * Return java type parameter signature.
  49.284 -     */
  49.285 -    public String getParameters(){
  49.286 -        String ptype = (new TypeSignature(getInternalSig())).getParameters();
  49.287 -
  49.288 -        return ptype;
  49.289 -    }
  49.290 -
  49.291 -    /**
  49.292 -     * Return code attribute data of a method.
  49.293 -     */
  49.294 -    public byte[] getCode(){
  49.295 -        return code;
  49.296 -    }
  49.297 -
  49.298 -    /**
  49.299 -     * Return LineNumberTable size.
  49.300 -     */
  49.301 -    public int getnumlines(){
  49.302 -        return lin_num_tb.size();
  49.303 -    }
  49.304 -
  49.305 -    /**
  49.306 -     * Return LineNumberTable
  49.307 -     */
  49.308 -    public Vector<?> getlin_num_tb(){
  49.309 -        return lin_num_tb;
  49.310 -    }
  49.311 -
  49.312 -    /**
  49.313 -     * Return LocalVariableTable size.
  49.314 -     */
  49.315 -    public int getloc_var_tbsize(){
  49.316 -        return loc_var_tb.size();
  49.317 -    }
  49.318 -
  49.319 -
  49.320 -    /**
  49.321 -     * Return LocalVariableTable.
  49.322 -     */
  49.323 -    public Vector<?> getloc_var_tb(){
  49.324 -        return loc_var_tb;
  49.325 -    }
  49.326 -
  49.327 -    /**
  49.328 -     * Return StackMap.
  49.329 -     */
  49.330 -    public StackMapData[] getStackMap() {
  49.331 -        return stackMap;
  49.332 -    }
  49.333 -
  49.334 -    /**
  49.335 -     * Return StackMapTable.
  49.336 -     */
  49.337 -    public StackMapTableData[] getStackMapTable() {
  49.338 -        return stackMapTable;
  49.339 -    }
  49.340 -
  49.341 -    /**
  49.342 -     * Return number of arguments of that method.
  49.343 -     */
  49.344 -    public int getArgumentlength(){
  49.345 -        return new TypeSignature(getInternalSig()).getArgumentlength();
  49.346 -    }
  49.347 -
  49.348 -    /**
  49.349 -     * Return true if method is static
  49.350 -     */
  49.351 -    public boolean isStatic(){
  49.352 -        if ((access & ACC_STATIC)   !=0) return true;
  49.353 -        return false;
  49.354 -    }
  49.355 -
  49.356 -
  49.357 -    /**
  49.358 -     * Return max depth of operand stack.
  49.359 -     */
  49.360 -    public int getMaxStack(){
  49.361 -        return  max_stack;
  49.362 -    }
  49.363 -
  49.364 -
  49.365 -    /**
  49.366 -     * Return number of local variables.
  49.367 -     */
  49.368 -    public int getMaxLocals(){
  49.369 -        return max_locals;
  49.370 -    }
  49.371 -
  49.372 -
  49.373 -    /**
  49.374 -     * Return exception index table in Exception attribute.
  49.375 -     */
  49.376 -    public int []get_exc_index_table(){
  49.377 -        return  exc_index_table;
  49.378 -    }
  49.379 -
  49.380 -
  49.381 -    /**
  49.382 -     * Return exception table in code attributre.
  49.383 -     */
  49.384 -    public Vector<?> getexception_table(){
  49.385 -        return exception_table;
  49.386 -    }
  49.387 -
  49.388 -
  49.389 -    /**
  49.390 -     * Return method attributes.
  49.391 -     */
  49.392 -    public Vector<?> getAttributes(){
  49.393 -        return attrs;
  49.394 -    }
  49.395 -
  49.396 -
  49.397 -    /**
  49.398 -     * Return code attributes.
  49.399 -     */
  49.400 -    public Vector<?> getCodeAttributes(){
  49.401 -        return code_attrs;
  49.402 -    }
  49.403 -
  49.404 -
  49.405 -    /**
  49.406 -     * Return true if method id synthetic.
  49.407 -     */
  49.408 -    public boolean isSynthetic(){
  49.409 -        return isSynthetic;
  49.410 -    }
  49.411 -
  49.412 -
  49.413 -    /**
  49.414 -     * Return true if method is deprecated.
  49.415 -     */
  49.416 -    public boolean isDeprecated(){
  49.417 -        return isDeprecated;
  49.418 -    }
  49.419 -}
    50.1 --- a/src/share/classes/sun/tools/javap/RuntimeConstants.java	Thu Jun 11 10:54:31 2009 -0700
    50.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    50.3 @@ -1,787 +0,0 @@
    50.4 -/*
    50.5 - * Copyright 2002-2005 Sun Microsystems, Inc.  All Rights Reserved.
    50.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    50.7 - *
    50.8 - * This code is free software; you can redistribute it and/or modify it
    50.9 - * under the terms of the GNU General Public License version 2 only, as
   50.10 - * published by the Free Software Foundation.  Sun designates this
   50.11 - * particular file as subject to the "Classpath" exception as provided
   50.12 - * by Sun in the LICENSE file that accompanied this code.
   50.13 - *
   50.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
   50.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   50.16 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   50.17 - * version 2 for more details (a copy is included in the LICENSE file that
   50.18 - * accompanied this code).
   50.19 - *
   50.20 - * You should have received a copy of the GNU General Public License version
   50.21 - * 2 along with this work; if not, write to the Free Software Foundation,
   50.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   50.23 - *
   50.24 - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   50.25 - * CA 95054 USA or visit www.sun.com if you need additional information or
   50.26 - * have any questions.
   50.27 - */
   50.28 -
   50.29 -
   50.30 -package sun.tools.javap;
   50.31 -
   50.32 -public interface RuntimeConstants {
   50.33 -
   50.34 -    /* Signature Characters */
   50.35 -    public static final char   SIGC_VOID                  = 'V';
   50.36 -    public static final String SIG_VOID                   = "V";
   50.37 -    public static final char   SIGC_BOOLEAN               = 'Z';
   50.38 -    public static final String SIG_BOOLEAN                = "Z";
   50.39 -    public static final char   SIGC_BYTE                  = 'B';
   50.40 -    public static final String SIG_BYTE                   = "B";
   50.41 -    public static final char   SIGC_CHAR                  = 'C';
   50.42 -    public static final String SIG_CHAR                   = "C";
   50.43 -    public static final char   SIGC_SHORT                 = 'S';
   50.44 -    public static final String SIG_SHORT                  = "S";
   50.45 -    public static final char   SIGC_INT                   = 'I';
   50.46 -    public static final String SIG_INT                    = "I";
   50.47 -    public static final char   SIGC_LONG                  = 'J';
   50.48 -    public static final String SIG_LONG                   = "J";
   50.49 -    public static final char   SIGC_FLOAT                 = 'F';
   50.50 -    public static final String SIG_FLOAT                  = "F";
   50.51 -    public static final char   SIGC_DOUBLE                = 'D';
   50.52 -    public static final String SIG_DOUBLE                 = "D";
   50.53 -    public static final char   SIGC_ARRAY                 = '[';
   50.54 -    public static final String SIG_ARRAY                  = "[";
   50.55 -    public static final char   SIGC_CLASS                 = 'L';
   50.56 -    public static final String SIG_CLASS                  = "L";
   50.57 -    public static final char   SIGC_METHOD                = '(';
   50.58 -    public static final String SIG_METHOD                 = "(";
   50.59 -    public static final char   SIGC_ENDCLASS              = ';';
   50.60 -    public static final String SIG_ENDCLASS               = ";";
   50.61 -    public static final char   SIGC_ENDMETHOD             = ')';
   50.62 -    public static final String SIG_ENDMETHOD              = ")";
   50.63 -    public static final char   SIGC_PACKAGE               = '/';
   50.64 -    public static final String SIG_PACKAGE                = "/";
   50.65 -
   50.66 -    /* Class File Constants */
   50.67 -    public static final int JAVA_MAGIC                   = 0xcafebabe;
   50.68 -    public static final int JAVA_VERSION                 = 45;
   50.69 -    public static final int JAVA_MINOR_VERSION           = 3;
   50.70 -
   50.71 -    /* Constant table */
   50.72 -    public static final int CONSTANT_UTF8                = 1;
   50.73 -    public static final int CONSTANT_UNICODE             = 2;
   50.74 -    public static final int CONSTANT_INTEGER             = 3;
   50.75 -    public static final int CONSTANT_FLOAT               = 4;
   50.76 -    public static final int CONSTANT_LONG                = 5;
   50.77 -    public static final int CONSTANT_DOUBLE              = 6;
   50.78 -    public static final int CONSTANT_CLASS               = 7;
   50.79 -    public static final int CONSTANT_STRING              = 8;
   50.80 -    public static final int CONSTANT_FIELD               = 9;
   50.81 -    public static final int CONSTANT_METHOD              = 10;
   50.82 -    public static final int CONSTANT_INTERFACEMETHOD     = 11;
   50.83 -    public static final int CONSTANT_NAMEANDTYPE         = 12;
   50.84 -
   50.85 -    /* Access Flags */
   50.86 -    public static final int ACC_PUBLIC                   = 0x00000001;
   50.87 -    public static final int ACC_PRIVATE                  = 0x00000002;
   50.88 -    public static final int ACC_PROTECTED                = 0x00000004;
   50.89 -    public static final int ACC_STATIC                   = 0x00000008;
   50.90 -    public static final int ACC_FINAL                    = 0x00000010;
   50.91 -    public static final int ACC_SYNCHRONIZED             = 0x00000020;
   50.92 -    public static final int ACC_SUPER                        = 0x00000020;
   50.93 -    public static final int ACC_VOLATILE                 = 0x00000040;
   50.94 -    public static final int ACC_TRANSIENT                = 0x00000080;
   50.95 -    public static final int ACC_NATIVE                   = 0x00000100;
   50.96 -    public static final int ACC_INTERFACE                = 0x00000200;
   50.97 -    public static final int ACC_ABSTRACT                 = 0x00000400;
   50.98 -    public static final int ACC_STRICT                   = 0x00000800;
   50.99 -    public static final int ACC_EXPLICIT                 = 0x00001000;
  50.100 -    public static final int ACC_SYNTHETIC                = 0x00010000; // actually, this is an attribute
  50.101 -
  50.102 -    /* Type codes */
  50.103 -    public static final int T_CLASS                      = 0x00000002;
  50.104 -    public static final int T_BOOLEAN                    = 0x00000004;
  50.105 -    public static final int T_CHAR                       = 0x00000005;
  50.106 -    public static final int T_FLOAT                      = 0x00000006;
  50.107 -    public static final int T_DOUBLE                     = 0x00000007;
  50.108 -    public static final int T_BYTE                       = 0x00000008;
  50.109 -    public static final int T_SHORT                      = 0x00000009;
  50.110 -    public static final int T_INT                        = 0x0000000a;
  50.111 -    public static final int T_LONG                       = 0x0000000b;
  50.112 -
  50.113 -    /* Type codes for StackMap attribute */
  50.114 -    public static final int ITEM_Bogus      =0; // an unknown or uninitialized value
  50.115 -    public static final int ITEM_Integer    =1; // a 32-bit integer
  50.116 -    public static final int ITEM_Float      =2; // not used
  50.117 -    public static final int ITEM_Double     =3; // not used
  50.118 -    public static final int ITEM_Long       =4; // a 64-bit integer
  50.119 -    public static final int ITEM_Null       =5; // the type of null
  50.120 -    public static final int ITEM_InitObject =6; // "this" in constructor
  50.121 -    public static final int ITEM_Object     =7; // followed by 2-byte index of class name
  50.122 -    public static final int ITEM_NewObject  =8; // followed by 2-byte ref to "new"
  50.123 -
  50.124 -    /* Constants used in StackMapTable attribute */
  50.125 -    public static final int SAME_FRAME_BOUND                  = 64;
  50.126 -    public static final int SAME_LOCALS_1_STACK_ITEM_BOUND    = 128;
  50.127 -    public static final int SAME_LOCALS_1_STACK_ITEM_EXTENDED = 247;
  50.128 -    public static final int SAME_FRAME_EXTENDED               = 251;
  50.129 -    public static final int FULL_FRAME                        = 255;
  50.130 -
  50.131 -    /* Opcodes */
  50.132 -    public static final int opc_dead                     = -2;
  50.133 -    public static final int opc_label                    = -1;
  50.134 -    public static final int opc_nop                      = 0;
  50.135 -    public static final int opc_aconst_null              = 1;
  50.136 -    public static final int opc_iconst_m1                = 2;
  50.137 -    public static final int opc_iconst_0                 = 3;
  50.138 -    public static final int opc_iconst_1                 = 4;
  50.139 -    public static final int opc_iconst_2                 = 5;
  50.140 -    public static final int opc_iconst_3                 = 6;
  50.141 -    public static final int opc_iconst_4                 = 7;
  50.142 -    public static final int opc_iconst_5                 = 8;
  50.143 -    public static final int opc_lconst_0                 = 9;
  50.144 -    public static final int opc_lconst_1                 = 10;
  50.145 -    public static final int opc_fconst_0                 = 11;
  50.146 -    public static final int opc_fconst_1                 = 12;
  50.147 -    public static final int opc_fconst_2                 = 13;
  50.148 -    public static final int opc_dconst_0                 = 14;
  50.149 -    public static final int opc_dconst_1                 = 15;
  50.150 -    public static final int opc_bipush                   = 16;
  50.151 -    public static final int opc_sipush                   = 17;
  50.152 -    public static final int opc_ldc                      = 18;
  50.153 -    public static final int opc_ldc_w                    = 19;
  50.154 -    public static final int opc_ldc2_w                   = 20;
  50.155 -    public static final int opc_iload                    = 21;
  50.156 -    public static final int opc_lload                    = 22;
  50.157 -    public static final int opc_fload                    = 23;
  50.158 -    public static final int opc_dload                    = 24;
  50.159 -    public static final int opc_aload                    = 25;
  50.160 -    public static final int opc_iload_0                  = 26;
  50.161 -    public static final int opc_iload_1                  = 27;
  50.162 -    public static final int opc_iload_2                  = 28;
  50.163 -    public static final int opc_iload_3                  = 29;
  50.164 -    public static final int opc_lload_0                  = 30;
  50.165 -    public static final int opc_lload_1                  = 31;
  50.166 -    public static final int opc_lload_2                  = 32;
  50.167 -    public static final int opc_lload_3                  = 33;
  50.168 -    public static final int opc_fload_0                  = 34;
  50.169 -    public static final int opc_fload_1                  = 35;
  50.170 -    public static final int opc_fload_2                  = 36;
  50.171 -    public static final int opc_fload_3                  = 37;
  50.172 -    public static final int opc_dload_0                  = 38;
  50.173 -    public static final int opc_dload_1                  = 39;
  50.174 -    public static final int opc_dload_2                  = 40;
  50.175 -    public static final int opc_dload_3                  = 41;
  50.176 -    public static final int opc_aload_0                  = 42;
  50.177 -    public static final int opc_aload_1                  = 43;
  50.178 -    public static final int opc_aload_2                  = 44;
  50.179 -    public static final int opc_aload_3                  = 45;
  50.180 -    public static final int opc_iaload                   = 46;
  50.181 -    public static final int opc_laload                   = 47;
  50.182 -    public static final int opc_faload                   = 48;
  50.183 -    public static final int opc_daload                   = 49;
  50.184 -    public static final int opc_aaload                   = 50;
  50.185 -    public static final int opc_baload                   = 51;
  50.186 -    public static final int opc_caload                   = 52;
  50.187 -    public static final int opc_saload                   = 53;
  50.188 -    public static final int opc_istore                   = 54;
  50.189 -    public static final int opc_lstore                   = 55;
  50.190 -    public static final int opc_fstore                   = 56;
  50.191 -    public static final int opc_dstore                   = 57;
  50.192 -    public static final int opc_astore                   = 58;
  50.193 -    public static final int opc_istore_0                 = 59;
  50.194 -    public static final int opc_istore_1                 = 60;
  50.195 -    public static final int opc_istore_2                 = 61;
  50.196 -    public static final int opc_istore_3                 = 62;
  50.197 -    public static final int opc_lstore_0                 = 63;
  50.198 -    public static final int opc_lstore_1                 = 64;
  50.199 -    public static final int opc_lstore_2                 = 65;
  50.200 -    public static final int opc_lstore_3                 = 66;
  50.201 -    public static final int opc_fstore_0                 = 67;
  50.202 -    public static final int opc_fstore_1                 = 68;
  50.203 -    public static final int opc_fstore_2                 = 69;
  50.204 -    public static final int opc_fstore_3                 = 70;
  50.205 -    public static final int opc_dstore_0                 = 71;
  50.206 -    public static final int opc_dstore_1                 = 72;
  50.207 -    public static final int opc_dstore_2                 = 73;
  50.208 -    public static final int opc_dstore_3                 = 74;
  50.209 -    public static final int opc_astore_0                 = 75;
  50.210 -    public static final int opc_astore_1                 = 76;
  50.211 -    public static final int opc_astore_2                 = 77;
  50.212 -    public static final int opc_astore_3                 = 78;
  50.213 -    public static final int opc_iastore                  = 79;
  50.214 -    public static final int opc_lastore                  = 80;
  50.215 -    public static final int opc_fastore                  = 81;
  50.216 -    public static final int opc_dastore                  = 82;
  50.217 -    public static final int opc_aastore                  = 83;
  50.218 -    public static final int opc_bastore                  = 84;
  50.219 -    public static final int opc_castore                  = 85;
  50.220 -    public static final int opc_sastore                  = 86;
  50.221 -    public static final int opc_pop                      = 87;
  50.222 -    public static final int opc_pop2                     = 88;
  50.223 -    public static final int opc_dup                      = 89;
  50.224 -    public static final int opc_dup_x1                   = 90;
  50.225 -    public static final int opc_dup_x2                   = 91;
  50.226 -    public static final int opc_dup2                     = 92;
  50.227 -    public static final int opc_dup2_x1                  = 93;
  50.228 -    public static final int opc_dup2_x2                  = 94;
  50.229 -    public static final int opc_swap                     = 95;
  50.230 -    public static final int opc_iadd                     = 96;
  50.231 -    public static final int opc_ladd                     = 97;
  50.232 -    public static final int opc_fadd                     = 98;
  50.233 -    public static final int opc_dadd                     = 99;
  50.234 -    public static final int opc_isub                     = 100;
  50.235 -    public static final int opc_lsub                     = 101;
  50.236 -    public static final int opc_fsub                     = 102;
  50.237 -    public static final int opc_dsub                     = 103;
  50.238 -    public static final int opc_imul                     = 104;
  50.239 -    public static final int opc_lmul                     = 105;
  50.240 -    public static final int opc_fmul                     = 106;
  50.241 -    public static final int opc_dmul                     = 107;
  50.242 -    public static final int opc_idiv                     = 108;
  50.243 -    public static final int opc_ldiv                     = 109;
  50.244 -    public static final int opc_fdiv                     = 110;
  50.245 -    public static final int opc_ddiv                     = 111;
  50.246 -    public static final int opc_irem                     = 112;
  50.247 -    public static final int opc_lrem                     = 113;
  50.248 -    public static final int opc_frem                     = 114;
  50.249 -    public static final int opc_drem                     = 115;
  50.250 -    public static final int opc_ineg                     = 116;
  50.251 -    public static final int opc_lneg                     = 117;
  50.252 -    public static final int opc_fneg                     = 118;
  50.253 -    public static final int opc_dneg                     = 119;
  50.254 -    public static final int opc_ishl                     = 120;
  50.255 -    public static final int opc_lshl                     = 121;
  50.256 -    public static final int opc_ishr                     = 122;
  50.257 -    public static final int opc_lshr                     = 123;
  50.258 -    public static final int opc_iushr                    = 124;
  50.259 -    public static final int opc_lushr                    = 125;
  50.260 -    public static final int opc_iand                     = 126;
  50.261 -    public static final int opc_land                     = 127;
  50.262 -    public static final int opc_ior                      = 128;
  50.263 -    public static final int opc_lor                      = 129;
  50.264 -    public static final int opc_ixor                     = 130;
  50.265 -    public static final int opc_lxor                     = 131;
  50.266 -    public static final int opc_iinc                     = 132;
  50.267 -    public static final int opc_i2l                      = 133;
  50.268 -    public static final int opc_i2f                      = 134;
  50.269 -    public static final int opc_i2d                      = 135;
  50.270 -    public static final int opc_l2i                      = 136;
  50.271 -    public static final int opc_l2f                      = 137;
  50.272 -    public static final int opc_l2d                      = 138;
  50.273 -    public static final int opc_f2i                      = 139;
  50.274 -    public static final int opc_f2l                      = 140;
  50.275 -    public static final int opc_f2d                      = 141;
  50.276 -    public static final int opc_d2i                      = 142;
  50.277 -    public static final int opc_d2l                      = 143;
  50.278 -    public static final int opc_d2f                      = 144;
  50.279 -    public static final int opc_i2b                      = 145;
  50.280 -    public static final int opc_int2byte                 = 145;
  50.281 -    public static final int opc_i2c                      = 146;
  50.282 -    public static final int opc_int2char                 = 146;
  50.283 -    public static final int opc_i2s                      = 147;
  50.284 -    public static final int opc_int2short                = 147;
  50.285 -    public static final int opc_lcmp                     = 148;
  50.286 -    public static final int opc_fcmpl                    = 149;
  50.287 -    public static final int opc_fcmpg                    = 150;
  50.288 -    public static final int opc_dcmpl                    = 151;
  50.289 -    public static final int opc_dcmpg                    = 152;
  50.290 -    public static final int opc_ifeq                     = 153;
  50.291 -    public static final int opc_ifne                     = 154;
  50.292 -    public static final int opc_iflt                     = 155;
  50.293 -    public static final int opc_ifge                     = 156;
  50.294 -    public static final int opc_ifgt                     = 157;
  50.295 -    public static final int opc_ifle                     = 158;
  50.296 -    public static final int opc_if_icmpeq                = 159;
  50.297 -    public static final int opc_if_icmpne                = 160;
  50.298 -    public static final int opc_if_icmplt                = 161;
  50.299 -    public static final int opc_if_icmpge                = 162;
  50.300 -    public static final int opc_if_icmpgt                = 163;
  50.301 -    public static final int opc_if_icmple                = 164;
  50.302 -    public static final int opc_if_acmpeq                = 165;
  50.303 -    public static final int opc_if_acmpne                = 166;
  50.304 -    public static final int opc_goto                     = 167;
  50.305 -    public static final int opc_jsr                      = 168;
  50.306 -    public static final int opc_ret                      = 169;
  50.307 -    public static final int opc_tableswitch              = 170;
  50.308 -    public static final int opc_lookupswitch             = 171;
  50.309 -    public static final int opc_ireturn                  = 172;
  50.310 -    public static final int opc_lreturn                  = 173;
  50.311 -    public static final int opc_freturn                  = 174;
  50.312 -    public static final int opc_dreturn                  = 175;
  50.313 -    public static final int opc_areturn                  = 176;
  50.314 -    public static final int opc_return                   = 177;
  50.315 -    public static final int opc_getstatic                = 178;
  50.316 -    public static final int opc_putstatic                = 179;
  50.317 -    public static final int opc_getfield                 = 180;
  50.318 -    public static final int opc_putfield                 = 181;
  50.319 -    public static final int opc_invokevirtual            = 182;
  50.320 -    public static final int opc_invokenonvirtual         = 183;
  50.321 -    public static final int opc_invokespecial            = 183;
  50.322 -    public static final int opc_invokestatic             = 184;
  50.323 -    public static final int opc_invokeinterface          = 185;
  50.324 -    public static final int opc_invokedynamic            = 186;
  50.325 -    public static final int opc_new                      = 187;
  50.326 -    public static final int opc_newarray                 = 188;
  50.327 -    public static final int opc_anewarray                = 189;
  50.328 -    public static final int opc_arraylength              = 190;
  50.329 -    public static final int opc_athrow                   = 191;
  50.330 -    public static final int opc_checkcast                = 192;
  50.331 -    public static final int opc_instanceof               = 193;
  50.332 -    public static final int opc_monitorenter             = 194;
  50.333 -    public static final int opc_monitorexit              = 195;
  50.334 -    public static final int opc_wide                     = 196;
  50.335 -    public static final int opc_multianewarray           = 197;
  50.336 -    public static final int opc_ifnull                   = 198;
  50.337 -    public static final int opc_ifnonnull                = 199;
  50.338 -    public static final int opc_goto_w                   = 200;
  50.339 -    public static final int opc_jsr_w                    = 201;
  50.340 -        /* Pseudo-instructions */
  50.341 -    public static final int opc_bytecode                 = 203;
  50.342 -    public static final int opc_try                      = 204;
  50.343 -    public static final int opc_endtry                   = 205;
  50.344 -    public static final int opc_catch                    = 206;
  50.345 -    public static final int opc_var                      = 207;
  50.346 -    public static final int opc_endvar                   = 208;
  50.347 -    public static final int opc_localsmap                = 209;
  50.348 -    public static final int opc_stackmap                 = 210;
  50.349 -        /* PicoJava prefixes */
  50.350 -    public static final int opc_nonpriv                  = 254;
  50.351 -    public static final int opc_priv                     = 255;
  50.352 -
  50.353 -        /* Wide instructions */
  50.354 -    public static final int opc_iload_w         = (opc_wide<<8)|opc_iload;
  50.355 -    public static final int opc_lload_w         = (opc_wide<<8)|opc_lload;
  50.356 -    public static final int opc_fload_w         = (opc_wide<<8)|opc_fload;
  50.357 -    public static final int opc_dload_w         = (opc_wide<<8)|opc_dload;
  50.358 -    public static final int opc_aload_w         = (opc_wide<<8)|opc_aload;
  50.359 -    public static final int opc_istore_w        = (opc_wide<<8)|opc_istore;
  50.360 -    public static final int opc_lstore_w        = (opc_wide<<8)|opc_lstore;
  50.361 -    public static final int opc_fstore_w        = (opc_wide<<8)|opc_fstore;
  50.362 -    public static final int opc_dstore_w        = (opc_wide<<8)|opc_dstore;
  50.363 -    public static final int opc_astore_w        = (opc_wide<<8)|opc_astore;
  50.364 -    public static final int opc_ret_w           = (opc_wide<<8)|opc_ret;
  50.365 -    public static final int opc_iinc_w          = (opc_wide<<8)|opc_iinc;
  50.366 -
  50.367 -    /* Opcode Names */
  50.368 -  public static final String opcNamesTab[] = {
  50.369 -        "nop",
  50.370 -        "aconst_null",
  50.371 -        "iconst_m1",
  50.372 -        "iconst_0",
  50.373 -        "iconst_1",
  50.374 -        "iconst_2",
  50.375 -        "iconst_3",
  50.376 -        "iconst_4",
  50.377 -        "iconst_5",
  50.378 -        "lconst_0",
  50.379 -        "lconst_1",
  50.380 -        "fconst_0",
  50.381 -        "fconst_1",
  50.382 -        "fconst_2",
  50.383 -        "dconst_0",
  50.384 -        "dconst_1",
  50.385 -        "bipush",
  50.386 -        "sipush",
  50.387 -        "ldc",
  50.388 -        "ldc_w",
  50.389 -        "ldc2_w",
  50.390 -        "iload",
  50.391 -        "lload",
  50.392 -        "fload",
  50.393 -        "dload",
  50.394 -        "aload",
  50.395 -        "iload_0",
  50.396 -        "iload_1",
  50.397 -        "iload_2",
  50.398 -        "iload_3",
  50.399 -        "lload_0",
  50.400 -        "lload_1",
  50.401 -        "lload_2",
  50.402 -        "lload_3",
  50.403 -        "fload_0",
  50.404 -        "fload_1",
  50.405 -        "fload_2",
  50.406 -        "fload_3",
  50.407 -        "dload_0",
  50.408 -        "dload_1",
  50.409 -        "dload_2",
  50.410 -        "dload_3",
  50.411 -        "aload_0",
  50.412 -        "aload_1",
  50.413 -        "aload_2",
  50.414 -        "aload_3",
  50.415 -        "iaload",
  50.416 -        "laload",
  50.417 -        "faload",
  50.418 -        "daload",
  50.419 -        "aaload",
  50.420 -        "baload",
  50.421 -        "caload",
  50.422 -        "saload",
  50.423 -        "istore",
  50.424 -        "lstore",
  50.425 -        "fstore",
  50.426 -        "dstore",
  50.427 -        "astore",
  50.428 -        "istore_0",
  50.429 -        "istore_1",
  50.430 -        "istore_2",
  50.431 -        "istore_3",
  50.432 -        "lstore_0",
  50.433 -        "lstore_1",
  50.434 -        "lstore_2",
  50.435 -        "lstore_3",
  50.436 -        "fstore_0",
  50.437 -        "fstore_1",
  50.438 -        "fstore_2",
  50.439 -        "fstore_3",
  50.440 -        "dstore_0",
  50.441 -        "dstore_1",
  50.442 -        "dstore_2",
  50.443 -        "dstore_3",
  50.444 -        "astore_0",
  50.445 -        "astore_1",
  50.446 -        "astore_2",
  50.447 -        "astore_3",
  50.448 -        "iastore",
  50.449 -        "lastore",
  50.450 -        "fastore",
  50.451 -        "dastore",
  50.452 -        "aastore",
  50.453 -        "bastore",
  50.454 -        "castore",
  50.455 -        "sastore",
  50.456 -        "pop",
  50.457 -        "pop2",
  50.458 -        "dup",
  50.459 -        "dup_x1",
  50.460 -        "dup_x2",
  50.461 -        "dup2",
  50.462 -        "dup2_x1",
  50.463 -        "dup2_x2",
  50.464 -        "swap",
  50.465 -        "iadd",
  50.466 -        "ladd",
  50.467 -        "fadd",
  50.468 -        "dadd",
  50.469 -        "isub",
  50.470 -        "lsub",
  50.471 -        "fsub",
  50.472 -        "dsub",
  50.473 -        "imul",
  50.474 -        "lmul",
  50.475 -        "fmul",
  50.476 -        "dmul",
  50.477 -        "idiv",
  50.478 -        "ldiv",
  50.479 -        "fdiv",
  50.480 -        "ddiv",
  50.481 -        "irem",
  50.482 -        "lrem",
  50.483 -        "frem",
  50.484 -        "drem",
  50.485 -        "ineg",
  50.486 -        "lneg",
  50.487 -        "fneg",
  50.488 -        "dneg",
  50.489 -        "ishl",
  50.490 -        "lshl",
  50.491 -        "ishr",
  50.492 -        "lshr",
  50.493 -        "iushr",
  50.494 -        "lushr",
  50.495 -        "iand",
  50.496 -        "land",
  50.497 -        "ior",
  50.498 -        "lor",
  50.499 -        "ixor",
  50.500 -        "lxor",
  50.501 -        "iinc",
  50.502 -        "i2l",
  50.503 -        "i2f",
  50.504 -        "i2d",
  50.505 -        "l2i",
  50.506 -        "l2f",
  50.507 -        "l2d",
  50.508 -        "f2i",
  50.509 -        "f2l",
  50.510 -        "f2d",
  50.511 -        "d2i",
  50.512 -        "d2l",
  50.513 -        "d2f",
  50.514 -        "i2b",
  50.515 -        "i2c",
  50.516 -        "i2s",
  50.517 -        "lcmp",
  50.518 -        "fcmpl",
  50.519 -        "fcmpg",
  50.520 -        "dcmpl",
  50.521 -        "dcmpg",
  50.522 -        "ifeq",
  50.523 -        "ifne",
  50.524 -        "iflt",
  50.525 -        "ifge",
  50.526 -        "ifgt",
  50.527 -        "ifle",
  50.528 -        "if_icmpeq",
  50.529 -        "if_icmpne",
  50.530 -        "if_icmplt",
  50.531 -        "if_icmpge",
  50.532 -        "if_icmpgt",
  50.533 -        "if_icmple",
  50.534 -        "if_acmpeq",
  50.535 -        "if_acmpne",
  50.536 -        "goto",
  50.537 -        "jsr",
  50.538 -        "ret",
  50.539 -        "tableswitch",
  50.540 -        "lookupswitch",
  50.541 -        "ireturn",
  50.542 -        "lreturn",
  50.543 -        "freturn",
  50.544 -        "dreturn",
  50.545 -        "areturn",
  50.546 -        "return",
  50.547 -        "getstatic",
  50.548 -        "putstatic",
  50.549 -        "getfield",
  50.550 -        "putfield",
  50.551 -        "invokevirtual",
  50.552 -        "invokespecial", //     was "invokenonvirtual",
  50.553 -        "invokestatic",
  50.554 -        "invokeinterface",
  50.555 -        "invokedynamic",
  50.556 -        "new",
  50.557 -        "newarray",
  50.558 -        "anewarray",
  50.559 -        "arraylength",
  50.560 -        "athrow",
  50.561 -        "checkcast",
  50.562 -        "instanceof",
  50.563 -        "monitorenter",
  50.564 -        "monitorexit",
  50.565 -         null, // "wide",
  50.566 -        "multianewarray",
  50.567 -        "ifnull",
  50.568 -        "ifnonnull",
  50.569 -        "goto_w",
  50.570 -        "jsr_w",
  50.571 -        "bytecode 202", // "breakpoint",
  50.572 -        "bytecode",
  50.573 -        "try",
  50.574 -        "endtry",
  50.575 -        "catch",
  50.576 -        "var",
  50.577 -        "endvar",
  50.578 -        "locals_map",
  50.579 -        "stack_map"
  50.580 -  };
  50.581 -
  50.582 -    /* Opcode Lengths */
  50.583 -  public static final int opcLengthsTab[] = {
  50.584 -        1,
  50.585 -        1,
  50.586 -        1,
  50.587 -        1,
  50.588 -        1,
  50.589 -        1,
  50.590 -        1,
  50.591 -        1,
  50.592 -        1,
  50.593 -        1,
  50.594 -        1,
  50.595 -        1,
  50.596 -        1,
  50.597 -        1,
  50.598 -        1,
  50.599 -        1,
  50.600 -        2,
  50.601 -        3,
  50.602 -        2,
  50.603 -        3,
  50.604 -        3,
  50.605 -        2,
  50.606 -        2,
  50.607 -        2,
  50.608 -        2,
  50.609 -        2,
  50.610 -        1,
  50.611 -        1,
  50.612 -        1,
  50.613 -        1,
  50.614 -        1,
  50.615 -        1,
  50.616 -        1,
  50.617 -        1,
  50.618 -        1,
  50.619 -        1,
  50.620 -        1,
  50.621 -        1,
  50.622 -        1,
  50.623 -        1,
  50.624 -        1,
  50.625 -        1,
  50.626 -        1,
  50.627 -        1,
  50.628 -        1,
  50.629 -        1,
  50.630 -        1,
  50.631 -        1,
  50.632 -        1,
  50.633 -        1,
  50.634 -        1,
  50.635 -        1,
  50.636 -        1,
  50.637 -        1,
  50.638 -        2,
  50.639 -        2,
  50.640 -        2,
  50.641 -        2,
  50.642 -        2,
  50.643 -        1,
  50.644 -        1,
  50.645 -        1,
  50.646 -        1,
  50.647 -        1,
  50.648 -        1,
  50.649 -        1,
  50.650 -        1,
  50.651 -        1,
  50.652 -        1,
  50.653 -        1,
  50.654 -        1,
  50.655 -        1,
  50.656 -        1,
  50.657 -        1,
  50.658 -        1,
  50.659 -        1,
  50.660 -        1,
  50.661 -        1,
  50.662 -        1,
  50.663 -        1,
  50.664 -        1,
  50.665 -        1,
  50.666 -        1,
  50.667 -        1,
  50.668 -        1,
  50.669 -        1,
  50.670 -        1,
  50.671 -        1,
  50.672 -        1,
  50.673 -        1,
  50.674 -        1,
  50.675 -        1,
  50.676 -        1,
  50.677 -        1,
  50.678 -        1,
  50.679 -        1,
  50.680 -        1,
  50.681 -        1,
  50.682 -        1,
  50.683 -        1,
  50.684 -        1,
  50.685 -        1,
  50.686 -        1,
  50.687 -        1,
  50.688 -        1,
  50.689 -        1,
  50.690 -        1,
  50.691 -        1,
  50.692 -        1,
  50.693 -        1,
  50.694 -        1,
  50.695 -        1,
  50.696 -        1,
  50.697 -        1,
  50.698 -        1,
  50.699 -        1,
  50.700 -        1,
  50.701 -        1,
  50.702 -        1,
  50.703 -        1,
  50.704 -        1,
  50.705 -        1,
  50.706 -        1,
  50.707 -        1,
  50.708 -        1,
  50.709 -        1,
  50.710 -        1,
  50.711 -        1,
  50.712 -        1,
  50.713 -        1,
  50.714 -        1,
  50.715 -        1,
  50.716 -        3,
  50.717 -        1,
  50.718 -        1,
  50.719 -        1,
  50.720 -        1,
  50.721 -        1,
  50.722 -        1,
  50.723 -        1,
  50.724 -        1,
  50.725 -        1,
  50.726 -        1,
  50.727 -        1,
  50.728 -        1,
  50.729 -        1,
  50.730 -        1,
  50.731 -        1,
  50.732 -        1,
  50.733 -        1,
  50.734 -        1,
  50.735 -        1,
  50.736 -        1,
  50.737 -        3,
  50.738 -        3,
  50.739 -        3,
  50.740 -        3,
  50.741 -        3,
  50.742 -        3,
  50.743 -        3,
  50.744 -        3,
  50.745 -        3,
  50.746 -        3,
  50.747 -        3,
  50.748 -        3,
  50.749 -        3,
  50.750 -        3,
  50.751 -        3,
  50.752 -        3,
  50.753 -        2,
  50.754 -        99,
  50.755 -        99,
  50.756 -        1,
  50.757 -        1,
  50.758 -        1,
  50.759 -        1,
  50.760 -        1,
  50.761 -        1,
  50.762 -        3,
  50.763 -        3,
  50.764 -        3,
  50.765 -        3,
  50.766 -        3,
  50.767 -        3,
  50.768 -        3,
  50.769 -        5,
  50.770 -        0,
  50.771 -        3,
  50.772 -        2,
  50.773 -        3,
  50.774 -        1,
  50.775 -        1,
  50.776 -        3,
  50.777 -        3,
  50.778 -        1,
  50.779 -        1,
  50.780 -        0, // wide
  50.781 -        4,
  50.782 -        3,
  50.783 -        3,
  50.784 -        5,
  50.785 -        5,
  50.786 -        1,
  50.787 -        1, 0, 0, 0, 0, 0 // pseudo
  50.788 -  };
  50.789 -
  50.790 -}
    51.1 --- a/src/share/classes/sun/tools/javap/StackMapData.java	Thu Jun 11 10:54:31 2009 -0700
    51.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    51.3 @@ -1,76 +0,0 @@
    51.4 -/*
    51.5 - * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
    51.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    51.7 - *
    51.8 - * This code is free software; you can redistribute it and/or modify it
    51.9 - * under the terms of the GNU General Public License version 2 only, as
   51.10 - * published by the Free Software Foundation.  Sun designates this
   51.11 - * particular file as subject to the "Classpath" exception as provided
   51.12 - * by Sun in the LICENSE file that accompanied this code.
   51.13 - *
   51.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
   51.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   51.16 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   51.17 - * version 2 for more details (a copy is included in the LICENSE file that
   51.18 - * accompanied this code).
   51.19 - *
   51.20 - * You should have received a copy of the GNU General Public License version
   51.21 - * 2 along with this work; if not, write to the Free Software Foundation,
   51.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   51.23 - *
   51.24 - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   51.25 - * CA 95054 USA or visit www.sun.com if you need additional information or
   51.26 - * have any questions.
   51.27 - */
   51.28 -
   51.29 -
   51.30 -package sun.tools.javap;
   51.31 -
   51.32 -import java.util.*;
   51.33 -import java.io.*;
   51.34 -
   51.35 -import static sun.tools.javap.RuntimeConstants.*;
   51.36 -
   51.37 -/* represents one entry of StackMap attribute
   51.38 - */
   51.39 -class StackMapData {
   51.40 -    final int offset;
   51.41 -    final int[] locals;
   51.42 -    final int[] stack;
   51.43 -
   51.44 -    StackMapData(int offset, int[] locals, int[] stack) {
   51.45 -        this.offset = offset;
   51.46 -        this.locals = locals;
   51.47 -        this.stack = stack;
   51.48 -    }
   51.49 -
   51.50 -    StackMapData(DataInputStream in, MethodData method) throws IOException {
   51.51 -        offset = in.readUnsignedShort();
   51.52 -        int local_size = in.readUnsignedShort();
   51.53 -        locals = readTypeArray(in, local_size, method);
   51.54 -        int stack_size = in.readUnsignedShort();
   51.55 -        stack = readTypeArray(in, stack_size, method);
   51.56 -    }
   51.57 -
   51.58 -    static final int[] readTypeArray(DataInputStream in, int length, MethodData method) throws IOException {
   51.59 -        int[] types = new int[length];
   51.60 -        for (int i=0; i<length; i++) {
   51.61 -            types[i] = readType(in, method);
   51.62 -        }
   51.63 -        return types;
   51.64 -    }
   51.65 -
   51.66 -    static final int readType(DataInputStream in, MethodData method) throws IOException {
   51.67 -        int type = in.readUnsignedByte();
   51.68 -        if (type == ITEM_Object || type == ITEM_NewObject) {
   51.69 -            type = type | (in.readUnsignedShort()<<8);
   51.70 -        }
   51.71 -        return type;
   51.72 -    }
   51.73 -
   51.74 -    void print(JavapPrinter p) {
   51.75 -        p.out.println("   " + offset + ":");
   51.76 -        p.printMap("    locals = [", locals);
   51.77 -        p.printMap("    stack = [", stack);
   51.78 -    }
   51.79 -}
    52.1 --- a/src/share/classes/sun/tools/javap/StackMapTableData.java	Thu Jun 11 10:54:31 2009 -0700
    52.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    52.3 @@ -1,168 +0,0 @@
    52.4 -/*
    52.5 - * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
    52.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    52.7 - *
    52.8 - * This code is free software; you can redistribute it and/or modify it
    52.9 - * under the terms of the GNU General Public License version 2 only, as
   52.10 - * published by the Free Software Foundation.  Sun designates this
   52.11 - * particular file as subject to the "Classpath" exception as provided
   52.12 - * by Sun in the LICENSE file that accompanied this code.
   52.13 - *
   52.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
   52.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   52.16 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   52.17 - * version 2 for more details (a copy is included in the LICENSE file that
   52.18 - * accompanied this code).
   52.19 - *
   52.20 - * You should have received a copy of the GNU General Public License version
   52.21 - * 2 along with this work; if not, write to the Free Software Foundation,
   52.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   52.23 - *
   52.24 - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   52.25 - * CA 95054 USA or visit www.sun.com if you need additional information or
   52.26 - * have any questions.
   52.27 - */
   52.28 -
   52.29 -
   52.30 -package sun.tools.javap;
   52.31 -
   52.32 -import java.util.*;
   52.33 -import java.io.*;
   52.34 -
   52.35 -import static sun.tools.javap.RuntimeConstants.*;
   52.36 -
   52.37 -/* represents one entry of StackMapTable attribute
   52.38 - */
   52.39 -class StackMapTableData {
   52.40 -    final int frameType;
   52.41 -    int offsetDelta;
   52.42 -
   52.43 -    StackMapTableData(int frameType) {
   52.44 -        this.frameType = frameType;
   52.45 -    }
   52.46 -
   52.47 -    void print(JavapPrinter p) {
   52.48 -        p.out.print("   frame_type = " + frameType);
   52.49 -    }
   52.50 -
   52.51 -    static class SameFrame extends StackMapTableData {
   52.52 -        SameFrame(int frameType, int offsetDelta) {
   52.53 -            super(frameType);
   52.54 -            this.offsetDelta = offsetDelta;
   52.55 -        }
   52.56 -        void print(JavapPrinter p) {
   52.57 -            super.print(p);
   52.58 -            if (frameType < SAME_FRAME_BOUND) {
   52.59 -                p.out.println(" /* same */");
   52.60 -            } else {
   52.61 -                p.out.println(" /* same_frame_extended */");
   52.62 -                p.out.println("     offset_delta = " + offsetDelta);
   52.63 -            }
   52.64 -        }
   52.65 -    }
   52.66 -
   52.67 -    static class SameLocals1StackItem extends StackMapTableData {
   52.68 -        final int[] stack;
   52.69 -        SameLocals1StackItem(int frameType, int offsetDelta, int[] stack) {
   52.70 -            super(frameType);
   52.71 -            this.offsetDelta = offsetDelta;
   52.72 -            this.stack = stack;
   52.73 -        }
   52.74 -        void print(JavapPrinter p) {
   52.75 -            super.print(p);
   52.76 -            if (frameType == SAME_LOCALS_1_STACK_ITEM_EXTENDED) {
   52.77 -                p.out.println(" /* same_locals_1_stack_item_frame_extended */");
   52.78 -                p.out.println("     offset_delta = " + offsetDelta);
   52.79 -            } else {
   52.80 -                p.out.println(" /* same_locals_1_stack_item */");
   52.81 -            }
   52.82 -            p.printMap("     stack = [", stack);
   52.83 -        }
   52.84 -    }
   52.85 -
   52.86 -    static class ChopFrame extends StackMapTableData {
   52.87 -        ChopFrame(int frameType, int offsetDelta) {
   52.88 -            super(frameType);
   52.89 -            this.offsetDelta = offsetDelta;
   52.90 -        }
   52.91 -        void print(JavapPrinter p) {
   52.92 -            super.print(p);
   52.93 -            p.out.println(" /* chop */");
   52.94 -            p.out.println("     offset_delta = " + offsetDelta);
   52.95 -        }
   52.96 -    }
   52.97 -
   52.98 -    static class AppendFrame extends StackMapTableData {
   52.99 -        final int[] locals;
  52.100 -        AppendFrame(int frameType, int offsetDelta, int[] locals) {
  52.101 -            super(frameType);
  52.102 -            this.offsetDelta = offsetDelta;
  52.103 -            this.locals = locals;
  52.104 -        }
  52.105 -        void print(JavapPrinter p) {
  52.106 -            super.print(p);
  52.107 -            p.out.println(" /* append */");
  52.108 -            p.out.println("     offset_delta = " + offsetDelta);
  52.109 -            p.printMap("     locals = [", locals);
  52.110 -        }
  52.111 -    }
  52.112 -
  52.113 -    static class FullFrame extends StackMapTableData {
  52.114 -        final int[] locals;
  52.115 -        final int[] stack;
  52.116 -        FullFrame(int offsetDelta, int[] locals, int[] stack) {
  52.117 -            super(FULL_FRAME);
  52.118 -            this.offsetDelta = offsetDelta;
  52.119 -            this.locals = locals;
  52.120 -            this.stack = stack;
  52.121 -        }
  52.122 -        void print(JavapPrinter p) {
  52.123 -            super.print(p);
  52.124 -            p.out.println(" /* full_frame */");
  52.125 -            p.out.println("     offset_delta = " + offsetDelta);
  52.126 -            p.printMap("     locals = [", locals);
  52.127 -            p.printMap("     stack = [", stack);
  52.128 -        }
  52.129 -    }
  52.130 -
  52.131 -    static StackMapTableData getInstance(DataInputStream in, MethodData method)
  52.132 -                  throws IOException {
  52.133 -        int frameType = in.readUnsignedByte();
  52.134 -
  52.135 -        if (frameType < SAME_FRAME_BOUND) {
  52.136 -            // same_frame
  52.137 -            return new SameFrame(frameType, frameType);
  52.138 -        } else if (SAME_FRAME_BOUND <= frameType && frameType < SAME_LOCALS_1_STACK_ITEM_BOUND) {
  52.139 -            // same_locals_1_stack_item_frame
  52.140 -            // read additional single stack element
  52.141 -            return new SameLocals1StackItem(frameType,
  52.142 -                                            (frameType - SAME_FRAME_BOUND),
  52.143 -                                            StackMapData.readTypeArray(in, 1, method));
  52.144 -        } else if (frameType == SAME_LOCALS_1_STACK_ITEM_EXTENDED) {
  52.145 -            // same_locals_1_stack_item_extended
  52.146 -            return new SameLocals1StackItem(frameType,
  52.147 -                                            in.readUnsignedShort(),
  52.148 -                                            StackMapData.readTypeArray(in, 1, method));
  52.149 -        } else if (SAME_LOCALS_1_STACK_ITEM_EXTENDED < frameType  && frameType < SAME_FRAME_EXTENDED) {
  52.150 -            // chop_frame or same_frame_extended
  52.151 -            return new ChopFrame(frameType, in.readUnsignedShort());
  52.152 -        } else if (frameType == SAME_FRAME_EXTENDED) {
  52.153 -            // chop_frame or same_frame_extended
  52.154 -            return new SameFrame(frameType, in.readUnsignedShort());
  52.155 -        } else if (SAME_FRAME_EXTENDED < frameType  && frameType < FULL_FRAME) {
  52.156 -            // append_frame
  52.157 -            return new AppendFrame(frameType, in.readUnsignedShort(),
  52.158 -                                   StackMapData.readTypeArray(in, frameType - SAME_FRAME_EXTENDED, method));
  52.159 -        } else if (frameType == FULL_FRAME) {
  52.160 -            // full_frame
  52.161 -            int offsetDelta = in.readUnsignedShort();
  52.162 -            int locals_size = in.readUnsignedShort();
  52.163 -            int[] locals = StackMapData.readTypeArray(in, locals_size, method);
  52.164 -            int stack_size = in.readUnsignedShort();
  52.165 -            int[] stack = StackMapData.readTypeArray(in, stack_size, method);
  52.166 -            return new FullFrame(offsetDelta, locals, stack);
  52.167 -        } else {
  52.168 -            throw new ClassFormatError("unrecognized frame_type in StackMapTable");
  52.169 -        }
  52.170 -    }
  52.171 -}
    53.1 --- a/src/share/classes/sun/tools/javap/Tables.java	Thu Jun 11 10:54:31 2009 -0700
    53.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    53.3 @@ -1,375 +0,0 @@
    53.4 -/*
    53.5 - * Copyright 2002-2008 Sun Microsystems, Inc.  All Rights Reserved.
    53.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    53.7 - *
    53.8 - * This code is free software; you can redistribute it and/or modify it
    53.9 - * under the terms of the GNU General Public License version 2 only, as
   53.10 - * published by the Free Software Foundation.  Sun designates this
   53.11 - * particular file as subject to the "Classpath" exception as provided
   53.12 - * by Sun in the LICENSE file that accompanied this code.
   53.13 - *
   53.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
   53.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   53.16 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   53.17 - * version 2 for more details (a copy is included in the LICENSE file that
   53.18 - * accompanied this code).
   53.19 - *
   53.20 - * You should have received a copy of the GNU General Public License version
   53.21 - * 2 along with this work; if not, write to the Free Software Foundation,
   53.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   53.23 - *
   53.24 - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   53.25 - * CA 95054 USA or visit www.sun.com if you need additional information or
   53.26 - * have any questions.
   53.27 - */
   53.28 -
   53.29 -
   53.30 -package sun.tools.javap;
   53.31 -
   53.32 -import java.util.Hashtable;
   53.33 -import java.util.Vector;
   53.34 -
   53.35 -
   53.36 -public class Tables implements Constants {
   53.37 -    /**
   53.38 -     * Define mnemocodes table.
   53.39 -     */
   53.40 -  static  Hashtable<String,Integer> mnemocodes = new Hashtable<String,Integer>(301, 0.5f);
   53.41 -  static  String opcExtNamesTab[]=new String[128];
   53.42 -  static  String opcPrivExtNamesTab[]=new String[128];
   53.43 -  static  void defineNonPriv(int opc, String mnem) {
   53.44 -        mnemocodes.put(opcExtNamesTab[opc]=mnem, opc_nonpriv*256+opc);
   53.45 -  }
   53.46 -  static  void definePriv(int opc, String mnem) {
   53.47 -        mnemocodes.put(opcPrivExtNamesTab[opc]="priv_"+mnem, opc_priv*256+opc);
   53.48 -  }
   53.49 -  static  void defineExt(int opc, String mnem) {
   53.50 -        defineNonPriv(opc, mnem);
   53.51 -        definePriv(opc, mnem);
   53.52 -  }
   53.53 -  static { int k;
   53.54 -        for (k=0; k<opc_wide; k++) {
   53.55 -                mnemocodes.put(opcNamesTab[k], k);
   53.56 -        }
   53.57 -        for (k=opc_wide+1; k<opcNamesTab.length; k++) {
   53.58 -                mnemocodes.put(opcNamesTab[k], k);
   53.59 -        }
   53.60 -        mnemocodes.put("invokenonvirtual", opc_invokespecial);
   53.61 -
   53.62 -        mnemocodes.put("iload_w", opc_iload_w);
   53.63 -        mnemocodes.put("lload_w", opc_lload_w);
   53.64 -        mnemocodes.put("fload_w", opc_fload_w);
   53.65 -        mnemocodes.put("dload_w", opc_dload_w);
   53.66 -        mnemocodes.put("aload_w", opc_aload_w);
   53.67 -        mnemocodes.put("istore_w", opc_istore_w);
   53.68 -        mnemocodes.put("lstore_w", opc_lstore_w);
   53.69 -        mnemocodes.put("fstore_w", opc_fstore_w);
   53.70 -        mnemocodes.put("dstore_w", opc_dstore_w);
   53.71 -        mnemocodes.put("astore_w", opc_astore_w);
   53.72 -        mnemocodes.put("ret_w", opc_ret_w);
   53.73 -        mnemocodes.put("iinc_w", opc_iinc_w);
   53.74 -
   53.75 -        mnemocodes.put("nonpriv", opc_nonpriv);
   53.76 -        mnemocodes.put("priv", opc_priv);
   53.77 -
   53.78 -        defineExt(0, "load_ubyte");
   53.79 -        defineExt(1, "load_byte");
   53.80 -        defineExt(2, "load_char");
   53.81 -        defineExt(3, "load_short");
   53.82 -        defineExt(4, "load_word");
   53.83 -        defineExt(10, "load_char_oe");
   53.84 -        defineExt(11, "load_short_oe");
   53.85 -        defineExt(12, "load_word_oe");
   53.86 -        defineExt(16, "ncload_ubyte");
   53.87 -        defineExt(17, "ncload_byte");
   53.88 -        defineExt(18, "ncload_char");
   53.89 -        defineExt(19, "ncload_short");
   53.90 -        defineExt(20, "ncload_word");
   53.91 -        defineExt(26, "ncload_char_oe");
   53.92 -        defineExt(27, "ncload_short_oe");
   53.93 -        defineExt(28, "ncload_word_oe");
   53.94 -        defineExt(30, "cache_flush");
   53.95 -        defineExt(32, "store_byte");
   53.96 -        defineExt(34, "store_short");
   53.97 -        defineExt(36, "store_word");
   53.98 -        defineExt(42, "store_short_oe");
   53.99 -        defineExt(44, "store_word_oe");
  53.100 -        defineExt(48, "ncstore_byte");
  53.101 -        defineExt(50, "ncstore_short");
  53.102 -        defineExt(52, "ncstore_word");
  53.103 -        defineExt(58, "ncstore_short_oe");
  53.104 -        defineExt(60, "ncstore_word_oe");
  53.105 -        defineExt(62, "zero_line");
  53.106 -        defineNonPriv(5, "ret_from_sub");
  53.107 -        defineNonPriv(63, "enter_sync_method");
  53.108 -        definePriv(5, "ret_from_trap");
  53.109 -        definePriv(6, "read_dcache_tag");
  53.110 -        definePriv(7, "read_dcache_data");
  53.111 -        definePriv(14, "read_icache_tag");
  53.112 -        definePriv(15, "read_icache_data");
  53.113 -        definePriv(22, "powerdown");
  53.114 -        definePriv(23, "read_scache_data");
  53.115 -        definePriv(31, "cache_index_flush");
  53.116 -        definePriv(38, "write_dcache_tag");
  53.117 -        definePriv(39, "write_dcache_data");
  53.118 -        definePriv(46, "write_icache_tag");
  53.119 -        definePriv(47, "write_icache_data");
  53.120 -        definePriv(54, "reset");
  53.121 -        definePriv(55, "write_scache_data");
  53.122 -        for (k=0; k<32; k++) {
  53.123 -                definePriv(k+64, "read_reg_"+k);
  53.124 -        }
  53.125 -        for (k=0; k<32; k++) {
  53.126 -                definePriv(k+96, "write_reg_"+k);
  53.127 -        }
  53.128 - }
  53.129 -
  53.130 -  public static int opcLength(int opc) throws ArrayIndexOutOfBoundsException {
  53.131 -        switch (opc>>8) {
  53.132 -          case 0:
  53.133 -                return opcLengthsTab[opc];
  53.134 -          case opc_wide:
  53.135 -                switch (opc&0xFF) {
  53.136 -                  case opc_aload: case opc_astore:
  53.137 -                  case opc_fload: case opc_fstore:
  53.138 -                  case opc_iload: case opc_istore:
  53.139 -                  case opc_lload: case opc_lstore:
  53.140 -                  case opc_dload: case opc_dstore:
  53.141 -                  case opc_ret:
  53.142 -                        return  4;
  53.143 -                  case opc_iinc:
  53.144 -                        return  6;
  53.145 -                  default:
  53.146 -                        throw new ArrayIndexOutOfBoundsException();
  53.147 -                }
  53.148 -          case opc_nonpriv:
  53.149 -          case opc_priv:
  53.150 -                return 2;
  53.151 -          default:
  53.152 -                throw new ArrayIndexOutOfBoundsException();
  53.153 -        }
  53.154 -  }
  53.155 -
  53.156 -  public static String opcName(int opc) {
  53.157 -        try {
  53.158 -                switch (opc>>8) {
  53.159 -                  case 0:
  53.160 -                        return opcNamesTab[opc];
  53.161 -                  case opc_wide: {
  53.162 -                        String mnem=opcNamesTab[opc&0xFF]+"_w";
  53.163 -                        if (mnemocodes.get(mnem) == null)
  53.164 -                                return null; // non-existent opcode
  53.165 -                        return mnem;
  53.166 -                  }
  53.167 -                  case opc_nonpriv:
  53.168 -                        return opcExtNamesTab[opc&0xFF];
  53.169 -                  case opc_priv:
  53.170 -                        return opcPrivExtNamesTab[opc&0xFF];
  53.171 -                  default:
  53.172 -                        return null;
  53.173 -                }
  53.174 -        } catch (ArrayIndexOutOfBoundsException e) {
  53.175 -                switch (opc) {
  53.176 -                  case opc_nonpriv:
  53.177 -                        return "nonpriv";
  53.178 -                  case opc_priv:
  53.179 -                        return "priv";
  53.180 -                  default:
  53.181 -                        return null;
  53.182 -                }
  53.183 -        }
  53.184 -  }
  53.185 -
  53.186 -  public static int opcode(String mnem) {
  53.187 -        Integer Val=mnemocodes.get(mnem);
  53.188 -        if (Val == null) return -1;
  53.189 -        return Val.intValue();
  53.190 -  }
  53.191 -
  53.192 -    /**
  53.193 -     * Initialized keyword and token Hashtables
  53.194 -     */
  53.195 -  static Vector<String> keywordNames = new Vector<String>(40);
  53.196 -  private static void defineKeywordName(String id, int token) {
  53.197 -
  53.198 -        if (token>=keywordNames.size()) {
  53.199 -                keywordNames.setSize(token+1);
  53.200 -        }
  53.201 -        keywordNames.setElementAt(id, token);
  53.202 -  }
  53.203 -  public static String keywordName(int token) {
  53.204 -        if (token==-1) return "EOF";
  53.205 -        if (token>=keywordNames.size()) return null;
  53.206 -        return keywordNames.elementAt(token);
  53.207 -  }
  53.208 -  static {
  53.209 -        defineKeywordName("ident", IDENT);
  53.210 -        defineKeywordName("STRINGVAL", STRINGVAL);
  53.211 -        defineKeywordName("intVal", INTVAL);
  53.212 -        defineKeywordName("longVal", LONGVAL);
  53.213 -        defineKeywordName("floatVal", FLOATVAL);
  53.214 -        defineKeywordName("doubleVal", DOUBLEVAL);
  53.215 -        defineKeywordName("SEMICOLON", SEMICOLON);
  53.216 -        defineKeywordName("COLON", COLON);
  53.217 -        defineKeywordName("LBRACE", LBRACE);
  53.218 -        defineKeywordName("RBRACE", RBRACE);
  53.219 -  }
  53.220 -
  53.221 -  static Hashtable<String,Integer> keywords = new Hashtable<String,Integer>(40);
  53.222 -  public static int keyword(String idValue) {
  53.223 -        Integer val=keywords.get(idValue);
  53.224 -        if (val == null) return IDENT;
  53.225 -        return val.intValue();
  53.226 -  }
  53.227 -
  53.228 -  private static void defineKeyword(String id, int token) {
  53.229 -        keywords.put(id, token);
  53.230 -        defineKeywordName(id, token);
  53.231 -  }
  53.232 -  static {
  53.233 -        // Modifier keywords
  53.234 -        defineKeyword("private", PRIVATE);
  53.235 -        defineKeyword("public", PUBLIC);
  53.236 -        defineKeyword("protected",      PROTECTED);
  53.237 -        defineKeyword("static", STATIC);
  53.238 -        defineKeyword("transient",      TRANSIENT);
  53.239 -        defineKeyword("synchronized",   SYNCHRONIZED);
  53.240 -        defineKeyword("super",  SUPER);
  53.241 -        defineKeyword("native", NATIVE);
  53.242 -        defineKeyword("abstract",       ABSTRACT);
  53.243 -        defineKeyword("volatile", VOLATILE);
  53.244 -        defineKeyword("final",  FINAL);
  53.245 -        defineKeyword("interface",INTERFACE);
  53.246 -        defineKeyword("synthetic",SYNTHETIC);
  53.247 -        defineKeyword("strict",STRICT);
  53.248 -
  53.249 -        // Declaration keywords
  53.250 -        defineKeyword("package",PACKAGE);
  53.251 -        defineKeyword("class",CLASS);
  53.252 -        defineKeyword("extends",EXTENDS);
  53.253 -        defineKeyword("implements",IMPLEMENTS);
  53.254 -        defineKeyword("const",  CONST);
  53.255 -        defineKeyword("throws",THROWS);
  53.256 -        defineKeyword("interface",INTERFACE);
  53.257 -        defineKeyword("Method",METHODREF);
  53.258 -        defineKeyword("Field",FIELDREF);
  53.259 -        defineKeyword("stack",STACK);
  53.260 -        defineKeyword("locals",LOCAL);
  53.261 -
  53.262 -        // used in switchtables
  53.263 -        defineKeyword("default",        DEFAULT);
  53.264 -
  53.265 -        // used in inner class declarations
  53.266 -        defineKeyword("InnerClass",     INNERCLASS);
  53.267 -        defineKeyword("of",     OF);
  53.268 -
  53.269 -        // misc
  53.270 -        defineKeyword("bits",BITS);
  53.271 -        defineKeyword("Infinity",INF);
  53.272 -        defineKeyword("Inf",INF);
  53.273 -        defineKeyword("NaN",NAN);
  53.274 -  }
  53.275 -
  53.276 -   /**
  53.277 -     * Define tag table.
  53.278 -     */
  53.279 -  private static Vector<String> tagNames = new Vector<String>(10);
  53.280 -  private static Hashtable<String,Integer> Tags = new Hashtable<String,Integer>(10);
  53.281 -  static {
  53.282 -        defineTag("Asciz",CONSTANT_UTF8);
  53.283 -        defineTag("int",CONSTANT_INTEGER);
  53.284 -        defineTag("float",CONSTANT_FLOAT);
  53.285 -        defineTag("long",CONSTANT_LONG);
  53.286 -        defineTag("double",CONSTANT_DOUBLE);
  53.287 -        defineTag("class",CONSTANT_CLASS);
  53.288 -        defineTag("String",CONSTANT_STRING);
  53.289 -        defineTag("Field",CONSTANT_FIELD);
  53.290 -        defineTag("Method",CONSTANT_METHOD);
  53.291 -        defineTag("InterfaceMethod",CONSTANT_INTERFACEMETHOD);
  53.292 -        defineTag("NameAndType",CONSTANT_NAMEANDTYPE);
  53.293 -  }
  53.294 -  private static void defineTag(String id, int val) {
  53.295 -        Tags.put(id, val);
  53.296 -        if (val>=tagNames.size()) {
  53.297 -                tagNames.setSize(val+1);
  53.298 -        }
  53.299 -        tagNames.setElementAt(id, val);
  53.300 -  }
  53.301 -  public static String tagName(int tag) {
  53.302 -        if (tag>=tagNames.size()) return null;
  53.303 -        return tagNames.elementAt(tag);
  53.304 -  }
  53.305 -  public static int tagValue(String idValue) {
  53.306 -        Integer Val=Tags.get(idValue);
  53.307 -        if (Val == null) return 0;
  53.308 -        return Val.intValue();
  53.309 -  }
  53.310 -
  53.311 -   /**
  53.312 -     * Define type table. These types used in "newarray" instruction only.
  53.313 -     */
  53.314 -  private static Vector<String> typeNames = new Vector<String>(10);
  53.315 -  private static Hashtable<String,Integer> Types = new Hashtable<String,Integer>(10);
  53.316 -  static {
  53.317 -        defineType("int",T_INT);
  53.318 -        defineType("long",T_LONG);
  53.319 -        defineType("float",T_FLOAT);
  53.320 -        defineType("double",T_DOUBLE);
  53.321 -        defineType("class",T_CLASS);
  53.322 -        defineType("boolean",T_BOOLEAN);
  53.323 -        defineType("char",T_CHAR);
  53.324 -        defineType("byte",T_BYTE);
  53.325 -        defineType("short",T_SHORT);
  53.326 -  }
  53.327 -  private static void defineType(String id, int val) {
  53.328 -        Types.put(id, val);
  53.329 -        if (val>=typeNames.size()) {
  53.330 -                typeNames.setSize(val+1);
  53.331 -        }
  53.332 -        typeNames.setElementAt(id, val);
  53.333 -  }
  53.334 -  public static int typeValue(String idValue) {
  53.335 -        Integer Val=Types.get(idValue);
  53.336 -        if (Val == null) return -1;
  53.337 -        return Val.intValue();
  53.338 -  }
  53.339 -  public static String typeName(int type) {
  53.340 -        if (type>=typeNames.size()) return null;
  53.341 -        return typeNames.elementAt(type);
  53.342 -  }
  53.343 -
  53.344 -   /**
  53.345 -     * Define MapTypes table.
  53.346 -     * These constants used in stackmap tables only.
  53.347 -     */
  53.348 -  private static Vector<String> mapTypeNames = new Vector<String>(10);
  53.349 -  private static Hashtable<String,Integer> MapTypes = new Hashtable<String,Integer>(10);
  53.350 -  static {
  53.351 -        defineMapType("bogus",             ITEM_Bogus);
  53.352 -        defineMapType("int",               ITEM_Integer);
  53.353 -        defineMapType("float",             ITEM_Float);
  53.354 -        defineMapType("double",            ITEM_Double);
  53.355 -        defineMapType("long",              ITEM_Long);
  53.356 -        defineMapType("null",              ITEM_Null);
  53.357 -        defineMapType("this",              ITEM_InitObject);
  53.358 -        defineMapType("CP",                ITEM_Object);
  53.359 -        defineMapType("uninitialized",     ITEM_NewObject);
  53.360 -  }
  53.361 -  private static void defineMapType(String id, int val) {
  53.362 -        MapTypes.put(id, val);
  53.363 -        if (val>=mapTypeNames.size()) {
  53.364 -                mapTypeNames.setSize(val+1);
  53.365 -        }
  53.366 -        mapTypeNames.setElementAt(id, val);
  53.367 -  }
  53.368 -  public static int mapTypeValue(String idValue) {
  53.369 -        Integer Val=MapTypes.get(idValue);
  53.370 -        if (Val == null) return -1;
  53.371 -        return Val.intValue();
  53.372 -  }
  53.373 -  public static String mapTypeName(int type) {
  53.374 -        if (type>=mapTypeNames.size()) return null;
  53.375 -        return mapTypeNames.elementAt(type);
  53.376 -  }
  53.377 -
  53.378 -}
    54.1 --- a/src/share/classes/sun/tools/javap/TrapData.java	Thu Jun 11 10:54:31 2009 -0700
    54.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    54.3 @@ -1,60 +0,0 @@
    54.4 -/*
    54.5 - * Copyright 2002 Sun Microsystems, Inc.  All Rights Reserved.
    54.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    54.7 - *
    54.8 - * This code is free software; you can redistribute it and/or modify it
    54.9 - * under the terms of the GNU General Public License version 2 only, as
   54.10 - * published by the Free Software Foundation.  Sun designates this
   54.11 - * particular file as subject to the "Classpath" exception as provided
   54.12 - * by Sun in the LICENSE file that accompanied this code.
   54.13 - *
   54.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
   54.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   54.16 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   54.17 - * version 2 for more details (a copy is included in the LICENSE file that
   54.18 - * accompanied this code).
   54.19 - *
   54.20 - * You should have received a copy of the GNU General Public License version
   54.21 - * 2 along with this work; if not, write to the Free Software Foundation,
   54.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   54.23 - *
   54.24 - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   54.25 - * CA 95054 USA or visit www.sun.com if you need additional information or
   54.26 - * have any questions.
   54.27 - */
   54.28 -
   54.29 -
   54.30 -package sun.tools.javap;
   54.31 -
   54.32 -import java.util.*;
   54.33 -import java.io.*;
   54.34 -
   54.35 -/**
   54.36 - * Stores exception table data in code attribute.
   54.37 - *
   54.38 - * @author  Sucheta Dambalkar (Adopted code from jdis)
   54.39 - */
   54.40 -class TrapData {
   54.41 -    short start_pc, end_pc, handler_pc, catch_cpx;
   54.42 -  int num;
   54.43 -
   54.44 -
   54.45 -    /**
   54.46 -     * Read and store exception table data in code attribute.
   54.47 -     */
   54.48 -    public TrapData(DataInputStream in, int num) throws IOException {
   54.49 -        this.num=num;
   54.50 -        start_pc = in.readShort();
   54.51 -        end_pc=in.readShort();
   54.52 -        handler_pc=in.readShort();
   54.53 -        catch_cpx=in.readShort();
   54.54 -    }
   54.55 -
   54.56 -    /**
   54.57 -     * returns recommended identifier
   54.58 -     */
   54.59 -    public String ident() {
   54.60 -        return "t"+num;
   54.61 -    }
   54.62 -
   54.63 -}
    55.1 --- a/src/share/classes/sun/tools/javap/TypeSignature.java	Thu Jun 11 10:54:31 2009 -0700
    55.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    55.3 @@ -1,295 +0,0 @@
    55.4 -/*
    55.5 - * Copyright 2002-2008 Sun Microsystems, Inc.  All Rights Reserved.
    55.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    55.7 - *
    55.8 - * This code is free software; you can redistribute it and/or modify it
    55.9 - * under the terms of the GNU General Public License version 2 only, as
   55.10 - * published by the Free Software Foundation.  Sun designates this
   55.11 - * particular file as subject to the "Classpath" exception as provided
   55.12 - * by Sun in the LICENSE file that accompanied this code.
   55.13 - *
   55.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
   55.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   55.16 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   55.17 - * version 2 for more details (a copy is included in the LICENSE file that
   55.18 - * accompanied this code).
   55.19 - *
   55.20 - * You should have received a copy of the GNU General Public License version
   55.21 - * 2 along with this work; if not, write to the Free Software Foundation,
   55.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   55.23 - *
   55.24 - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   55.25 - * CA 95054 USA or visit www.sun.com if you need additional information or
   55.26 - * have any questions.
   55.27 - */
   55.28 -
   55.29 -
   55.30 -package sun.tools.javap;
   55.31 -
   55.32 -import java.util.*;
   55.33 -import java.io.*;
   55.34 -
   55.35 -/**
   55.36 - * Returns java type signature.
   55.37 - *
   55.38 - * @author  Sucheta Dambalkar
   55.39 - */
   55.40 -public class TypeSignature {
   55.41 -
   55.42 -    String parameters = null;
   55.43 -    String returntype = null;
   55.44 -    String fieldtype = null;
   55.45 -    int argumentlength = 0;
   55.46 -
   55.47 -    public TypeSignature(String JVMSignature){
   55.48 -
   55.49 -        if(JVMSignature != null){
   55.50 -            if(JVMSignature.indexOf("(") == -1){
   55.51 -                //This is a field type.
   55.52 -                this.fieldtype = getFieldTypeSignature(JVMSignature);
   55.53 -            }else {
   55.54 -                String parameterdes = null;
   55.55 -                if((JVMSignature.indexOf(")")-1) > (JVMSignature.indexOf("("))){
   55.56 -                    //Get parameter signature.
   55.57 -                    parameterdes =
   55.58 -                        JVMSignature.substring(JVMSignature.indexOf("(")+1,
   55.59 -                                               JVMSignature.indexOf(")"));
   55.60 -                    this.parameters = getParametersHelper(parameterdes);
   55.61 -                }else this.parameters = "()";
   55.62 -                //Get return type signature.
   55.63 -                String returndes = JVMSignature.substring(JVMSignature.lastIndexOf(")")+1);
   55.64 -                this.returntype = getReturnTypeHelper(returndes);
   55.65 -            }
   55.66 -        }
   55.67 -    }
   55.68 -
   55.69 -    /**
   55.70 -     * Returns java type signature of a field.
   55.71 -     */
   55.72 -    public String getFieldTypeSignature(String fielddes){
   55.73 -        if(fielddes.startsWith("L")){
   55.74 -            return(getObjectType(fielddes));
   55.75 -        }else if(fielddes.startsWith("[")){
   55.76 -            return(getArrayType(fielddes));
   55.77 -        }else
   55.78 -            return(getBaseType(fielddes));
   55.79 -    }
   55.80 -
   55.81 -    /**
   55.82 -     * Returns java type signature of a parameter.
   55.83 -     */
   55.84 -    public String getParametersHelper(String parameterdes){
   55.85 -        Vector<String> parameters = new Vector<String>();
   55.86 -        int startindex = -1;
   55.87 -        int endindex = -1;
   55.88 -        String param = "";
   55.89 -
   55.90 -        while(parameterdes != null){
   55.91 -
   55.92 -            if(parameterdes.startsWith("L")){
   55.93 -                //parameter is a object.
   55.94 -                startindex = parameterdes.indexOf("L");
   55.95 -                endindex = parameterdes.indexOf(";");
   55.96 -                if(startindex < parameterdes.length()) {
   55.97 -                    if(endindex == parameterdes.length()-1) {
   55.98 -                        //last parameter
   55.99 -                        param = parameterdes.substring(startindex);
  55.100 -                        parameterdes = null;
  55.101 -                    }else if(endindex+1 < parameterdes.length()){
  55.102 -                        //rest parameters
  55.103 -                        param = parameterdes.substring(startindex, endindex+1);
  55.104 -                        parameterdes = parameterdes.substring(endindex+1);
  55.105 -
  55.106 -                    }
  55.107 -                    parameters.add(getObjectType(param));
  55.108 -                }
  55.109 -            }else if(parameterdes.startsWith("[")){
  55.110 -                //parameter is an array.
  55.111 -                String componentType = "";
  55.112 -                int enddim = -1;
  55.113 -                int st = 0;
  55.114 -                while(true){
  55.115 -                    if(st < parameterdes.length()){
  55.116 -                        if(parameterdes.charAt(st) == '['){
  55.117 -
  55.118 -                            enddim = st;
  55.119 -                            st++;
  55.120 -                        }
  55.121 -                        else break;
  55.122 -                    }
  55.123 -                    else break;
  55.124 -                }
  55.125 -
  55.126 -                if(enddim+1 < parameterdes.length()){
  55.127 -                    /* Array dimension.*/
  55.128 -                    param = parameterdes.substring(0,enddim+1);
  55.129 -
  55.130 -                }
  55.131 -
  55.132 -                int stotherparam = param.lastIndexOf("[")+1;
  55.133 -
  55.134 -                if(stotherparam < parameterdes.length()){
  55.135 -                    componentType =  parameterdes.substring(stotherparam);
  55.136 -                }
  55.137 -
  55.138 -                if(componentType.startsWith("L")){
  55.139 -                    //parameter is array of objects.
  55.140 -                    startindex = parameterdes.indexOf("L");
  55.141 -                    endindex = parameterdes.indexOf(";");
  55.142 -
  55.143 -                    if(endindex ==  parameterdes.length()-1){
  55.144 -                        //last parameter
  55.145 -                        param += parameterdes.substring(startindex);
  55.146 -                        parameterdes = null;
  55.147 -                    }else if(endindex+1 <  parameterdes.length()){
  55.148 -                        //rest parameters
  55.149 -                        param += parameterdes.substring(startindex, endindex+1);
  55.150 -                        parameterdes = parameterdes.substring(endindex+1);
  55.151 -                    }
  55.152 -                }else{
  55.153 -                    //parameter is array of base type.
  55.154 -                    if(componentType.length() == 1){
  55.155 -                        //last parameter.
  55.156 -                        param += componentType;
  55.157 -                        parameterdes = null;
  55.158 -                    }
  55.159 -                    else if (componentType.length() > 1) {
  55.160 -                        //rest parameters.
  55.161 -                        param += componentType.substring(0,1);
  55.162 -                        parameterdes = componentType.substring(1);
  55.163 -                    }
  55.164 -                }
  55.165 -                parameters.add(getArrayType(param));
  55.166 -
  55.167 -
  55.168 -            }else {
  55.169 -
  55.170 -                //parameter is of base type.
  55.171 -                if(parameterdes.length() == 1){
  55.172 -                    //last parameter
  55.173 -                    param = parameterdes;
  55.174 -                    parameterdes = null;
  55.175 -                }
  55.176 -                else if (parameterdes.length() > 1) {
  55.177 -                    //rest parameters.
  55.178 -                    param = parameterdes.substring(0,1);
  55.179 -                    parameterdes = parameterdes.substring(1);
  55.180 -                }
  55.181 -                parameters.add(getBaseType(param));
  55.182 -            }
  55.183 -        }
  55.184 -
  55.185 -        /* number of arguments of a method.*/
  55.186 -        argumentlength =  parameters.size();
  55.187 -
  55.188 -        /* java type signature.*/
  55.189 -        String parametersignature = "(";
  55.190 -        int i;
  55.191 -
  55.192 -        for(i = 0; i < parameters.size(); i++){
  55.193 -            parametersignature += parameters.elementAt(i);
  55.194 -            if(i != parameters.size()-1){
  55.195 -                parametersignature += ", ";
  55.196 -            }
  55.197 -        }
  55.198 -        parametersignature += ")";
  55.199 -        return parametersignature;
  55.200 -    }
  55.201 -
  55.202 -    /**
  55.203 -     * Returns java type signature for a return type.
  55.204 -     */
  55.205 -    public String getReturnTypeHelper(String returndes){
  55.206 -        return getFieldTypeSignature(returndes);
  55.207 -    }
  55.208 -
  55.209 -    /**
  55.210 -     * Returns java type signature for a base type.
  55.211 -     */
  55.212 -    public String getBaseType(String baseType){
  55.213 -        if(baseType != null){
  55.214 -            if(baseType.equals("B")) return "byte";
  55.215 -            else if(baseType.equals("C")) return "char";
  55.216 -            else if(baseType.equals("D")) return "double";
  55.217 -            else if(baseType.equals("F")) return "float";
  55.218 -            else if(baseType.equals("I")) return "int";
  55.219 -            else if(baseType.equals("J")) return "long";
  55.220 -            else if(baseType.equals("S")) return "short";
  55.221 -            else if(baseType.equals("Z")) return "boolean";
  55.222 -            else if(baseType.equals("V")) return "void";
  55.223 -        }
  55.224 -        return null;
  55.225 -    }
  55.226 -
  55.227 -    /**
  55.228 -     * Returns java type signature for a object type.
  55.229 -     */
  55.230 -    public String getObjectType(String JVMobjectType) {
  55.231 -        String objectType = "";
  55.232 -        int startindex = JVMobjectType.indexOf("L")+1;
  55.233 -        int endindex =  JVMobjectType.indexOf(";");
  55.234 -        if((startindex != -1) && (endindex != -1)){
  55.235 -            if((startindex < JVMobjectType.length()) && (endindex < JVMobjectType.length())){
  55.236 -                objectType = JVMobjectType.substring(startindex, endindex);
  55.237 -            }
  55.238 -            objectType = objectType.replace('/','.');
  55.239 -            return objectType;
  55.240 -        }
  55.241 -        return null;
  55.242 -    }
  55.243 -
  55.244 -    /**
  55.245 -     * Returns java type signature for array type.
  55.246 -     */
  55.247 -    public String getArrayType(String arrayType) {
  55.248 -        if(arrayType != null){
  55.249 -            String dimention = "";
  55.250 -
  55.251 -            while(arrayType.indexOf("[") != -1){
  55.252 -                dimention += "[]";
  55.253 -
  55.254 -                int startindex = arrayType.indexOf("[")+1;
  55.255 -                if(startindex <= arrayType.length()){
  55.256 -                arrayType = arrayType.substring(startindex);
  55.257 -                }
  55.258 -            }
  55.259 -
  55.260 -            String componentType = "";
  55.261 -            if(arrayType.startsWith("L")){
  55.262 -                componentType = getObjectType(arrayType);
  55.263 -            }else {
  55.264 -                componentType = getBaseType(arrayType);
  55.265 -            }
  55.266 -            return componentType+dimention;
  55.267 -        }
  55.268 -        return null;
  55.269 -    }
  55.270 -
  55.271 -    /**
  55.272 -     * Returns java type signature for parameters.
  55.273 -     */
  55.274 -     public String getParameters(){
  55.275 -        return parameters;
  55.276 -    }
  55.277 -
  55.278 -    /**
  55.279 -     * Returns java type signature for return type.
  55.280 -     */
  55.281 -    public String getReturnType(){
  55.282 -        return returntype;
  55.283 -    }
  55.284 -
  55.285 -    /**
  55.286 -     * Returns java type signature for field type.
  55.287 -     */
  55.288 -    public String getFieldType(){
  55.289 -        return fieldtype;
  55.290 -    }
  55.291 -
  55.292 -    /**
  55.293 -     * Return number of arguments of a method.
  55.294 -     */
  55.295 -    public int getArgumentlength(){
  55.296 -        return argumentlength;
  55.297 -    }
  55.298 -}
    56.1 --- a/test/com/sun/javadoc/testIndex/TestIndex.java	Thu Jun 11 10:54:31 2009 -0700
    56.2 +++ b/test/com/sun/javadoc/testIndex/TestIndex.java	Thu Jun 11 21:35:12 2009 -0700
    56.3 @@ -41,7 +41,7 @@
    56.4  
    56.5      //Javadoc arguments.
    56.6      private static final String[] ARGS = new String[] {
    56.7 -        "-d", BUG_ID, "-source", "1.5", "-sourcepath", SRC_DIR, "pkg", SRC_DIR + FS + "NoPackage.java"
    56.8 +        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg", SRC_DIR + FS + "NoPackage.java"
    56.9      };
   56.10  
   56.11      //Input for string search tests.
    57.1 --- a/test/com/sun/javadoc/testInterface/TestInterface.java	Thu Jun 11 10:54:31 2009 -0700
    57.2 +++ b/test/com/sun/javadoc/testInterface/TestInterface.java	Thu Jun 11 21:35:12 2009 -0700
    57.3 @@ -42,7 +42,7 @@
    57.4  
    57.5      //Javadoc arguments.
    57.6      private static final String[] ARGS = new String[] {
    57.7 -        "-source", "1.5", "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"
    57.8 +        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"
    57.9      };
   57.10  
   57.11      //Input for string search tests.
    58.1 --- a/test/com/sun/javadoc/testNavagation/TestNavagation.java	Thu Jun 11 10:54:31 2009 -0700
    58.2 +++ b/test/com/sun/javadoc/testNavagation/TestNavagation.java	Thu Jun 11 21:35:12 2009 -0700
    58.3 @@ -40,7 +40,7 @@
    58.4  
    58.5      //Javadoc arguments.
    58.6      private static final String[] ARGS = new String[] {
    58.7 -        "-d", BUG_ID, "-sourcepath", SRC_DIR, "-source", "1.5", "pkg"
    58.8 +        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"
    58.9      };
   58.10  
   58.11      //Input for string search tests.
    59.1 --- a/test/com/sun/javadoc/testTagInheritence/TestTagInheritence.java	Thu Jun 11 10:54:31 2009 -0700
    59.2 +++ b/test/com/sun/javadoc/testTagInheritence/TestTagInheritence.java	Thu Jun 11 21:35:12 2009 -0700
    59.3 @@ -36,7 +36,7 @@
    59.4  
    59.5      private static final String BUG_ID = "4496223-4496270-4618686-4720974-4812240-6253614-6253604";
    59.6      private static final String[] ARGS = new String[] {
    59.7 -        "-source", "1.5", "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg", "firstSentence", "firstSentence2"
    59.8 +        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg", "firstSentence", "firstSentence2"
    59.9      };
   59.10  
   59.11      /**
    60.1 --- a/test/tools/javac/5005368.java	Thu Jun 11 10:54:31 2009 -0700
    60.2 +++ b/test/tools/javac/5005368.java	Thu Jun 11 21:35:12 2009 -0700
    60.3 @@ -27,8 +27,8 @@
    60.4   * @summary com/sun/tools/javac/comp/Check.java refers to the undefined resource
    60.5   * @author gafter
    60.6   *
    60.7 - * @compile      -source 1.5 -Werror                  5005368.java
    60.8 - * @compile/fail -source 1.5 -Werror -Xlint:unchecked 5005368.java
    60.9 + * @compile      -Werror                  5005368.java
   60.10 + * @compile/fail -Werror -Xlint:unchecked 5005368.java
   60.11   */
   60.12  
   60.13  package p5005368;
    61.1 --- a/test/tools/javac/6304921/T6304921.java	Thu Jun 11 10:54:31 2009 -0700
    61.2 +++ b/test/tools/javac/6304921/T6304921.java	Thu Jun 11 21:35:12 2009 -0700
    61.3 @@ -1,7 +1,7 @@
    61.4  /*
    61.5   * @test (important: no SCCS keywords to affect offsets in golden file.)  /nodynamiccopyright/
    61.6   * @bug 6304921
    61.7 - * @compile/fail/ref=T6304921.out -XDstdout -XDcompilePolicy=bytodo -XDdiags=%b:%s/%o/%e:%_%t%m|%p%m -Xjcov -Xlint:all,-path -Werror T6304921.java
    61.8 + * @compile/fail/ref=T6304921.out -XDstdout -XDcompilePolicy=bytodo -XDrawDiagnostics -Xjcov -Xlint:all,-path -Werror T6304921.java
    61.9   */
   61.10  
   61.11  import java.util.ArrayList;
    62.1 --- a/test/tools/javac/6304921/T6304921.out	Thu Jun 11 10:54:31 2009 -0700
    62.2 +++ b/test/tools/javac/6304921/T6304921.out	Thu Jun 11 21:35:12 2009 -0700
    62.3 @@ -1,20 +1,7 @@
    62.4 -T6304921.java:671/671/680: warning: [rawtypes] found raw type: java.util.ArrayList
    62.5 -        List<Integer> list = new ArrayList();
    62.6 -                                 ^
    62.7 -  missing type parameters for generic class java.util.ArrayList<E>
    62.8 -T6304921.java:667/667/682: warning: [unchecked] unchecked conversion
    62.9 -        List<Integer> list = new ArrayList();
   62.10 -                             ^
   62.11 -  required: java.util.List<java.lang.Integer>
   62.12 -  found:    java.util.ArrayList
   62.13 -error: warnings found and -Werror specified
   62.14 -T6304921.java:727/733/737: cannot find symbol
   62.15 -        System.orr.println("abc"); // name not found
   62.16 -              ^
   62.17 -  symbol:   variable orr
   62.18 -  location: class java.lang.System
   62.19 -T6304921.java:812/816/822: operator + cannot be applied to int,boolean
   62.20 -        return 123 + true; // bad binary expression
   62.21 -                   ^
   62.22 +T6304921.java:29:34: compiler.warn.raw.class.use: java.util.ArrayList, java.util.ArrayList<E>
   62.23 +T6304921.java:29:30: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.util.ArrayList, java.util.List<java.lang.Integer>
   62.24 +- compiler.err.warnings.and.werror
   62.25 +T6304921.java:35:15: compiler.err.cant.resolve.location: kindname.variable, orr, , , kindname.class, java.lang.System
   62.26 +T6304921.java:38:20: compiler.err.operator.cant.be.applied: +, int,boolean
   62.27  3 errors
   62.28  2 warnings
    63.1 --- a/test/tools/javac/6341866/Anno.java	Thu Jun 11 10:54:31 2009 -0700
    63.2 +++ b/test/tools/javac/6341866/Anno.java	Thu Jun 11 21:35:12 2009 -0700
    63.3 @@ -27,7 +27,7 @@
    63.4  import javax.lang.model.element.*;
    63.5  
    63.6  @SupportedAnnotationTypes("*")
    63.7 -    @SupportedSourceVersion(SourceVersion.RELEASE_6)
    63.8 +    @SupportedSourceVersion(SourceVersion.RELEASE_7)
    63.9  public class Anno extends AbstractProcessor {
   63.10      public boolean process(Set<? extends TypeElement> annotations,
   63.11                                      RoundEnvironment roundEnv) {
    64.1 --- a/test/tools/javac/6464451/BigFinally.java	Thu Jun 11 10:54:31 2009 -0700
    64.2 +++ b/test/tools/javac/6464451/BigFinally.java	Thu Jun 11 21:35:12 2009 -0700
    64.3 @@ -26,7 +26,7 @@
    64.4   * @bug     6464451
    64.5   * @summary javac in 5.0ux can not compile try-finally block which has a lot of "return"
    64.6   * @author  Wei Tao
    64.7 - * @compile -target 5 BigFinally.java
    64.8 + * @compile -source 5 -target 5 BigFinally.java
    64.9   * @clean BigFinally
   64.10   * @compile/fail BigFinally.java
   64.11   */
    65.1 --- a/test/tools/javac/6464451/DeepNestedFinally.java	Thu Jun 11 10:54:31 2009 -0700
    65.2 +++ b/test/tools/javac/6464451/DeepNestedFinally.java	Thu Jun 11 21:35:12 2009 -0700
    65.3 @@ -26,7 +26,7 @@
    65.4   * @bug     6464451
    65.5   * @summary javac in 5.0ux can not compile try-finally block which has a lot of "return"
    65.6   * @author  Wei Tao
    65.7 - * @compile -target 5 DeepNestedFinally.java
    65.8 + * @compile -source 5 -target 5 DeepNestedFinally.java
    65.9   * @clean DeepNestedFinally
   65.10   * @compile/fail DeepNestedFinally.java
   65.11   */
    66.1 --- a/test/tools/javac/6464451/ManyExitsInTry.java	Thu Jun 11 10:54:31 2009 -0700
    66.2 +++ b/test/tools/javac/6464451/ManyExitsInTry.java	Thu Jun 11 21:35:12 2009 -0700
    66.3 @@ -26,7 +26,7 @@
    66.4   * @bug     6464451
    66.5   * @summary javac in 5.0ux can not compile try-finally block which has a lot of "return"
    66.6   * @author  Wei Tao
    66.7 - * @compile -target 5 ManyExitsInTry.java
    66.8 + * @compile -source 5 -target 5 ManyExitsInTry.java
    66.9   * @clean ManyExitsInTry
   66.10   * @compile/fail ManyExitsInTry.java
   66.11   */
    67.1 --- a/test/tools/javac/6491592/T6491592.out	Thu Jun 11 10:54:31 2009 -0700
    67.2 +++ b/test/tools/javac/6491592/T6491592.out	Thu Jun 11 21:35:12 2009 -0700
    67.3 @@ -1,2 +1,2 @@
    67.4 -T6491592.java:12:11: compiler.err.operator.cant.be.applied: +, java.lang.Object,<nulltype>
    67.5 +T6491592.java:12:11: compiler.err.operator.cant.be.applied: +, java.lang.Object,compiler.misc.type.null
    67.6  1 error
    68.1 --- a/test/tools/javac/Ambig3.java	Thu Jun 11 10:54:31 2009 -0700
    68.2 +++ b/test/tools/javac/Ambig3.java	Thu Jun 11 21:35:12 2009 -0700
    68.3 @@ -27,7 +27,7 @@
    68.4   * @summary Missing ambiguity error when two methods are equally specific
    68.5   * @author gafter
    68.6   *
    68.7 - * @compile/fail -source 1.5 Ambig3.java
    68.8 + * @compile/fail Ambig3.java
    68.9   */
   68.10  
   68.11  class Test<T,E> {
    69.1 --- a/test/tools/javac/ArrayCast.java	Thu Jun 11 10:54:31 2009 -0700
    69.2 +++ b/test/tools/javac/ArrayCast.java	Thu Jun 11 21:35:12 2009 -0700
    69.3 @@ -28,7 +28,7 @@
    69.4   *          compilation.  This was fixed in 1.2beta2.
    69.5   * @author turnidge
    69.6   *
    69.7 - * @compile -source 1.4 ArrayCast.java
    69.8 + * @compile ArrayCast.java
    69.9   */
   69.10  
   69.11  public class ArrayCast {
    70.1 --- a/test/tools/javac/BadCovar.java	Thu Jun 11 10:54:31 2009 -0700
    70.2 +++ b/test/tools/javac/BadCovar.java	Thu Jun 11 21:35:12 2009 -0700
    70.3 @@ -27,7 +27,7 @@
    70.4   * @summary Compiler allows inheritance of multiple methods with unrelated return types
    70.5   * @author gafter
    70.6   *
    70.7 - * @compile/fail -source 1.5 BadCovar.java
    70.8 + * @compile/fail BadCovar.java
    70.9   */
   70.10  
   70.11  package bad.covar;
    71.1 --- a/test/tools/javac/ClassLit.java	Thu Jun 11 10:54:31 2009 -0700
    71.2 +++ b/test/tools/javac/ClassLit.java	Thu Jun 11 21:35:12 2009 -0700
    71.3 @@ -27,7 +27,7 @@
    71.4   * @summary Use ldc instruction for class literals
    71.5   * @author gafter
    71.6   *
    71.7 - * @compile -target 1.5 ClassLit.java
    71.8 + * @compile -source 1.5 -target 1.5 ClassLit.java
    71.9   * @run main ClassLit
   71.10   */
   71.11  
    72.1 --- a/test/tools/javac/ClassLiterals/InitializeOuter.java	Thu Jun 11 10:54:31 2009 -0700
    72.2 +++ b/test/tools/javac/ClassLiterals/InitializeOuter.java	Thu Jun 11 21:35:12 2009 -0700
    72.3 @@ -27,7 +27,7 @@
    72.4   * @summary Using a class literal causes outermost class to be initialized early
    72.5   * @author gafter
    72.6   *
    72.7 - * @compile -source 1.4 -target 1.4.2 InitializeOuter.java
    72.8 + * @compile InitializeOuter.java
    72.9   * @run main InitializeOuter
   72.10   */
   72.11  
    73.1 --- a/test/tools/javac/ClassLiterals/InitializeTarget.java	Thu Jun 11 10:54:31 2009 -0700
    73.2 +++ b/test/tools/javac/ClassLiterals/InitializeTarget.java	Thu Jun 11 21:35:12 2009 -0700
    73.3 @@ -27,7 +27,7 @@
    73.4   * @summary class literal causes the referenced class to be initialized
    73.5   * @author gafter
    73.6   *
    73.7 - * @compile -source 1.4 -target 1.4.2 InitializeTarget.java
    73.8 + * @compile InitializeTarget.java
    73.9   * @run main InitializeTarget
   73.10   */
   73.11  
    74.1 --- a/test/tools/javac/ClassToTypeParm.java	Thu Jun 11 10:54:31 2009 -0700
    74.2 +++ b/test/tools/javac/ClassToTypeParm.java	Thu Jun 11 21:35:12 2009 -0700
    74.3 @@ -27,7 +27,7 @@
    74.4   * @summary Generics: assignment of Class to type parm's default should elicit error
    74.5   * @author never
    74.6   *
    74.7 - * @compile/fail -source 1.5 ClassToTypeParm.java
    74.8 + * @compile/fail ClassToTypeParm.java
    74.9   */
   74.10  
   74.11  class ClassToTypeParm<T> {
    75.1 --- a/test/tools/javac/Closure1.java	Thu Jun 11 10:54:31 2009 -0700
    75.2 +++ b/test/tools/javac/Closure1.java	Thu Jun 11 21:35:12 2009 -0700
    75.3 @@ -27,7 +27,7 @@
    75.4   * @summary Initialization of up-level links, immediately after super(), occurs too late.
    75.5   * @author gafter
    75.6   *
    75.7 - * @compile -source 1.4 -target 1.4 Closure1.java
    75.8 + * @compile Closure1.java
    75.9   * @run main Closure1
   75.10   */
   75.11  
    76.1 --- a/test/tools/javac/Closure2.java	Thu Jun 11 10:54:31 2009 -0700
    76.2 +++ b/test/tools/javac/Closure2.java	Thu Jun 11 21:35:12 2009 -0700
    76.3 @@ -27,7 +27,7 @@
    76.4   * @summary Initialization of up-level links, immediately after super(), occurs too late.
    76.5   * @author gafter
    76.6   *
    76.7 - * @compile -source 1.4 -target 1.4 Closure2.java
    76.8 + * @compile Closure2.java
    76.9   * @run main Closure2
   76.10   */
   76.11  
    77.1 --- a/test/tools/javac/Closure3.java	Thu Jun 11 10:54:31 2009 -0700
    77.2 +++ b/test/tools/javac/Closure3.java	Thu Jun 11 21:35:12 2009 -0700
    77.3 @@ -27,7 +27,7 @@
    77.4   * @summary Initialization of up-level links, immediately after super(), occurs too late.
    77.5   * @author gafter
    77.6   *
    77.7 - * @compile -source 1.4 -target 1.4 Closure3.java
    77.8 + * @compile Closure3.java
    77.9   * @run main Closure3
   77.10   */
   77.11  
    78.1 --- a/test/tools/javac/Closure4.java	Thu Jun 11 10:54:31 2009 -0700
    78.2 +++ b/test/tools/javac/Closure4.java	Thu Jun 11 21:35:12 2009 -0700
    78.3 @@ -27,7 +27,7 @@
    78.4   * @summary Initialization of up-level links, immediately after super(), occurs too late.
    78.5   * @author gafter
    78.6   *
    78.7 - * @compile -source 1.4 -target 1.4 Closure4.java
    78.8 + * @compile Closure4.java
    78.9   * @run main Closure4
   78.10   */
   78.11  
    79.1 --- a/test/tools/javac/Closure5.java	Thu Jun 11 10:54:31 2009 -0700
    79.2 +++ b/test/tools/javac/Closure5.java	Thu Jun 11 21:35:12 2009 -0700
    79.3 @@ -27,7 +27,7 @@
    79.4   * @summary Incorrect order for initializers in nested class
    79.5   * @author gafter
    79.6   *
    79.7 - * @compile -source 1.4 -target 1.4 Closure5.java
    79.8 + * @compile Closure5.java
    79.9   * @run main Closure5
   79.10   */
   79.11  
    80.1 --- a/test/tools/javac/CompoundBox.java	Thu Jun 11 10:54:31 2009 -0700
    80.2 +++ b/test/tools/javac/CompoundBox.java	Thu Jun 11 21:35:12 2009 -0700
    80.3 @@ -27,7 +27,7 @@
    80.4   * @summary drop compound boxing operations
    80.5   * @author gafter
    80.6   *
    80.7 - * @compile/fail -source 1.5 CompoundBox.java
    80.8 + * @compile/fail CompoundBox.java
    80.9   */
   80.10  
   80.11  class CompoundBox {
    81.1 --- a/test/tools/javac/ConditionalArgTypes_1.java	Thu Jun 11 10:54:31 2009 -0700
    81.2 +++ b/test/tools/javac/ConditionalArgTypes_1.java	Thu Jun 11 21:35:12 2009 -0700
    81.3 @@ -28,7 +28,7 @@
    81.4   * @author maddox
    81.5   *
    81.6   * @compile/fail -source 1.4 ConditionalArgTypes_1.java
    81.7 - * @compile -source 1.5 ConditionalArgTypes_1.java
    81.8 + * @compile                  ConditionalArgTypes_1.java
    81.9   */
   81.10  
   81.11  // This is the problematic case -- the controlling expression is a boolean constant.
    82.1 --- a/test/tools/javac/ConditionalArgTypes_2.java	Thu Jun 11 10:54:31 2009 -0700
    82.2 +++ b/test/tools/javac/ConditionalArgTypes_2.java	Thu Jun 11 21:35:12 2009 -0700
    82.3 @@ -28,7 +28,7 @@
    82.4   * @author maddox
    82.5   *
    82.6   * @compile/fail -source 1.4 ConditionalArgTypes_2.java
    82.7 - * @compile -source 1.5 ConditionalArgTypes_2.java
    82.8 + * @compile                  ConditionalArgTypes_2.java
    82.9   */
   82.10  
   82.11  // This case was working before -- controlling expression is not a constant.
    83.1 --- a/test/tools/javac/DefiniteAssignment/DUAssert.java	Thu Jun 11 10:54:31 2009 -0700
    83.2 +++ b/test/tools/javac/DefiniteAssignment/DUAssert.java	Thu Jun 11 21:35:12 2009 -0700
    83.3 @@ -22,12 +22,12 @@
    83.4   */
    83.5  
    83.6  /*
    83.7 - * @test %E
    83.8 + * @test
    83.9   * @bug 4478838 4533580
   83.10   * @summary Check correct handling of DU in assert statements
   83.11   * @author Neal Gafter (gafter)
   83.12   *
   83.13 - * @run compile -source 1.4 DUAssert.java
   83.14 + * @run compile DUAssert.java
   83.15   */
   83.16  
   83.17  class DUSwitch {
    84.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    84.2 +++ b/test/tools/javac/Diagnostics/6722234/T6722234a.java	Thu Jun 11 21:35:12 2009 -0700
    84.3 @@ -0,0 +1,38 @@
    84.4 +/*
    84.5 + * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
    84.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    84.7 + *
    84.8 + * This code is free software; you can redistribute it and/or modify it
    84.9 + * under the terms of the GNU General Public License version 2 only, as
   84.10 + * published by the Free Software Foundation.
   84.11 + *
   84.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   84.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   84.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   84.15 + * version 2 for more details (a copy is included in the LICENSE file that
   84.16 + * accompanied this code).
   84.17 + *
   84.18 + * You should have received a copy of the GNU General Public License version
   84.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   84.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   84.21 + *
   84.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   84.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   84.24 + * have any questions.
   84.25 + */
   84.26 +
   84.27 +/**
   84.28 + * @test
   84.29 + * @bug     6722234
   84.30 + * @summary javac diagnostics need better integration with the type-system
   84.31 + * @author  mcimadamore
   84.32 + * @compile/fail/ref=T6722234a_1.out -XDrawDiagnostics -XDdiags=disambiguateTvars T6722234a.java
   84.33 + * @compile/fail/ref=T6722234a_2.out -XDrawDiagnostics -XDdiags=disambiguateTvars,where T6722234a.java
   84.34 + */
   84.35 +
   84.36 +class T6722234a<T extends String> {
   84.37 +    <T extends Integer> void test(T t) {
   84.38 +        m(t);
   84.39 +    }
   84.40 +    void m(T t) {}
   84.41 +}
    85.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    85.2 +++ b/test/tools/javac/Diagnostics/6722234/T6722234a_1.out	Thu Jun 11 21:35:12 2009 -0700
    85.3 @@ -0,0 +1,2 @@
    85.4 +T6722234a.java:35:9: compiler.err.cant.apply.symbol: kindname.method, m, compiler.misc.type.var: T, 1, compiler.misc.type.var: T, 2, kindname.class, T6722234a<compiler.misc.type.var: T, 1>, null
    85.5 +1 error
    86.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    86.2 +++ b/test/tools/javac/Diagnostics/6722234/T6722234a_2.out	Thu Jun 11 21:35:12 2009 -0700
    86.3 @@ -0,0 +1,3 @@
    86.4 +T6722234a.java:35:9: compiler.err.cant.apply.symbol: kindname.method, m, compiler.misc.type.var: T, 1, compiler.misc.type.var: T, 2, kindname.class, T6722234a<compiler.misc.type.var: T, 1>, null
    86.5 +- compiler.misc.where.description.typevar.1: compiler.misc.type.var: T, 1,compiler.misc.type.var: T, 2,{(compiler.misc.where.typevar: compiler.misc.type.var: T, 1, java.lang.String, kindname.class, T6722234a),(compiler.misc.where.typevar: compiler.misc.type.var: T, 2, java.lang.Integer, kindname.method, <compiler.misc.type.var: T, 2>test(compiler.misc.type.var: T, 2))}
    86.6 +1 error
    87.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    87.2 +++ b/test/tools/javac/Diagnostics/6722234/T6722234b.java	Thu Jun 11 21:35:12 2009 -0700
    87.3 @@ -0,0 +1,41 @@
    87.4 +/*
    87.5 + * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
    87.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    87.7 + *
    87.8 + * This code is free software; you can redistribute it and/or modify it
    87.9 + * under the terms of the GNU General Public License version 2 only, as
   87.10 + * published by the Free Software Foundation.
   87.11 + *
   87.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   87.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   87.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   87.15 + * version 2 for more details (a copy is included in the LICENSE file that
   87.16 + * accompanied this code).
   87.17 + *
   87.18 + * You should have received a copy of the GNU General Public License version
   87.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   87.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   87.21 + *
   87.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   87.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   87.24 + * have any questions.
   87.25 + */
   87.26 +
   87.27 +/**
   87.28 + * @test
   87.29 + * @bug     6722234
   87.30 + * @summary javac diagnostics need better integration with the type-system
   87.31 + * @author  mcimadamore
   87.32 + * @compile/fail/ref=T6722234b_1.out -XDrawDiagnostics -XDdiags=simpleNames T6722234b.java
   87.33 + * @compile/fail/ref=T6722234b_2.out -XDrawDiagnostics -XDdiags=simpleNames,where T6722234b.java
   87.34 + */
   87.35 +
   87.36 +import java.util.*;
   87.37 +
   87.38 +class T6722234b {
   87.39 +    <T> void m(List<T> l1, List<T> l2) {}
   87.40 +
   87.41 +    void test(List<? extends T6722234b> list) {
   87.42 +        m(list, list);
   87.43 +    }
   87.44 +}
    88.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    88.2 +++ b/test/tools/javac/Diagnostics/6722234/T6722234b_1.out	Thu Jun 11 21:35:12 2009 -0700
    88.3 @@ -0,0 +1,2 @@
    88.4 +T6722234b.java:39:9: compiler.err.cant.apply.symbol: kindname.method, m, List<T>,List<T>, List<compiler.misc.type.captureof: 1, ? extends T6722234b>,List<compiler.misc.type.captureof: 2, ? extends T6722234b>, kindname.class, T6722234b, null
    88.5 +1 error
    89.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    89.2 +++ b/test/tools/javac/Diagnostics/6722234/T6722234b_2.out	Thu Jun 11 21:35:12 2009 -0700
    89.3 @@ -0,0 +1,4 @@
    89.4 +T6722234b.java:39:9: compiler.err.cant.apply.symbol: kindname.method, m, List<T>,List<T>, List<compiler.misc.captured.type: 1>,List<compiler.misc.captured.type: 2>, kindname.class, T6722234b, null
    89.5 +- compiler.misc.where.description.typevar: T,{(compiler.misc.where.typevar: T, Object, kindname.method, <T>m(List<T>,List<T>))}
    89.6 +- compiler.misc.where.description.captured.1: compiler.misc.captured.type: 1,compiler.misc.captured.type: 2,{(compiler.misc.where.captured.1: compiler.misc.captured.type: 1, T6722234b, compiler.misc.type.null, ? extends T6722234b),(compiler.misc.where.captured.1: compiler.misc.captured.type: 2, T6722234b, compiler.misc.type.null, ? extends T6722234b)}
    89.7 +1 error
    90.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    90.2 +++ b/test/tools/javac/Diagnostics/6722234/T6722234c.java	Thu Jun 11 21:35:12 2009 -0700
    90.3 @@ -0,0 +1,39 @@
    90.4 +/*
    90.5 + * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
    90.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    90.7 + *
    90.8 + * This code is free software; you can redistribute it and/or modify it
    90.9 + * under the terms of the GNU General Public License version 2 only, as
   90.10 + * published by the Free Software Foundation.
   90.11 + *
   90.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   90.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   90.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   90.15 + * version 2 for more details (a copy is included in the LICENSE file that
   90.16 + * accompanied this code).
   90.17 + *
   90.18 + * You should have received a copy of the GNU General Public License version
   90.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   90.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   90.21 + *
   90.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   90.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   90.24 + * have any questions.
   90.25 + */
   90.26 +
   90.27 +/**
   90.28 + * @test
   90.29 + * @bug     6722234
   90.30 + * @summary javac diagnostics need better integration with the type-system
   90.31 + * @author  mcimadamore
   90.32 + * @compile/fail/ref=T6722234c.out -XDrawDiagnostics -XDdiags=simpleNames T6722234c.java
   90.33 + */
   90.34 +
   90.35 +class T6722234c {
   90.36 +    static class String {}
   90.37 +    <T> void m(String s2) {}
   90.38 +
   90.39 +    void test() {
   90.40 +        m("");
   90.41 +    }
   90.42 +}
    91.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    91.2 +++ b/test/tools/javac/Diagnostics/6722234/T6722234c.out	Thu Jun 11 21:35:12 2009 -0700
    91.3 @@ -0,0 +1,2 @@
    91.4 +T6722234c.java:37:9: compiler.err.cant.apply.symbol: kindname.method, m, T6722234c.String, java.lang.String, kindname.class, T6722234c, null
    91.5 +1 error
    92.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    92.2 +++ b/test/tools/javac/Diagnostics/6722234/T6722234d.java	Thu Jun 11 21:35:12 2009 -0700
    92.3 @@ -0,0 +1,44 @@
    92.4 +/*
    92.5 + * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
    92.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    92.7 + *
    92.8 + * This code is free software; you can redistribute it and/or modify it
    92.9 + * under the terms of the GNU General Public License version 2 only, as
   92.10 + * published by the Free Software Foundation.
   92.11 + *
   92.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   92.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   92.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   92.15 + * version 2 for more details (a copy is included in the LICENSE file that
   92.16 + * accompanied this code).
   92.17 + *
   92.18 + * You should have received a copy of the GNU General Public License version
   92.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   92.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   92.21 + *
   92.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   92.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   92.24 + * have any questions.
   92.25 + */
   92.26 +
   92.27 +/**
   92.28 + * @test
   92.29 + * @bug     6722234
   92.30 + * @summary javac diagnostics need better integration with the type-system
   92.31 + * @author  mcimadamore
   92.32 + * @compile/fail/ref=T6722234d_1.out -XDrawDiagnostics -XDdiags=where T6722234d.java
   92.33 + * @compile/fail/ref=T6722234d_2.out -XDrawDiagnostics -XDdiags=where,simpleNames T6722234d.java
   92.34 + */
   92.35 +
   92.36 +class T6722234d {
   92.37 +    interface I1 {}
   92.38 +    interface I2 {}
   92.39 +    class A implements I1, I2 {}
   92.40 +    class B implements I1, I2 {}
   92.41 +    class Test {
   92.42 +        <Z> Z m(Z z1, Z z2) { return null; }
   92.43 +        void main(){
   92.44 +            A a = m(new A(), new B());
   92.45 +        }
   92.46 +    }
   92.47 +}
    93.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    93.2 +++ b/test/tools/javac/Diagnostics/6722234/T6722234d_1.out	Thu Jun 11 21:35:12 2009 -0700
    93.3 @@ -0,0 +1,3 @@
    93.4 +T6722234d.java:41:20: compiler.err.prob.found.req: (compiler.misc.incompatible.types), compiler.misc.intersection.type: 1, T6722234d.A
    93.5 +- compiler.misc.where.description.intersection: compiler.misc.intersection.type: 1,{(compiler.misc.where.intersection: compiler.misc.intersection.type: 1, java.lang.Object,T6722234d.I1,T6722234d.I2)}
    93.6 +1 error
    94.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    94.2 +++ b/test/tools/javac/Diagnostics/6722234/T6722234d_2.out	Thu Jun 11 21:35:12 2009 -0700
    94.3 @@ -0,0 +1,3 @@
    94.4 +T6722234d.java:41:20: compiler.err.prob.found.req: (compiler.misc.incompatible.types), compiler.misc.intersection.type: 1, T6722234d.A
    94.5 +- compiler.misc.where.description.intersection: compiler.misc.intersection.type: 1,{(compiler.misc.where.intersection: compiler.misc.intersection.type: 1, Object,I1,I2)}
    94.6 +1 error
    95.1 --- a/test/tools/javac/EarlyAssert.java	Thu Jun 11 10:54:31 2009 -0700
    95.2 +++ b/test/tools/javac/EarlyAssert.java	Thu Jun 11 21:35:12 2009 -0700
    95.3 @@ -27,9 +27,6 @@
    95.4   * @summary Verify that assertions are enabled before the class is initialized
    95.5   * and not thereafter
    95.6   * @author gafter
    95.7 - *
    95.8 - * @compile -source 1.4 EarlyAssert.java
    95.9 - * @run main EarlyAssert
   95.10   */
   95.11  
   95.12  /*
    96.1 --- a/test/tools/javac/Enum1.java	Thu Jun 11 10:54:31 2009 -0700
    96.2 +++ b/test/tools/javac/Enum1.java	Thu Jun 11 21:35:12 2009 -0700
    96.3 @@ -26,9 +26,6 @@
    96.4   * @bug 4934060
    96.5   * @summary private enum ctor versus specialized enum constant crashes javac
    96.6   * @author gafter
    96.7 - *
    96.8 - * @compile -source 1.5 Enum1.java
    96.9 - * @run main Enum1
   96.10   */
   96.11  
   96.12  public enum Enum1 {
    97.1 --- a/test/tools/javac/ExtendArray.java	Thu Jun 11 10:54:31 2009 -0700
    97.2 +++ b/test/tools/javac/ExtendArray.java	Thu Jun 11 21:35:12 2009 -0700
    97.3 @@ -3,7 +3,7 @@
    97.4   * @bug 4336282 4785453
    97.5   * @summary Verify that extending an erray class does not crash the compiler.
    97.6   *
    97.7 - * @compile/fail/ref=ExtendArray.out -XDstdout -XDdiags=%b:%l:%_%m ExtendArray.java
    97.8 + * @compile/fail/ref=ExtendArray.out -XDstdout -XDrawDiagnostics ExtendArray.java
    97.9   */
   97.10  
   97.11  // Note that an error is expected, but not a crash.
    98.1 --- a/test/tools/javac/ExtendArray.out	Thu Jun 11 10:54:31 2009 -0700
    98.2 +++ b/test/tools/javac/ExtendArray.out	Thu Jun 11 21:35:12 2009 -0700
    98.3 @@ -1,6 +1,2 @@
    98.4 -ExtendArray.java:11: unexpected type
    98.5 -public class ExtendArray extends Object[] {}
    98.6 -                                       ^
    98.7 -  required: class
    98.8 -  found:    java.lang.Object[]
    98.9 +ExtendArray.java:11:40: compiler.err.type.found.req: java.lang.Object[], (compiler.misc.type.req.class)
   98.10  1 error
    99.1 --- a/test/tools/javac/GoodCovar.java	Thu Jun 11 10:54:31 2009 -0700
    99.2 +++ b/test/tools/javac/GoodCovar.java	Thu Jun 11 21:35:12 2009 -0700
    99.3 @@ -27,7 +27,7 @@
    99.4   * @summary multiple methods inheritence
    99.5   * @author gafter
    99.6   *
    99.7 - * @compile -source 1.5 GoodCovar.java
    99.8 + * @compile GoodCovar.java
    99.9   */
   99.10  
   99.11  package good.covar;
   100.1 --- a/test/tools/javac/HexFloatLiterals.java	Thu Jun 11 10:54:31 2009 -0700
   100.2 +++ b/test/tools/javac/HexFloatLiterals.java	Thu Jun 11 21:35:12 2009 -0700
   100.3 @@ -26,9 +26,6 @@
   100.4   * @bug 4920023
   100.5   * @summary add "hexadecimal floating-point literal" support to javac as per 4896828
   100.6   * @author gafter
   100.7 - *
   100.8 - * @compile -source 1.5 HexFloatLiterals.java
   100.9 - * @run main HexFloatLiterals
  100.10   */
  100.11  
  100.12  public class HexFloatLiterals {
   101.1 --- a/test/tools/javac/HexThree.java	Thu Jun 11 10:54:31 2009 -0700
   101.2 +++ b/test/tools/javac/HexThree.java	Thu Jun 11 21:35:12 2009 -0700
   101.3 @@ -26,9 +26,6 @@
   101.4   * @bug 4920023
   101.5   * @summary Test hex floating-point literals
   101.6   * @author darcy
   101.7 - *
   101.8 - * @compile -source 1.5 HexThree.java
   101.9 - * @run main HexThree
  101.10   */
  101.11  
  101.12  public class HexThree {
   102.1 --- a/test/tools/javac/InterfaceAssert.java	Thu Jun 11 10:54:31 2009 -0700
   102.2 +++ b/test/tools/javac/InterfaceAssert.java	Thu Jun 11 21:35:12 2009 -0700
   102.3 @@ -26,9 +26,6 @@
   102.4   * @bug 4399129
   102.5   * @summary Check that assertions compile properly when nested in an interface
   102.6   * @author gafter
   102.7 - *
   102.8 - * @compile -source 1.4 InterfaceAssert.java
   102.9 - * @run main InterfaceAssert
  102.10   */
  102.11  
  102.12  /*
   103.1 --- a/test/tools/javac/InvalidIntfCast.java	Thu Jun 11 10:54:31 2009 -0700
   103.2 +++ b/test/tools/javac/InvalidIntfCast.java	Thu Jun 11 21:35:12 2009 -0700
   103.3 @@ -27,7 +27,7 @@
   103.4   * @summary The compiler should detect an invalid cast between interfaces.
   103.5   * @author turnidge
   103.6   *
   103.7 - * @compile -source 1.5 InvalidIntfCast.java
   103.8 + * @compile InvalidIntfCast.java
   103.9   */
  103.10  
  103.11  interface I {
   104.1 --- a/test/tools/javac/NewGeneric.java	Thu Jun 11 10:54:31 2009 -0700
   104.2 +++ b/test/tools/javac/NewGeneric.java	Thu Jun 11 21:35:12 2009 -0700
   104.3 @@ -27,7 +27,7 @@
   104.4   * @summary unclear diagnostic for "new T()"
   104.5   * @author never
   104.6   *
   104.7 - * @compile/fail -source 1.5 NewGeneric.java
   104.8 + * @compile/fail NewGeneric.java
   104.9   */
  104.10  
  104.11  
   105.1 --- a/test/tools/javac/ObjectMethodRefFromInterface.java	Thu Jun 11 10:54:31 2009 -0700
   105.2 +++ b/test/tools/javac/ObjectMethodRefFromInterface.java	Thu Jun 11 21:35:12 2009 -0700
   105.3 @@ -27,9 +27,6 @@
   105.4   * @summary Verify that access to member of java.lang.Object via qualification of
   105.5   * object of an interface type is handled successfully.
   105.6   * @author maddox
   105.7 - *
   105.8 - * @run compile -source 1.3 -target 1.2 -g ObjectMethodRefFromInterface.java
   105.9 - * @run main/othervm ObjectMethodRefFromInterface
  105.10   */
  105.11  
  105.12  public class ObjectMethodRefFromInterface {
   106.1 --- a/test/tools/javac/OverridePosition.java	Thu Jun 11 10:54:31 2009 -0700
   106.2 +++ b/test/tools/javac/OverridePosition.java	Thu Jun 11 21:35:12 2009 -0700
   106.3 @@ -4,7 +4,7 @@
   106.4   * @summary "attemping to assign weaker access" message doesn't give method line number
   106.5   * @author Neal Gafter
   106.6   *
   106.7 - * @compile/fail/ref=OverridePosition.out -XDstdout -XDdiags=%b:%l:%_%m OverridePosition.java
   106.8 + * @compile/fail/ref=OverridePosition.out -XDstdout -XDrawDiagnostics OverridePosition.java
   106.9   */
  106.10  
  106.11  package T4524388;
   107.1 --- a/test/tools/javac/OverridePosition.out	Thu Jun 11 10:54:31 2009 -0700
   107.2 +++ b/test/tools/javac/OverridePosition.out	Thu Jun 11 21:35:12 2009 -0700
   107.3 @@ -1,7 +1,3 @@
   107.4 -OverridePosition.java:17: method() in T4524388.Testa cannot implement method() in T4524388.Interface; attempting to assign weaker access privileges; was public
   107.5 -    void method() {}
   107.6 -         ^
   107.7 -OverridePosition.java:24: method() in T4524388.A cannot implement method() in T4524388.Interface; attempting to assign weaker access privileges; was public
   107.8 -class B extends A implements Interface {
   107.9 -^
  107.10 +OverridePosition.java:17:10: compiler.err.override.weaker.access: (compiler.misc.cant.implement: method(), T4524388.Testa, method(), T4524388.Interface), public
  107.11 +OverridePosition.java:24:1: compiler.err.override.weaker.access: (compiler.misc.cant.implement: method(), T4524388.A, method(), T4524388.Interface), public
  107.12  2 errors
   108.1 --- a/test/tools/javac/PrivateLocalConstructor.java	Thu Jun 11 10:54:31 2009 -0700
   108.2 +++ b/test/tools/javac/PrivateLocalConstructor.java	Thu Jun 11 21:35:12 2009 -0700
   108.3 @@ -26,9 +26,6 @@
   108.4   * @bug 4365809
   108.5   * @summary Incorrect access method for private constructor in local class.
   108.6   * @author gafter
   108.7 - *
   108.8 - * @compile -source 1.4 -target 1.4 PrivateLocalConstructor.java
   108.9 - * @run main PrivateLocalConstructor
  108.10   */
  108.11  
  108.12  public class PrivateLocalConstructor {
   109.1 --- a/test/tools/javac/RawCrash.java	Thu Jun 11 10:54:31 2009 -0700
   109.2 +++ b/test/tools/javac/RawCrash.java	Thu Jun 11 21:35:12 2009 -0700
   109.3 @@ -27,7 +27,7 @@
   109.4   * @summary compiler crash with raw instantiation of generic inner class
   109.5   * @author gafter
   109.6   *
   109.7 - * @compile -source 1.5 RawCrash.java
   109.8 + * @compile RawCrash.java
   109.9   */
  109.10  
  109.11  class A<E> {
   110.1 --- a/test/tools/javac/SynthName2.java	Thu Jun 11 10:54:31 2009 -0700
   110.2 +++ b/test/tools/javac/SynthName2.java	Thu Jun 11 21:35:12 2009 -0700
   110.3 @@ -27,7 +27,7 @@
   110.4   * @summary using of synthetic names in local class causes ClassFormatError
   110.5   * @author gafter
   110.6   *
   110.7 - * @compile/fail -source 1.4 -target 1.4 SynthName2.java
   110.8 + * @compile/fail SynthName2.java
   110.9   */
  110.10  
  110.11  import java.io.PrintStream;
   111.1 --- a/test/tools/javac/T4093617/T4093617.java	Thu Jun 11 10:54:31 2009 -0700
   111.2 +++ b/test/tools/javac/T4093617/T4093617.java	Thu Jun 11 21:35:12 2009 -0700
   111.3 @@ -3,7 +3,7 @@
   111.4   * @bug     4093617
   111.5   * @summary Object has no superclass
   111.6   * @author  Peter von der Ah\u00e9
   111.7 - * @compile/fail/ref=T4093617.out -XDstdout -XDdiags=%b:%l:%_%m T4093617.java
   111.8 + * @compile/fail/ref=T4093617.out -XDstdout -XDrawDiagnostics T4093617.java
   111.9   */
  111.10  
  111.11  package java.lang;
   112.1 --- a/test/tools/javac/T4093617/T4093617.out	Thu Jun 11 10:54:31 2009 -0700
   112.2 +++ b/test/tools/javac/T4093617/T4093617.out	Thu Jun 11 21:35:12 2009 -0700
   112.3 @@ -1,4 +1,2 @@
   112.4 -T4093617.java:12: java.lang.Object has no superclass
   112.5 -    Object() { super(); }
   112.6 -               ^
   112.7 +T4093617.java:12:16: compiler.err.no.superclass: java.lang.Object
   112.8  1 error
   113.1 --- a/test/tools/javac/T5003235/T5003235c.java	Thu Jun 11 10:54:31 2009 -0700
   113.2 +++ b/test/tools/javac/T5003235/T5003235c.java	Thu Jun 11 21:35:12 2009 -0700
   113.3 @@ -3,7 +3,7 @@
   113.4   * @bug     5003235
   113.5   * @summary Access to private inner classes
   113.6   * @author  Peter von der Ah\u00e9
   113.7 - * @compile/fail/ref=T5003235c.out -XDstdout -XDdiags=%b:%l:%_%m T5003235c.java
   113.8 + * @compile/fail/ref=T5003235c.out -XDstdout -XDrawDiagnostics T5003235c.java
   113.9   */
  113.10  
  113.11  class T5003235c {
   114.1 --- a/test/tools/javac/T5003235/T5003235c.out	Thu Jun 11 10:54:31 2009 -0700
   114.2 +++ b/test/tools/javac/T5003235/T5003235c.out	Thu Jun 11 21:35:12 2009 -0700
   114.3 @@ -1,4 +1,2 @@
   114.4 -T5003235c.java:15: T5003235c.B has private access in T5003235c
   114.5 -class C extends T5003235c.B.Inner {}
   114.6 -                         ^
   114.7 +T5003235c.java:15:26: compiler.err.report.access: T5003235c.B, private, T5003235c
   114.8  1 error
   115.1 --- a/test/tools/javac/T5090006/compiler.sh	Thu Jun 11 10:54:31 2009 -0700
   115.2 +++ b/test/tools/javac/T5090006/compiler.sh	Thu Jun 11 21:35:12 2009 -0700
   115.3 @@ -63,7 +63,7 @@
   115.4      ;;
   115.5  esac
   115.6  
   115.7 -"${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -verbose -source 5 -d "${TESTCLASSES}" -cp "${TESTSRC}${FS}broken.jar" "${TESTSRC}${FS}$1"
   115.8 +"${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -verbose -d "${TESTCLASSES}" -cp "${TESTSRC}${FS}broken.jar" "${TESTSRC}${FS}$1"
   115.9  
  115.10  result=$?
  115.11  
   116.1 --- a/test/tools/javac/T5092545.java	Thu Jun 11 10:54:31 2009 -0700
   116.2 +++ b/test/tools/javac/T5092545.java	Thu Jun 11 21:35:12 2009 -0700
   116.3 @@ -26,8 +26,6 @@
   116.4   * @bug 5092545
   116.5   * @summary Assertion failed in javac (ClassWriter.java:513)
   116.6   * @author Peter von der Ah\u00e9
   116.7 - * @compile -source 5 T5092545.java
   116.8 - * @run main T5092545
   116.9   */
  116.10  
  116.11  interface A { void g(); }
   117.1 --- a/test/tools/javac/T5105890.java	Thu Jun 11 10:54:31 2009 -0700
   117.2 +++ b/test/tools/javac/T5105890.java	Thu Jun 11 21:35:12 2009 -0700
   117.3 @@ -26,8 +26,6 @@
   117.4   * @bug 5105890
   117.5   * @summary (codegen) constant folding broken for conditional operator
   117.6   * @author Peter von der Ah\u00e9
   117.7 - * @compile -source 5 T5105890.java
   117.8 - * @run main T5105890
   117.9   */
  117.10  
  117.11  public class T5105890 {
   118.1 --- a/test/tools/javac/T6405099.java	Thu Jun 11 10:54:31 2009 -0700
   118.2 +++ b/test/tools/javac/T6405099.java	Thu Jun 11 21:35:12 2009 -0700
   118.3 @@ -25,20 +25,39 @@
   118.4   * @test
   118.5   * @bug 6405099
   118.6   * @summary Compiler crashes when javac encounters /usr/jdk/packges/lib/ext with no 777 permissions
   118.7 - *
   118.8 - * @ignore causes NPE in Java Test
   118.9 - * @run main T6405099
  118.10 - * @compile -extdirs bad T6405099.java
  118.11   */
  118.12  
  118.13 -import java.io.File;
  118.14 +import java.io.*;
  118.15  
  118.16  public class T6405099
  118.17  {
  118.18      public static void main(String[] args) {
  118.19          File bad = new File("bad");
  118.20 -        bad.mkdir();
  118.21 -        bad.setReadable(false);
  118.22 -        bad.setExecutable(false);
  118.23 +        try {
  118.24 +            bad.mkdir();
  118.25 +            bad.setReadable(false);
  118.26 +            bad.setExecutable(false);
  118.27 +
  118.28 +            test(bad);
  118.29 +
  118.30 +        } finally {
  118.31 +            bad.setExecutable(true);
  118.32 +            bad.setReadable(true);
  118.33 +        }
  118.34 +    }
  118.35 +
  118.36 +    static void test(File dir) {
  118.37 +        String[] args = {
  118.38 +            "-extdirs", dir.getPath(), "-d", ".",
  118.39 +            new File(System.getProperty("test.src", "."), "T6405099.java").getPath()
  118.40 +        };
  118.41 +
  118.42 +        StringWriter sw = new StringWriter();
  118.43 +        PrintWriter pw = new PrintWriter(sw);
  118.44 +        int rc = com.sun.tools.javac.Main.compile(args, pw);
  118.45 +        if (rc != 0)
  118.46 +            throw new Error("compilation failed");
  118.47 +
  118.48 +        System.out.println(sw);
  118.49      }
  118.50  }
   119.1 --- a/test/tools/javac/T6557865.java	Thu Jun 11 10:54:31 2009 -0700
   119.2 +++ b/test/tools/javac/T6557865.java	Thu Jun 11 21:35:12 2009 -0700
   119.3 @@ -24,10 +24,10 @@
   119.4  /*
   119.5   * @test
   119.6   * @bug 6557865
   119.7 - * @summary -target 5 should not put ACC_SYNTHETIC on package-info
   119.8 + * @summary -source 5 -target 5 should not put ACC_SYNTHETIC on package-info
   119.9   * @author Wei Tao
  119.10   * @compile T6557865.java
  119.11 - * @compile -target 5 T6232928/package-info.java
  119.12 + * @compile -source 5 -target 5 T6232928/package-info.java
  119.13   * @run main T6557865
  119.14   */
  119.15  
   120.1 --- a/test/tools/javac/annotations/default/A.java	Thu Jun 11 10:54:31 2009 -0700
   120.2 +++ b/test/tools/javac/annotations/default/A.java	Thu Jun 11 21:35:12 2009 -0700
   120.3 @@ -27,11 +27,11 @@
   120.4   * @summary Constraints regarding annotation defaults
   120.5   * @author gafter
   120.6   *
   120.7 - * @compile -source 1.5 A.java
   120.8 - * @compile -source 1.5 B.java
   120.9 - * @compile -source 1.5 C.java
  120.10 - * @compile/fail -source 1.5 Derr.java
  120.11 - * @compile/fail -source 1.5 Eerr.java
  120.12 + * @compile A.java
  120.13 + * @compile B.java
  120.14 + * @compile C.java
  120.15 + * @compile/fail Derr.java
  120.16 + * @compile/fail Eerr.java
  120.17   */
  120.18  
  120.19  public @interface A {
   121.1 --- a/test/tools/javac/annotations/neg/AnnComma.java	Thu Jun 11 10:54:31 2009 -0700
   121.2 +++ b/test/tools/javac/annotations/neg/AnnComma.java	Thu Jun 11 21:35:12 2009 -0700
   121.3 @@ -27,7 +27,7 @@
   121.4   * @summary annotation syntax allows extra ',' in parameter list.
   121.5   * @author gafter
   121.6   *
   121.7 - * @compile/fail -source 1.5 AnnComma.java
   121.8 + * @compile/fail AnnComma.java
   121.9   */
  121.10  
  121.11  package annComma;
   122.1 --- a/test/tools/javac/annotations/neg/ArrayLit.java	Thu Jun 11 10:54:31 2009 -0700
   122.2 +++ b/test/tools/javac/annotations/neg/ArrayLit.java	Thu Jun 11 21:35:12 2009 -0700
   122.3 @@ -27,7 +27,7 @@
   122.4   * @summary JSR175 (4): don't allow "new" in annotations
   122.5   * @author gafter
   122.6   *
   122.7 - * @compile/fail -source 1.5 ArrayLit.java
   122.8 + * @compile/fail ArrayLit.java
   122.9   */
  122.10  
  122.11  @ArrayLit(new int[] {1, 2, 3})
   123.1 --- a/test/tools/javac/annotations/neg/Constant.java	Thu Jun 11 10:54:31 2009 -0700
   123.2 +++ b/test/tools/javac/annotations/neg/Constant.java	Thu Jun 11 21:35:12 2009 -0700
   123.3 @@ -27,7 +27,7 @@
   123.4   * @summary JSR175 (5): annotations must be "constants"
   123.5   * @author gafter
   123.6   *
   123.7 - * @compile/fail -source 1.5 Constant.java
   123.8 + * @compile/fail Constant.java
   123.9   */
  123.10  
  123.11  package test.tools.javac.annotation.Constant;
   124.1 --- a/test/tools/javac/annotations/neg/Cycle1.java	Thu Jun 11 10:54:31 2009 -0700
   124.2 +++ b/test/tools/javac/annotations/neg/Cycle1.java	Thu Jun 11 21:35:12 2009 -0700
   124.3 @@ -27,7 +27,7 @@
   124.4   * @summary (JSR175) compiler allows self-containing annotation types
   124.5   * @author gafter
   124.6   *
   124.7 - * @compile/fail -source 1.5 Cycle1.java
   124.8 + * @compile/fail Cycle1.java
   124.9   */
  124.10  
  124.11  package cycle1;
   125.1 --- a/test/tools/javac/annotations/neg/Cycle2.java	Thu Jun 11 10:54:31 2009 -0700
   125.2 +++ b/test/tools/javac/annotations/neg/Cycle2.java	Thu Jun 11 21:35:12 2009 -0700
   125.3 @@ -27,7 +27,7 @@
   125.4   * @summary (JSR175) compiler allows self-containing annotation types
   125.5   * @author gafter
   125.6   *
   125.7 - * @compile/fail -source 1.5 Cycle2.java
   125.8 + * @compile/fail Cycle2.java
   125.9   */
  125.10  
  125.11  package cycle2;
   126.1 --- a/test/tools/javac/annotations/neg/Cycle3.java	Thu Jun 11 10:54:31 2009 -0700
   126.2 +++ b/test/tools/javac/annotations/neg/Cycle3.java	Thu Jun 11 21:35:12 2009 -0700
   126.3 @@ -27,7 +27,7 @@
   126.4   * @summary javac allows cyclic annotation interfaces with arrays
   126.5   * @author gafter
   126.6   *
   126.7 - * @compile/fail -source 1.5 Cycle3.java
   126.8 + * @compile/fail Cycle3.java
   126.9   */
  126.10  
  126.11  package cycle3;
   127.1 --- a/test/tools/javac/annotations/neg/Dep.java	Thu Jun 11 10:54:31 2009 -0700
   127.2 +++ b/test/tools/javac/annotations/neg/Dep.java	Thu Jun 11 21:35:12 2009 -0700
   127.3 @@ -28,8 +28,8 @@
   127.4   * @author gafter
   127.5   *
   127.6   * @compile      -source 1.4 -Xlint:dep-ann -Werror Dep.java
   127.7 - * @compile/fail -source 1.5 -Xlint:dep-ann -Werror Dep.java
   127.8 - * @compile      -source 1.5 -Xlint:dep-ann         Dep.java
   127.9 + * @compile/fail             -Xlint:dep-ann -Werror Dep.java
  127.10 + * @compile                  -Xlint:dep-ann         Dep.java
  127.11   */
  127.12  
  127.13  /** @deprecated */
   128.1 --- a/test/tools/javac/annotations/neg/Dup.java	Thu Jun 11 10:54:31 2009 -0700
   128.2 +++ b/test/tools/javac/annotations/neg/Dup.java	Thu Jun 11 21:35:12 2009 -0700
   128.3 @@ -27,7 +27,7 @@
   128.4   * @summary JSR175 (3): don't allow repeated annotations
   128.5   * @author gafter
   128.6   *
   128.7 - * @compile/fail -source 1.5 Dup.java
   128.8 + * @compile/fail Dup.java
   128.9   */
  128.10  
  128.11  @Dup
   129.1 --- a/test/tools/javac/annotations/neg/DupTarget.java	Thu Jun 11 10:54:31 2009 -0700
   129.2 +++ b/test/tools/javac/annotations/neg/DupTarget.java	Thu Jun 11 21:35:12 2009 -0700
   129.3 @@ -27,7 +27,7 @@
   129.4   * @summary <at>Target
   129.5   * @author gafter
   129.6   *
   129.7 - * @compile/fail -source 1.5 DupTarget.java
   129.8 + * @compile/fail DupTarget.java
   129.9   */
  129.10  
  129.11  @java.lang.annotation.Target({TYPE, FIELD, PACKAGE, FIELD})
   130.1 --- a/test/tools/javac/annotations/neg/MemberOver.java	Thu Jun 11 10:54:31 2009 -0700
   130.2 +++ b/test/tools/javac/annotations/neg/MemberOver.java	Thu Jun 11 21:35:12 2009 -0700
   130.3 @@ -27,7 +27,7 @@
   130.4   * @summary Annotation members must not have same signature as Object or Annotation members
   130.5   * @author gafter
   130.6   *
   130.7 - * @compile/fail -source 1.5 MemberOver.java
   130.8 + * @compile/fail MemberOver.java
   130.9   */
  130.10  
  130.11  package memberOver;
   131.1 --- a/test/tools/javac/annotations/neg/ObjectMembers.java	Thu Jun 11 10:54:31 2009 -0700
   131.2 +++ b/test/tools/javac/annotations/neg/ObjectMembers.java	Thu Jun 11 21:35:12 2009 -0700
   131.3 @@ -27,7 +27,7 @@
   131.4   * @summary JSR175 (2): don't allow annotating members from Object
   131.5   * @author gafter
   131.6   *
   131.7 - * @compile/fail -source 1.5 ObjectMembers.java
   131.8 + * @compile/fail ObjectMembers.java
   131.9   */
  131.10  
  131.11  @ObjectMembers(hashCode = 23)
   132.1 --- a/test/tools/javac/annotations/neg/OverrideNo.java	Thu Jun 11 10:54:31 2009 -0700
   132.2 +++ b/test/tools/javac/annotations/neg/OverrideNo.java	Thu Jun 11 21:35:12 2009 -0700
   132.3 @@ -27,7 +27,7 @@
   132.4   * @summary JSR175 (7): implement <at>Overrides
   132.5   * @author gafter
   132.6   *
   132.7 - * @compile/fail -source 1.5 OverrideNo.java
   132.8 + * @compile/fail OverrideNo.java
   132.9   */
  132.10  
  132.11  package overrideNo;
   133.1 --- a/test/tools/javac/annotations/neg/Package.java	Thu Jun 11 10:54:31 2009 -0700
   133.2 +++ b/test/tools/javac/annotations/neg/Package.java	Thu Jun 11 21:35:12 2009 -0700
   133.3 @@ -27,7 +27,7 @@
   133.4   * @summary Package annotations
   133.5   * @author gafter
   133.6   *
   133.7 - * @compile/fail -source 1.5 Package.java
   133.8 + * @compile/fail Package.java
   133.9   */
  133.10  
  133.11  @java.lang.annotation.Documented
   134.1 --- a/test/tools/javac/annotations/neg/Recovery.java	Thu Jun 11 10:54:31 2009 -0700
   134.2 +++ b/test/tools/javac/annotations/neg/Recovery.java	Thu Jun 11 21:35:12 2009 -0700
   134.3 @@ -27,7 +27,7 @@
   134.4   * @summary compiler crash with malformed annotations
   134.5   * @author gafter
   134.6   *
   134.7 - * @compile/fail -source 1.5 Recovery.java
   134.8 + * @compile/fail Recovery.java
   134.9   */
  134.10  
  134.11  import java.lang.annotation.*;
   135.1 --- a/test/tools/javac/annotations/neg/Recovery1.java	Thu Jun 11 10:54:31 2009 -0700
   135.2 +++ b/test/tools/javac/annotations/neg/Recovery1.java	Thu Jun 11 21:35:12 2009 -0700
   135.3 @@ -27,7 +27,7 @@
   135.4   * @summary Assertion error is thrown when an annotation class cannot be found.
   135.5   * @author gafter
   135.6   *
   135.7 - * @compile/fail -source 1.5 Recovery1.java
   135.8 + * @compile/fail Recovery1.java
   135.9   */
  135.10  
  135.11  package recovery1;
   136.1 --- a/test/tools/javac/annotations/neg/Scope.java	Thu Jun 11 10:54:31 2009 -0700
   136.2 +++ b/test/tools/javac/annotations/neg/Scope.java	Thu Jun 11 21:35:12 2009 -0700
   136.3 @@ -27,7 +27,7 @@
   136.4   * @summary name lookup scope for annotations
   136.5   * @author gafter
   136.6   *
   136.7 - * @compile/fail -source 1.5 Scope.java
   136.8 + * @compile/fail Scope.java
   136.9   */
  136.10  
  136.11  package annotation.scope;
   137.1 --- a/test/tools/javac/annotations/neg/Syntax1.java	Thu Jun 11 10:54:31 2009 -0700
   137.2 +++ b/test/tools/javac/annotations/neg/Syntax1.java	Thu Jun 11 21:35:12 2009 -0700
   137.3 @@ -27,7 +27,7 @@
   137.4   * @summary compiler crash with ill-formed annotation
   137.5   * @author gafter
   137.6   *
   137.7 - * @compile/fail -source 1.5 Syntax1.java
   137.8 + * @compile/fail Syntax1.java
   137.9   */
  137.10  
  137.11  package syntax1;
   138.1 --- a/test/tools/javac/annotations/neg/WrongTarget.java	Thu Jun 11 10:54:31 2009 -0700
   138.2 +++ b/test/tools/javac/annotations/neg/WrongTarget.java	Thu Jun 11 21:35:12 2009 -0700
   138.3 @@ -27,7 +27,7 @@
   138.4   * @summary java.lang.annotation.Target
   138.5   * @author gafter
   138.6   *
   138.7 - * @compile/fail -source 1.5 WrongTarget.java
   138.8 + * @compile/fail WrongTarget.java
   138.9   */
  138.10  
  138.11  @java.lang.annotation.Target({FIELD})
   139.1 --- a/test/tools/javac/annotations/neg/WrongTarget2.java	Thu Jun 11 10:54:31 2009 -0700
   139.2 +++ b/test/tools/javac/annotations/neg/WrongTarget2.java	Thu Jun 11 21:35:12 2009 -0700
   139.3 @@ -27,7 +27,7 @@
   139.4   * @summary Compiler allows Inherited meta-attribute on local variable declaration.
   139.5   * @author gafter
   139.6   *
   139.7 - * @compile/fail -source 1.5 WrongTarget2.java
   139.8 + * @compile/fail WrongTarget2.java
   139.9   */
  139.10  
  139.11  import java.lang.annotation.Inherited;
   140.1 --- a/test/tools/javac/annotations/neg/WrongValue.java	Thu Jun 11 10:54:31 2009 -0700
   140.2 +++ b/test/tools/javac/annotations/neg/WrongValue.java	Thu Jun 11 21:35:12 2009 -0700
   140.3 @@ -27,7 +27,7 @@
   140.4   * @summary compiler: crashes when attributes with same elements are used in place of other
   140.5   * @author gafter
   140.6   *
   140.7 - * @compile/fail -source 1.5 WrongValue.java
   140.8 + * @compile/fail WrongValue.java
   140.9   */
  140.10  
  140.11  @interface TestM2 {
   141.1 --- a/test/tools/javac/annotations/neg/Z1.java	Thu Jun 11 10:54:31 2009 -0700
   141.2 +++ b/test/tools/javac/annotations/neg/Z1.java	Thu Jun 11 21:35:12 2009 -0700
   141.3 @@ -27,7 +27,7 @@
   141.4   * @summary implement "metadata" (attribute interfaces and program annotations)
   141.5   * @author gafter
   141.6   *
   141.7 - * @compile/fail -source 1.5 Z1.java
   141.8 + * @compile/fail Z1.java
   141.9   */
  141.10  
  141.11  enum Color { red, green, blue }
   142.1 --- a/test/tools/javac/annotations/neg/Z10.java	Thu Jun 11 10:54:31 2009 -0700
   142.2 +++ b/test/tools/javac/annotations/neg/Z10.java	Thu Jun 11 21:35:12 2009 -0700
   142.3 @@ -27,7 +27,7 @@
   142.4   * @summary implement "metadata" (attribute interfaces and program annotations)
   142.5   * @author gafter
   142.6   *
   142.7 - * @compile/fail -source 1.5 Z10.java
   142.8 + * @compile/fail Z10.java
   142.9   */
  142.10  
  142.11  enum Color { red, green, blue }
   143.1 --- a/test/tools/javac/annotations/neg/Z11.java	Thu Jun 11 10:54:31 2009 -0700
   143.2 +++ b/test/tools/javac/annotations/neg/Z11.java	Thu Jun 11 21:35:12 2009 -0700
   143.3 @@ -27,7 +27,7 @@
   143.4   * @summary implement "metadata" (attribute interfaces and program annotations)
   143.5   * @author gafter
   143.6   *
   143.7 - * @compile/fail -source 1.5 Z11.java
   143.8 + * @compile/fail Z11.java
   143.9   */
  143.10  
  143.11  enum Color { red, green, blue }
   144.1 --- a/test/tools/javac/annotations/neg/Z12.java	Thu Jun 11 10:54:31 2009 -0700
   144.2 +++ b/test/tools/javac/annotations/neg/Z12.java	Thu Jun 11 21:35:12 2009 -0700
   144.3 @@ -27,7 +27,7 @@
   144.4   * @summary implement "metadata" (attribute interfaces and program annotations)
   144.5   * @author gafter
   144.6   *
   144.7 - * @compile/fail -source 1.5 Z12.java
   144.8 + * @compile/fail Z12.java
   144.9   */
  144.10  
  144.11  enum Color { red, green, blue }
   145.1 --- a/test/tools/javac/annotations/neg/Z13.java	Thu Jun 11 10:54:31 2009 -0700
   145.2 +++ b/test/tools/javac/annotations/neg/Z13.java	Thu Jun 11 21:35:12 2009 -0700
   145.3 @@ -27,7 +27,7 @@
   145.4   * @summary implement "metadata" (attribute interfaces and program annotations)
   145.5   * @author gafter
   145.6   *
   145.7 - * @compile/fail -source 1.5 Z13.java
   145.8 + * @compile/fail Z13.java
   145.9   */
  145.10  
  145.11  @interface An {
   146.1 --- a/test/tools/javac/annotations/neg/Z14.java	Thu Jun 11 10:54:31 2009 -0700
   146.2 +++ b/test/tools/javac/annotations/neg/Z14.java	Thu Jun 11 21:35:12 2009 -0700
   146.3 @@ -27,7 +27,7 @@
   146.4   * @summary implement "metadata" (attribute interfaces and program annotations)
   146.5   * @author gafter
   146.6   *
   146.7 - * @compile/fail -source 1.5 Z14.java
   146.8 + * @compile/fail Z14.java
   146.9   */
  146.10  
  146.11  @interface An<T> {
   147.1 --- a/test/tools/javac/annotations/neg/Z15.java	Thu Jun 11 10:54:31 2009 -0700
   147.2 +++ b/test/tools/javac/annotations/neg/Z15.java	Thu Jun 11 21:35:12 2009 -0700
   147.3 @@ -27,7 +27,7 @@
   147.4   * @summary implement "metadata" (attribute interfaces and program annotations)
   147.5   * @author gafter
   147.6   *
   147.7 - * @compile/fail -source 1.5 Z15.java
   147.8 + * @compile/fail Z15.java
   147.9   */
  147.10  
  147.11  @interface An {
   148.1 --- a/test/tools/javac/annotations/neg/Z16.java	Thu Jun 11 10:54:31 2009 -0700
   148.2 +++ b/test/tools/javac/annotations/neg/Z16.java	Thu Jun 11 21:35:12 2009 -0700
   148.3 @@ -27,7 +27,7 @@
   148.4   * @summary implement "metadata" (attribute interfaces and program annotations)
   148.5   * @author gafter
   148.6   *
   148.7 - * @compile/fail -source 1.5 Z16.java
   148.8 + * @compile/fail Z16.java
   148.9   */
  148.10  
  148.11  enum Color { red, green, blue }
   149.1 --- a/test/tools/javac/annotations/neg/Z2.java	Thu Jun 11 10:54:31 2009 -0700
   149.2 +++ b/test/tools/javac/annotations/neg/Z2.java	Thu Jun 11 21:35:12 2009 -0700
   149.3 @@ -27,7 +27,7 @@
   149.4   * @summary implement "metadata" (attribute interfaces and program annotations)
   149.5   * @author gafter
   149.6   *
   149.7 - * @compile/fail -source 1.5 Z2.java
   149.8 + * @compile/fail Z2.java
   149.9   */
  149.10  
  149.11  enum Color { red, green, blue }
   150.1 --- a/test/tools/javac/annotations/neg/Z3.java	Thu Jun 11 10:54:31 2009 -0700
   150.2 +++ b/test/tools/javac/annotations/neg/Z3.java	Thu Jun 11 21:35:12 2009 -0700
   150.3 @@ -27,7 +27,7 @@
   150.4   * @summary implement "metadata" (attribute interfaces and program annotations)
   150.5   * @author gafter
   150.6   *
   150.7 - * @compile/fail -source 1.5 Z3.java
   150.8 + * @compile/fail Z3.java
   150.9   */
  150.10  
  150.11  enum Color { red, green, blue }
   151.1 --- a/test/tools/javac/annotations/neg/Z4.java	Thu Jun 11 10:54:31 2009 -0700
   151.2 +++ b/test/tools/javac/annotations/neg/Z4.java	Thu Jun 11 21:35:12 2009 -0700
   151.3 @@ -27,7 +27,7 @@
   151.4   * @summary implement "metadata" (attribute interfaces and program annotations)
   151.5   * @author gafter
   151.6   *
   151.7 - * @compile/fail -source 1.5 Z4.java
   151.8 + * @compile/fail Z4.java
   151.9   */
  151.10  
  151.11  enum Color { red, green, blue }
   152.1 --- a/test/tools/javac/annotations/neg/Z5.java	Thu Jun 11 10:54:31 2009 -0700
   152.2 +++ b/test/tools/javac/annotations/neg/Z5.java	Thu Jun 11 21:35:12 2009 -0700
   152.3 @@ -27,7 +27,7 @@
   152.4   * @summary implement "metadata" (attribute interfaces and program annotations)
   152.5   * @author gafter
   152.6   *
   152.7 - * @compile/fail -source 1.5 Z5.java
   152.8 + * @compile/fail Z5.java
   152.9   */
  152.10  
  152.11  interface Foo {}
   153.1 --- a/test/tools/javac/annotations/neg/Z8.java	Thu Jun 11 10:54:31 2009 -0700
   153.2 +++ b/test/tools/javac/annotations/neg/Z8.java	Thu Jun 11 21:35:12 2009 -0700
   153.3 @@ -27,7 +27,7 @@
   153.4   * @summary implement "metadata" (attribute interfaces and program annotations)
   153.5   * @author gafter
   153.6   *
   153.7 - * @compile/fail -source 1.5 Z8.java
   153.8 + * @compile/fail Z8.java
   153.9   */
  153.10  
  153.11  @interface An {
   154.1 --- a/test/tools/javac/annotations/neg/Z9.java	Thu Jun 11 10:54:31 2009 -0700
   154.2 +++ b/test/tools/javac/annotations/neg/Z9.java	Thu Jun 11 21:35:12 2009 -0700
   154.3 @@ -27,7 +27,7 @@
   154.4   * @summary implement "metadata" (attribute interfaces and program annotations)
   154.5   * @author gafter
   154.6   *
   154.7 - * @compile/fail -source 1.5 Z9.java
   154.8 + * @compile/fail Z9.java
   154.9   */
  154.10  
  154.11  @interface An {
   155.1 --- a/test/tools/javac/annotations/pos/AnnoteElideBraces.java	Thu Jun 11 10:54:31 2009 -0700
   155.2 +++ b/test/tools/javac/annotations/pos/AnnoteElideBraces.java	Thu Jun 11 21:35:12 2009 -0700
   155.3 @@ -27,7 +27,7 @@
   155.4   * @summary JSR175 (15): single element array annotation value
   155.5   * @author gafter
   155.6   *
   155.7 - * @compile -source 1.5 AnnoteElideBraces.java
   155.8 + * @compile AnnoteElideBraces.java
   155.9   */
  155.10  
  155.11  @interface D {
   156.1 --- a/test/tools/javac/annotations/pos/ClassA.java	Thu Jun 11 10:54:31 2009 -0700
   156.2 +++ b/test/tools/javac/annotations/pos/ClassA.java	Thu Jun 11 21:35:12 2009 -0700
   156.3 @@ -27,8 +27,8 @@
   156.4   * @summary javac crash loading class files containing Class-valued annotation fields
   156.5   * @author gafter
   156.6   *
   156.7 - * @compile -source 1.5 ClassA.java ClassB.java
   156.8 - * @compile -source 1.5 ClassB.java
   156.9 + * @compile ClassA.java ClassB.java
  156.10 + * @compile ClassB.java
  156.11   */
  156.12  
  156.13  @interface ClassA {
   157.1 --- a/test/tools/javac/annotations/pos/Dep.java	Thu Jun 11 10:54:31 2009 -0700
   157.2 +++ b/test/tools/javac/annotations/pos/Dep.java	Thu Jun 11 21:35:12 2009 -0700
   157.3 @@ -27,7 +27,7 @@
   157.4   * @summary Please add annotation <at>Deprecated to supplant the javadoc tag
   157.5   * @author gafter
   157.6   *
   157.7 - * @compile -source 1.5 -Xlint:dep-ann -Werror Dep.java
   157.8 + * @compile -Xlint:dep-ann -Werror Dep.java
   157.9   */
  157.10  
  157.11  /** @deprecated */
   158.1 --- a/test/tools/javac/annotations/pos/Enum1.java	Thu Jun 11 10:54:31 2009 -0700
   158.2 +++ b/test/tools/javac/annotations/pos/Enum1.java	Thu Jun 11 21:35:12 2009 -0700
   158.3 @@ -27,7 +27,7 @@
   158.4   * @summary JSR175: annotations on enum constant
   158.5   * @author gafter
   158.6   *
   158.7 - * @compile -source 1.5 Enum1.java
   158.8 + * @compile Enum1.java
   158.9   */
  158.10  
  158.11  package annotation.enums;
   159.1 --- a/test/tools/javac/annotations/pos/Local.java	Thu Jun 11 10:54:31 2009 -0700
   159.2 +++ b/test/tools/javac/annotations/pos/Local.java	Thu Jun 11 21:35:12 2009 -0700
   159.3 @@ -27,7 +27,7 @@
   159.4   * @summary local variable annotations
   159.5   * @author gafter
   159.6   *
   159.7 - * @compile -source 1.5 Local.java
   159.8 + * @compile Local.java
   159.9   */
  159.10  
  159.11  class Local {
   160.1 --- a/test/tools/javac/annotations/pos/Members.java	Thu Jun 11 10:54:31 2009 -0700
   160.2 +++ b/test/tools/javac/annotations/pos/Members.java	Thu Jun 11 21:35:12 2009 -0700
   160.3 @@ -27,7 +27,7 @@
   160.4   * @summary annotation types may contain constants, types
   160.5   * @author gafter
   160.6   *
   160.7 - * @compile -source 1.5 Members.java
   160.8 + * @compile Members.java
   160.9   */
  160.10  
  160.11  package members;
   161.1 --- a/test/tools/javac/annotations/pos/NType.java	Thu Jun 11 10:54:31 2009 -0700
   161.2 +++ b/test/tools/javac/annotations/pos/NType.java	Thu Jun 11 21:35:12 2009 -0700
   161.3 @@ -27,7 +27,7 @@
   161.4   * @summary compiler crash if annotation using an enum type defined inside the annotation
   161.5   * @author gafter
   161.6   *
   161.7 - * @compile -source 1.5 NType.java
   161.8 + * @compile NType.java
   161.9   */
  161.10  
  161.11  package ntype;
   162.1 --- a/test/tools/javac/annotations/pos/OverrideCheck.java	Thu Jun 11 10:54:31 2009 -0700
   162.2 +++ b/test/tools/javac/annotations/pos/OverrideCheck.java	Thu Jun 11 21:35:12 2009 -0700
   162.3 @@ -27,7 +27,7 @@
   162.4   * @summary crash in annotation class file reader
   162.5   * @author gafter
   162.6   *
   162.7 - * @compile -source 1.5 OverrideCheck.java
   162.8 + * @compile OverrideCheck.java
   162.9   */
  162.10  
  162.11  class OverrideCheck {
   163.1 --- a/test/tools/javac/annotations/pos/OverrideOK.java	Thu Jun 11 10:54:31 2009 -0700
   163.2 +++ b/test/tools/javac/annotations/pos/OverrideOK.java	Thu Jun 11 21:35:12 2009 -0700
   163.3 @@ -27,7 +27,7 @@
   163.4   * @summary JSR175 (7): implement <at>Overrides
   163.5   * @author gafter
   163.6   *
   163.7 - * @compile -source 1.5 OverrideOK.java
   163.8 + * @compile OverrideOK.java
   163.9   */
  163.10  
  163.11  package overrideOK;
   164.1 --- a/test/tools/javac/annotations/pos/Parameter.java	Thu Jun 11 10:54:31 2009 -0700
   164.2 +++ b/test/tools/javac/annotations/pos/Parameter.java	Thu Jun 11 21:35:12 2009 -0700
   164.3 @@ -27,7 +27,7 @@
   164.4   * @summary JSR175: Parameter annotations
   164.5   * @author gafter
   164.6   *
   164.7 - * @compile -source 1.5 Parameter.java
   164.8 + * @compile Parameter.java
   164.9   */
  164.10  
  164.11  package annotation.parameter;
   165.1 --- a/test/tools/javac/annotations/pos/Primitives.java	Thu Jun 11 10:54:31 2009 -0700
   165.2 +++ b/test/tools/javac/annotations/pos/Primitives.java	Thu Jun 11 21:35:12 2009 -0700
   165.3 @@ -26,9 +26,6 @@
   165.4   * @bug 5034991 5040842 5040853
   165.5   * @summary Modify class-file representation of Class-valued annotation elements
   165.6   * @author gafter
   165.7 - *
   165.8 - * @compile -source 1.5 Primitives.java
   165.9 - * @run main Primitives
  165.10   */
  165.11  
  165.12  public class Primitives {
   166.1 --- a/test/tools/javac/annotations/pos/RightTarget.java	Thu Jun 11 10:54:31 2009 -0700
   166.2 +++ b/test/tools/javac/annotations/pos/RightTarget.java	Thu Jun 11 21:35:12 2009 -0700
   166.3 @@ -27,7 +27,7 @@
   166.4   * @summary java.lang.annotation.Target
   166.5   * @author gafter
   166.6   *
   166.7 - * @compile -source 1.5 RightTarget.java
   166.8 + * @compile RightTarget.java
   166.9   */
  166.10  
  166.11  import java.lang.annotation.ElementType;
   167.1 --- a/test/tools/javac/annotations/pos/Z1.java	Thu Jun 11 10:54:31 2009 -0700
   167.2 +++ b/test/tools/javac/annotations/pos/Z1.java	Thu Jun 11 21:35:12 2009 -0700
   167.3 @@ -27,7 +27,7 @@
   167.4   * @summary implement "metadata" (attribute interfaces and program annotations)
   167.5   * @author gafter
   167.6   *
   167.7 - * @compile -source 1.5 Z1.java
   167.8 + * @compile Z1.java
   167.9   */
  167.10  
  167.11  enum Color { red, green, blue }
   168.1 --- a/test/tools/javac/annotations/pos/Z2.java	Thu Jun 11 10:54:31 2009 -0700
   168.2 +++ b/test/tools/javac/annotations/pos/Z2.java	Thu Jun 11 21:35:12 2009 -0700
   168.3 @@ -27,7 +27,7 @@
   168.4   * @summary implement "metadata" (attribute interfaces and program annotations)
   168.5   * @author gafter
   168.6   *
   168.7 - * @compile -source 1.5 Z2.java
   168.8 + * @compile Z2.java
   168.9   */
  168.10  
  168.11  enum Color { red, green, blue }
   169.1 --- a/test/tools/javac/annotations/pos/Z3.java	Thu Jun 11 10:54:31 2009 -0700
   169.2 +++ b/test/tools/javac/annotations/pos/Z3.java	Thu Jun 11 21:35:12 2009 -0700
   169.3 @@ -27,7 +27,7 @@
   169.4   * @summary implement "metadata" (attribute interfaces and program annotations)
   169.5   * @author gafter
   169.6   *
   169.7 - * @compile -source 1.5 Z3.java
   169.8 + * @compile Z3.java
   169.9   */
  169.10  
  169.11  enum Color { red, green, blue }
   170.1 --- a/test/tools/javac/annotations/pos/Z4.java	Thu Jun 11 10:54:31 2009 -0700
   170.2 +++ b/test/tools/javac/annotations/pos/Z4.java	Thu Jun 11 21:35:12 2009 -0700
   170.3 @@ -27,7 +27,7 @@
   170.4   * @summary implement "metadata" (attribute interfaces and program annotations)
   170.5   * @author gafter
   170.6   *
   170.7 - * @compile -source 1.5 Z4.java
   170.8 + * @compile Z4.java
   170.9   */
  170.10  
  170.11  @interface An {
   171.1 --- a/test/tools/javac/annotations/pos/package-info.java	Thu Jun 11 10:54:31 2009 -0700
   171.2 +++ b/test/tools/javac/annotations/pos/package-info.java	Thu Jun 11 21:35:12 2009 -0700
   171.3 @@ -27,7 +27,7 @@
   171.4   * @summary Package annotations
   171.5   * @author gafter
   171.6   *
   171.7 - * @compile -source 1.5 package-info.java
   171.8 + * @compile package-info.java
   171.9   */
  171.10  
  171.11  @java.lang.annotation.Documented
   172.1 --- a/test/tools/javac/api/6431257/T6431257.java	Thu Jun 11 10:54:31 2009 -0700
   172.2 +++ b/test/tools/javac/api/6431257/T6431257.java	Thu Jun 11 21:35:12 2009 -0700
   172.3 @@ -27,7 +27,6 @@
   172.4   * @summary JSR 199: Changes to JavaFileManager to support JSR 269 Filer API
   172.5   * @author  Peter von der Ah\u00e9
   172.6   * @library ../lib
   172.7 - * @ignore  Need to fix this test when 6508981 is fixed.
   172.8   * @compile T6431257.java package-info.java
   172.9   * @run main T6431257 foo.bar.baz foo/bar/baz
  172.10   */
   173.1 --- a/test/tools/javac/api/TestJavacTaskScanner.java	Thu Jun 11 10:54:31 2009 -0700
   173.2 +++ b/test/tools/javac/api/TestJavacTaskScanner.java	Thu Jun 11 21:35:12 2009 -0700
   173.3 @@ -26,7 +26,7 @@
   173.4   * @bug     4813736
   173.5   * @summary Additional functionality test of task and JSR 269
   173.6   * @author  Peter von der Ah\u00e9
   173.7 - * @ignore "misuse" of context breaks with 6358786
   173.8 + * @library ./lib
   173.9   * @run main TestJavacTaskScanner TestJavacTaskScanner.java
  173.10   */
  173.11  
  173.12 @@ -42,16 +42,23 @@
  173.13  import javax.lang.model.util.Elements;
  173.14  import javax.lang.model.util.Types;
  173.15  import javax.tools.*;
  173.16 -import javax.tools.JavaFileManager;
  173.17  
  173.18 -public class TestJavacTaskScanner implements Runnable {
  173.19 +public class TestJavacTaskScanner extends ToolTester {
  173.20  
  173.21      final JavacTaskImpl task;
  173.22      final Elements elements;
  173.23      final Types types;
  173.24  
  173.25 -    TestJavacTaskScanner(JavacTaskImpl task) {
  173.26 -        this.task = task;
  173.27 +    int numTokens;
  173.28 +    int numParseTypeElements;
  173.29 +    int numAllMembers;
  173.30 +
  173.31 +    TestJavacTaskScanner(File file) {
  173.32 +        final Iterable<? extends JavaFileObject> compilationUnits =
  173.33 +            fm.getJavaFileObjects(new File[] {file});
  173.34 +        task = (JavacTaskImpl)tool.getTask(null, fm, null, null, null, compilationUnits);
  173.35 +        task.getContext().put(Scanner.Factory.scannerFactoryKey,
  173.36 +                new MyScanner.Factory(task.getContext(), this));
  173.37          elements = task.getElements();
  173.38          types = task.getTypes();
  173.39      }
  173.40 @@ -71,6 +78,23 @@
  173.41              System.out.println();
  173.42              System.out.println();
  173.43          }
  173.44 +
  173.45 +        System.out.println("#tokens: " + numTokens);
  173.46 +        System.out.println("#parseTypeElements: " + numParseTypeElements);
  173.47 +        System.out.println("#allMembers: " + numAllMembers);
  173.48 +
  173.49 +        check(numTokens, "#Tokens", 891);
  173.50 +        check(numParseTypeElements, "#parseTypeElements", 136);
  173.51 +        check(numAllMembers, "#allMembers", 67);
  173.52 +    }
  173.53 +
  173.54 +    void check(int value, String name, int expected) {
  173.55 +        // allow some slop in the comparison to allow for minor edits in the
  173.56 +        // test and in the platform
  173.57 +        if (value < expected * 9 / 10)
  173.58 +            throw new Error(name + " lower than expected; expected " + expected + "; found: " + value);
  173.59 +        if (value > expected * 11 / 10)
  173.60 +            throw new Error(name + " higher than expected; expected " + expected + "; found: " + value);
  173.61      }
  173.62  
  173.63      void testParseType(TypeElement clazz) {
  173.64 @@ -78,23 +102,19 @@
  173.65          for (Element member : elements.getAllMembers((TypeElement)type.asElement())) {
  173.66              TypeMirror mt = types.asMemberOf(type, member);
  173.67              System.out.format("%s : %s -> %s%n", member.getSimpleName(), member.asType(), mt);
  173.68 +            numParseTypeElements++;
  173.69          }
  173.70      }
  173.71  
  173.72      public static void main(String... args) throws IOException {
  173.73 -        JavaCompilerTool tool = ToolProvider.defaultJavaCompiler();
  173.74 -        JavaFileManager fm = tool.getStandardFileManager();
  173.75          String srcdir = System.getProperty("test.src");
  173.76 -        File file = new File(srcdir, args[0]);
  173.77 -        JavacTaskImpl task = (JavacTaskImpl)tool.run(null, fm.getFileForInput(file.toString()));
  173.78 -        MyScanner.Factory.preRegister(task.getContext());
  173.79 -        TestJavacTaskScanner tester = new TestJavacTaskScanner(task);
  173.80 -        tester.run();
  173.81 +        new TestJavacTaskScanner(new File(srcdir, args[0])).run();
  173.82      }
  173.83  
  173.84      private void testGetAllMembers(TypeElement clazz) {
  173.85          for (Element member : elements.getAllMembers(clazz)) {
  173.86 -            System.out.format("%s : %s", member.getSimpleName(), member.asType());
  173.87 +            System.out.format("%s : %s%n", member.getSimpleName(), member.asType());
  173.88 +            numAllMembers++;
  173.89          }
  173.90      }
  173.91  }
  173.92 @@ -102,21 +122,15 @@
  173.93  class MyScanner extends Scanner {
  173.94  
  173.95      public static class Factory extends Scanner.Factory {
  173.96 -        public static void preRegister(final Context context) {
  173.97 -            context.put(scannerFactoryKey, new Context.Factory<Scanner.Factory>() {
  173.98 -                public Factory make() {
  173.99 -                    return new Factory(context);
 173.100 -                }
 173.101 -            });
 173.102 -        }
 173.103 -        public Factory(Context context) {
 173.104 +        public Factory(Context context, TestJavacTaskScanner test) {
 173.105              super(context);
 173.106 +            this.test = test;
 173.107          }
 173.108  
 173.109          @Override
 173.110          public Scanner newScanner(CharSequence input) {
 173.111              if (input instanceof CharBuffer) {
 173.112 -                return new MyScanner(this, (CharBuffer)input);
 173.113 +                return new MyScanner(this, (CharBuffer)input, test);
 173.114              } else {
 173.115                  char[] array = input.toString().toCharArray();
 173.116                  return newScanner(array, array.length);
 173.117 @@ -125,18 +139,26 @@
 173.118  
 173.119          @Override
 173.120          public Scanner newScanner(char[] input, int inputLength) {
 173.121 -            return new MyScanner(this, input, inputLength);
 173.122 +            return new MyScanner(this, input, inputLength, test);
 173.123          }
 173.124 +
 173.125 +        private TestJavacTaskScanner test;
 173.126      }
 173.127 -    protected MyScanner(Factory fac, CharBuffer buffer) {
 173.128 +    protected MyScanner(Factory fac, CharBuffer buffer, TestJavacTaskScanner test) {
 173.129          super(fac, buffer);
 173.130 +        this.test = test;
 173.131      }
 173.132 -    protected MyScanner(Factory fac, char[] input, int inputLength) {
 173.133 +    protected MyScanner(Factory fac, char[] input, int inputLength, TestJavacTaskScanner test) {
 173.134          super(fac, input, inputLength);
 173.135 +        this.test = test;
 173.136      }
 173.137  
 173.138      public void nextToken() {
 173.139          super.nextToken();
 173.140          System.err.format("Saw token %s (%s)%n", token(), name());
 173.141 +        test.numTokens++;
 173.142      }
 173.143 +
 173.144 +    private TestJavacTaskScanner test;
 173.145 +
 173.146  }
   174.1 --- a/test/tools/javac/assert/Attach.java	Thu Jun 11 10:54:31 2009 -0700
   174.2 +++ b/test/tools/javac/assert/Attach.java	Thu Jun 11 21:35:12 2009 -0700
   174.3 @@ -26,9 +26,6 @@
   174.4   * @bug 4478095
   174.5   * @summary assertion flag attached to wrong class
   174.6   * @author gafter
   174.7 - *
   174.8 - * @compile -source 1.4 Attach.java
   174.9 - * @run main Attach
  174.10   */
  174.11  
  174.12  public class Attach {
   175.1 --- a/test/tools/javac/assert/DU1.java	Thu Jun 11 10:54:31 2009 -0700
   175.2 +++ b/test/tools/javac/assert/DU1.java	Thu Jun 11 21:35:12 2009 -0700
   175.3 @@ -27,7 +27,7 @@
   175.4   * @summary Check correct DU computation for assertions.
   175.5   * @author gafter
   175.6   *
   175.7 - * @compile/fail -source 1.4 DU1.java
   175.8 + * @compile/fail DU1.java
   175.9   */
  175.10  
  175.11  class DU1 {
   176.1 --- a/test/tools/javac/assert/DU2.java	Thu Jun 11 10:54:31 2009 -0700
   176.2 +++ b/test/tools/javac/assert/DU2.java	Thu Jun 11 21:35:12 2009 -0700
   176.3 @@ -27,7 +27,7 @@
   176.4   * @summary Check correct DU computation for assertions.
   176.5   * @author gafter
   176.6   *
   176.7 - * @compile/fail -source 1.4 DU2.java
   176.8 + * @compile/fail DU2.java
   176.9   */
  176.10  
  176.11  class DU2 {
   177.1 --- a/test/tools/javac/assert/Position.java	Thu Jun 11 10:54:31 2009 -0700
   177.2 +++ b/test/tools/javac/assert/Position.java	Thu Jun 11 21:35:12 2009 -0700
   177.3 @@ -3,17 +3,17 @@
   177.4   * @bug 4469737
   177.5   * @summary Verify the source position for assertions.
   177.6   * @author gafter
   177.7 - *
   177.8 - * @compile -source 1.4 Position.java
   177.9 - * @run main Position
  177.10   */
  177.11  
  177.12 +
  177.13  public class Position {
  177.14      static public void main(String[] args) {
  177.15          Position.class.getClassLoader().setClassAssertionStatus("U", true);
  177.16          new U().main();
  177.17      }
  177.18  }
  177.19 +
  177.20 +
  177.21  class U {
  177.22      void main() {
  177.23          try {
   178.1 --- a/test/tools/javac/boxing/BoxedForeach.java	Thu Jun 11 10:54:31 2009 -0700
   178.2 +++ b/test/tools/javac/boxing/BoxedForeach.java	Thu Jun 11 21:35:12 2009 -0700
   178.3 @@ -27,7 +27,7 @@
   178.4   * @summary boxing/unboxing versus foreach crashes javac
   178.5   * @author gafter
   178.6   *
   178.7 - * @compile -source 1.5 BoxedForeach.java
   178.8 + * @compile BoxedForeach.java
   178.9   * @run main BoxedForeach
  178.10   */
  178.11  
   179.1 --- a/test/tools/javac/boxing/Boxing1.java	Thu Jun 11 10:54:31 2009 -0700
   179.2 +++ b/test/tools/javac/boxing/Boxing1.java	Thu Jun 11 21:35:12 2009 -0700
   179.3 @@ -26,9 +26,6 @@
   179.4   * @bug 4869233 4872709 4868735 4921949 4921209 4965701 4934916 4975565 4974939
   179.5   * @summary Boxing/unboxing positive unit and regression tests
   179.6   * @author gafter
   179.7 - *
   179.8 - * @compile -source 1.5 Boxing1.java
   179.9 - * @run main Boxing1
  179.10   */
  179.11  
  179.12  public class Boxing1 {
   180.1 --- a/test/tools/javac/boxing/Boxing2.java	Thu Jun 11 10:54:31 2009 -0700
   180.2 +++ b/test/tools/javac/boxing/Boxing2.java	Thu Jun 11 21:35:12 2009 -0700
   180.3 @@ -27,7 +27,7 @@
   180.4   * @summary Boxing/unboxing negative unit and regression tests
   180.5   * @author gafter
   180.6   *
   180.7 - * @compile/fail -source 1.5 Boxing2.java
   180.8 + * @compile/fail Boxing2.java
   180.9   */
  180.10  
  180.11  public class Boxing2 {
   181.1 --- a/test/tools/javac/boxing/Boxing4.java	Thu Jun 11 10:54:31 2009 -0700
   181.2 +++ b/test/tools/javac/boxing/Boxing4.java	Thu Jun 11 21:35:12 2009 -0700
   181.3 @@ -26,9 +26,6 @@
   181.4   * @bug 4999689
   181.5   * @summary Compiler incorrectly create Integer in "Character c = 95"
   181.6   * @author gafter
   181.7 - *
   181.8 - * @compile -source 1.5 Boxing4.java
   181.9 - * @run main Boxing4
  181.10   */
  181.11  
  181.12  public class Boxing4 {
   182.1 --- a/test/tools/javac/boxing/BoxingCaching.java	Thu Jun 11 10:54:31 2009 -0700
   182.2 +++ b/test/tools/javac/boxing/BoxingCaching.java	Thu Jun 11 21:35:12 2009 -0700
   182.3 @@ -26,9 +26,6 @@
   182.4   * @bug 4990346
   182.5   * @summary Verify autoboxed values are cached as required.
   182.6   * @author Joseph D. Darcy
   182.7 - *
   182.8 - * @compile -source 1.5 BoxingCaching.java
   182.9 - * @run main BoxingCaching
  182.10   */
  182.11  
  182.12  public class BoxingCaching {
   183.1 --- a/test/tools/javac/capture/Capture1.java	Thu Jun 11 10:54:31 2009 -0700
   183.2 +++ b/test/tools/javac/capture/Capture1.java	Thu Jun 11 21:35:12 2009 -0700
   183.3 @@ -27,7 +27,7 @@
   183.4   * @summary wildcard capture (snapshotting)
   183.5   * @author gafter
   183.6   *
   183.7 - * @compile -Xlint:unchecked -Werror -source 1.5 Capture1.java
   183.8 + * @compile -Xlint:unchecked -Werror Capture1.java
   183.9   */
  183.10  
  183.11  package capture1;
   184.1 --- a/test/tools/javac/capture/Capture2.java	Thu Jun 11 10:54:31 2009 -0700
   184.2 +++ b/test/tools/javac/capture/Capture2.java	Thu Jun 11 21:35:12 2009 -0700
   184.3 @@ -27,7 +27,7 @@
   184.4   * @summary soundness problem with failure to subsitute wildcard as type formal argument
   184.5   * @author gafter
   184.6   *
   184.7 - * @compile/fail -source 1.5 Capture2.java
   184.8 + * @compile/fail Capture2.java
   184.9   */
  184.10  
  184.11  package capture2;
   185.1 --- a/test/tools/javac/capture/Capture3.java	Thu Jun 11 10:54:31 2009 -0700
   185.2 +++ b/test/tools/javac/capture/Capture3.java	Thu Jun 11 21:35:12 2009 -0700
   185.3 @@ -27,7 +27,7 @@
   185.4   * @summary new wildcard subst scheme breaks java.lang.ref
   185.5   * @author gafter
   185.6   *
   185.7 - * @compile -source 1.5 Capture3.java
   185.8 + * @compile Capture3.java
   185.9   */
  185.10  
  185.11  package capture3;
   186.1 --- a/test/tools/javac/capture/Capture5.java	Thu Jun 11 10:54:31 2009 -0700
   186.2 +++ b/test/tools/javac/capture/Capture5.java	Thu Jun 11 21:35:12 2009 -0700
   186.3 @@ -27,7 +27,7 @@
   186.4   * @summary wildcards versus recursive F-bounds
   186.5   * @author Peter von der Ahe
   186.6   *
   186.7 - * @compile -source 1.5 Capture5.java
   186.8 + * @compile Capture5.java
   186.9   */
  186.10  
  186.11  package capture5;
   187.1 --- a/test/tools/javac/cast/BoxedArray.java	Thu Jun 11 10:54:31 2009 -0700
   187.2 +++ b/test/tools/javac/cast/BoxedArray.java	Thu Jun 11 21:35:12 2009 -0700
   187.3 @@ -27,7 +27,7 @@
   187.4   * @summary REGRESSION: compiler allows cast from Integer[] to int[]
   187.5   * @author gafter
   187.6   *
   187.7 - * @compile/fail -source 1.5 BoxedArray.java
   187.8 + * @compile/fail BoxedArray.java
   187.9   */
  187.10  
  187.11  public class BoxedArray {
   188.1 --- a/test/tools/javac/code/ArrayClone.java	Thu Jun 11 10:54:31 2009 -0700
   188.2 +++ b/test/tools/javac/code/ArrayClone.java	Thu Jun 11 21:35:12 2009 -0700
   188.3 @@ -25,15 +25,38 @@
   188.4   * @test
   188.5   * @bug 4329886
   188.6   * @summary Clone() on arrays compiled incorrectly
   188.7 - * @author gafter
   188.8 - *
   188.9 - * @ignore Waiting for javap bug 4650860 to be fixed.
  188.10 - *
  188.11 - * @run shell ArrayClone.sh
  188.12 + * @author gafter jjg
  188.13   */
  188.14  
  188.15 +import java.io.*;
  188.16 +
  188.17  /** The qualifying type in the code for array.clone() should be the array type. */
  188.18 -class ArrayClone {
  188.19 +public class ArrayClone {
  188.20 +    public static void main(String[] args) {
  188.21 +        new ArrayClone().run();
  188.22 +    }
  188.23 +
  188.24 +    public void run() {
  188.25 +        String[] args = { "-classpath", System.getProperty("test.classes", "."), "-v", "Test" };
  188.26 +        StringWriter sw = new StringWriter();
  188.27 +        PrintWriter pw = new PrintWriter(sw);
  188.28 +        int rc = com.sun.tools.javap.Main.run(args, pw);
  188.29 +        if (rc != 0)
  188.30 +            throw new Error("javap failed; exit " + rc);
  188.31 +
  188.32 +        String out = sw.toString();
  188.33 +        System.out.println(out);
  188.34 +
  188.35 +        for (String line: out.split("\n")) {
  188.36 +            String match = "[ \t]+[0-9]+:[ \t]+invokevirtual[ \t]+#[0-9]+; //Method \"\\[Ljava/lang/String;\".clone:\\(\\)Ljava/lang/Object;";
  188.37 +            if (line.matches(match))
  188.38 +                return;
  188.39 +        }
  188.40 +        throw new Error("expected string not found in javap output");
  188.41 +    }
  188.42 +}
  188.43 +
  188.44 +class Test {
  188.45      public static void main(String[] args) {
  188.46          args.clone();
  188.47      }
   189.1 --- a/test/tools/javac/code/ArrayClone.sh	Thu Jun 11 10:54:31 2009 -0700
   189.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   189.3 @@ -1,86 +0,0 @@
   189.4 -#!/bin/sh
   189.5 -
   189.6 -#
   189.7 -# Copyright 2002 Sun Microsystems, Inc.  All Rights Reserved.
   189.8 -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   189.9 -#
  189.10 -# This code is free software; you can redistribute it and/or modify it
  189.11 -# under the terms of the GNU General Public License version 2 only, as
  189.12 -# published by the Free Software Foundation.
  189.13 -#
  189.14 -# This code is distributed in the hope that it will be useful, but WITHOUT
  189.15 -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  189.16 -# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  189.17 -# version 2 for more details (a copy is included in the LICENSE file that
  189.18 -# accompanied this code).
  189.19 -#
  189.20 -# You should have received a copy of the GNU General Public License version
  189.21 -# 2 along with this work; if not, write to the Free Software Foundation,
  189.22 -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  189.23 -#
  189.24 -# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  189.25 -# CA 95054 USA or visit www.sun.com if you need additional information or
  189.26 -# have any questions.
  189.27 -#
  189.28 -
  189.29 -
  189.30 -if [ "${TESTSRC}" = "" ]
  189.31 -then
  189.32 -  echo "TESTSRC not set.  Test cannot execute.  Failed."
  189.33 -  exit 1
  189.34 -fi
  189.35 -echo "TESTSRC=${TESTSRC}"
  189.36 -if [ "${TESTJAVA}" = "" ]
  189.37 -then
  189.38 -  echo "TESTJAVA not set.  Test cannot execute.  Failed."
  189.39 -  exit 1
  189.40 -fi
  189.41 -echo "TESTJAVA=${TESTJAVA}"
  189.42 -if [ "${TESTCLASSES}" = "" ]
  189.43 -then
  189.44 -  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
  189.45 -  exit 1
  189.46 -fi
  189.47 -echo "TESTCLASSES=${TESTCLASSES}"
  189.48 -echo "CLASSPATH=${CLASSPATH}"
  189.49 -
  189.50 -# set platform-dependent variables
  189.51 -OS=`uname -s`
  189.52 -case "$OS" in
  189.53 -  SunOS | Linux )
  189.54 -    NULL=/dev/null
  189.55 -    PS=":"
  189.56 -    FS="/"
  189.57 -    ;;
  189.58 -  Windows_95 | Windows_98 | Windows_NT )
  189.59 -    NULL=NUL
  189.60 -    PS=";"
  189.61 -    FS="\\"
  189.62 -    ;;
  189.63 -  * )
  189.64 -    echo "Unrecognized system!"
  189.65 -    exit 1;
  189.66 -    ;;
  189.67 -esac
  189.68 -
  189.69 -TMP1=OUTPUT.txt
  189.70 -
  189.71 -cp "${TESTSRC}${FS}ArrayClone.java" .
  189.72 -"${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -target 1.5 ArrayClone.java
  189.73 -result=$?
  189.74 -if [ $result -ne 0 ]
  189.75 -then
  189.76 -    exit $result
  189.77 -fi
  189.78 -
  189.79 -"${TESTJAVA}${FS}bin${FS}javap" ${TESTTOOLVMOPTS} -c ArrayClone > ${TMP1}
  189.80 -grep WHAT_SHOULD_WE_LOOK_FOR ${TMP1}
  189.81 -result=$?
  189.82 -
  189.83 -if [ $result -eq 0 ]
  189.84 -then
  189.85 -  echo "Passed"
  189.86 -else
  189.87 -  echo "Failed"
  189.88 -fi
  189.89 -exit $result
   190.1 --- a/test/tools/javac/enum/AbstractEmptyEnum.java	Thu Jun 11 10:54:31 2009 -0700
   190.2 +++ b/test/tools/javac/enum/AbstractEmptyEnum.java	Thu Jun 11 21:35:12 2009 -0700
   190.3 @@ -27,7 +27,7 @@
   190.4   * @summary empty enum cannot be abstract
   190.5   * @author Joseph D. Darcy
   190.6   *
   190.7 - * @compile/fail -source 1.5 AbstractEmptyEnum.java
   190.8 + * @compile/fail AbstractEmptyEnum.java
   190.9   */
  190.10  
  190.11  public enum AbstractEmptyEnum {
   191.1 --- a/test/tools/javac/enum/AbstractEnum1.java	Thu Jun 11 10:54:31 2009 -0700
   191.2 +++ b/test/tools/javac/enum/AbstractEnum1.java	Thu Jun 11 21:35:12 2009 -0700
   191.3 @@ -26,9 +26,6 @@
   191.4   * @bug 5054976
   191.5   * @summary compiler fails to flag an enum abstract
   191.6   * @author gafter
   191.7 - *
   191.8 - * @compile -source 1.5 AbstractEnum1.java
   191.9 - * @run main AbstractEnum1
  191.10   */
  191.11  
  191.12  import java.lang.reflect.Modifier;
   192.1 --- a/test/tools/javac/enum/DA1.java	Thu Jun 11 10:54:31 2009 -0700
   192.2 +++ b/test/tools/javac/enum/DA1.java	Thu Jun 11 21:35:12 2009 -0700
   192.3 @@ -27,7 +27,7 @@
   192.4   * @summary One can refer static, const static variables from instance initializers of enum
   192.5   * @author gafter
   192.6   *
   192.7 - * @compile/fail -source 1.5 DA1.java
   192.8 + * @compile/fail DA1.java
   192.9   */
  192.10  
  192.11  package da1;
   193.1 --- a/test/tools/javac/enum/DA2.java	Thu Jun 11 10:54:31 2009 -0700
   193.2 +++ b/test/tools/javac/enum/DA2.java	Thu Jun 11 21:35:12 2009 -0700
   193.3 @@ -27,7 +27,7 @@
   193.4   * @summary One can refer static, const static variables from instance initializers of enum
   193.5   * @author gafter
   193.6   *
   193.7 - * @compile/fail -source 1.5 DA2.java
   193.8 + * @compile/fail DA2.java
   193.9   */
  193.10  
  193.11  package da2;
   194.1 --- a/test/tools/javac/enum/DA3.java	Thu Jun 11 10:54:31 2009 -0700
   194.2 +++ b/test/tools/javac/enum/DA3.java	Thu Jun 11 21:35:12 2009 -0700
   194.3 @@ -27,7 +27,7 @@
   194.4   * @summary One can refer static, const static variables from instance initializers of enum
   194.5   * @author gafter
   194.6   *
   194.7 - * @compile/fail -source 1.5 DA3.java
   194.8 + * @compile/fail DA3.java
   194.9   */
  194.10  
  194.11  package da3;
   195.1 --- a/test/tools/javac/enum/Def.java	Thu Jun 11 10:54:31 2009 -0700
   195.2 +++ b/test/tools/javac/enum/Def.java	Thu Jun 11 21:35:12 2009 -0700
   195.3 @@ -27,7 +27,7 @@
   195.4   * @summary constant static fields cannot be referenced from const, instance initializers
   195.5   * @author gafter
   195.6   *
   195.7 - * @compile -source 1.5 Def.java
   195.8 + * @compile Def.java
   195.9   */
  195.10  
  195.11  package _enum.def;
   196.1 --- a/test/tools/javac/enum/Enum1.java	Thu Jun 11 10:54:31 2009 -0700
   196.2 +++ b/test/tools/javac/enum/Enum1.java	Thu Jun 11 21:35:12 2009 -0700
   196.3 @@ -26,9 +26,6 @@
   196.4   * @bug 4945532
   196.5   * @summary enums: test output of values().toString()
   196.6   * @author gafter
   196.7 - *
   196.8 - * @compile -source 1.5 Enum1.java
   196.9 - * @run main Enum1
  196.10   */
  196.11  
  196.12  import java.util.*;
   197.1 --- a/test/tools/javac/enum/Enum2.java	Thu Jun 11 10:54:31 2009 -0700
   197.2 +++ b/test/tools/javac/enum/Enum2.java	Thu Jun 11 21:35:12 2009 -0700
   197.3 @@ -26,7 +26,7 @@
   197.4   * @summary enums: an enumeration type may not be extended
   197.5   * @author gafter
   197.6   *
   197.7 - * @compile/fail -source 1.5 Enum2.java
   197.8 + * @compile/fail Enum2.java
   197.9   */
  197.10  
  197.11  public class Enum2 {
   198.1 --- a/test/tools/javac/enum/Enum3.java	Thu Jun 11 10:54:31 2009 -0700
   198.2 +++ b/test/tools/javac/enum/Enum3.java	Thu Jun 11 21:35:12 2009 -0700
   198.3 @@ -26,9 +26,6 @@
   198.4   * @bug 4945532
   198.5   * @summary enums: test switch
   198.6   * @author gafter
   198.7 - *
   198.8 - * @compile -source 1.5 Enum3.java
   198.9 - * @run main Enum3
  198.10   */
  198.11  
  198.12  public enum Enum3 {
   199.1 --- a/test/tools/javac/enum/EnumImplicitPrivateConstructor.java	Thu Jun 11 10:54:31 2009 -0700
   199.2 +++ b/test/tools/javac/enum/EnumImplicitPrivateConstructor.java	Thu Jun 11 21:35:12 2009 -0700
   199.3 @@ -26,9 +26,6 @@
   199.4   * @bug 5009601 5010455 5005748
   199.5   * @summary enum constructors can be declared private
   199.6   * @author Joseph D. Darcy
   199.7 - *
   199.8 - * @compile -source 1.5 EnumImplicitPrivateConstructor.java
   199.9 - * @run main EnumImplicitPrivateConstructor
  199.10   */
  199.11  
  199.12  import java.util.*;
   200.1 --- a/test/tools/javac/enum/EnumInit.java	Thu Jun 11 10:54:31 2009 -0700
   200.2 +++ b/test/tools/javac/enum/EnumInit.java	Thu Jun 11 21:35:12 2009 -0700
   200.3 @@ -27,7 +27,7 @@
   200.4   * @summary compiling annatations with nested enums issuing *.java leads to crash
   200.5   * @author gafter
   200.6   *
   200.7 - * @compile -source 1.5 EnumInit.java
   200.8 + * @compile EnumInit.java
   200.9   */
  200.10  
  200.11  package enum_init_;
   201.1 --- a/test/tools/javac/enum/EnumPrivateConstructor.java	Thu Jun 11 10:54:31 2009 -0700
   201.2 +++ b/test/tools/javac/enum/EnumPrivateConstructor.java	Thu Jun 11 21:35:12 2009 -0700
   201.3 @@ -27,7 +27,7 @@
   201.4   * @summary enum constructors can be declared private
   201.5   * @author Joseph D. Darcy
   201.6   *
   201.7 - * @compile -source 1.5 EnumPrivateConstructor.java
   201.8 + * @compile EnumPrivateConstructor.java
   201.9   */
  201.10  
  201.11  enum EnumPrivateConstructor {
   202.1 --- a/test/tools/javac/enum/EnumProtectedConstructor.java	Thu Jun 11 10:54:31 2009 -0700
   202.2 +++ b/test/tools/javac/enum/EnumProtectedConstructor.java	Thu Jun 11 21:35:12 2009 -0700
   202.3 @@ -27,7 +27,7 @@
   202.4   * @summary enum constructors cannot be declared public or protected
   202.5   * @author Joseph D. Darcy
   202.6   *
   202.7 - * @compile/fail -source 1.5 EnumProtectedConstructor.java
   202.8 + * @compile/fail EnumProtectedConstructor.java
   202.9   */
  202.10  
  202.11  enum EnumProtectedConstructor {
   203.1 --- a/test/tools/javac/enum/EnumPublicConstructor.java	Thu Jun 11 10:54:31 2009 -0700
   203.2 +++ b/test/tools/javac/enum/EnumPublicConstructor.java	Thu Jun 11 21:35:12 2009 -0700
   203.3 @@ -27,7 +27,7 @@
   203.4   * @summary enum constructors cannot be declared public or protected
   203.5   * @author Joseph D. Darcy
   203.6   *
   203.7 - * @compile/fail -source 1.5 EnumPublicConstructor.java
   203.8 + * @compile/fail EnumPublicConstructor.java
   203.9   */
  203.10  
  203.11  enum EnumPublicConstructor {
   204.1 --- a/test/tools/javac/enum/EnumSwitch1.java	Thu Jun 11 10:54:31 2009 -0700
   204.2 +++ b/test/tools/javac/enum/EnumSwitch1.java	Thu Jun 11 21:35:12 2009 -0700
   204.3 @@ -27,7 +27,7 @@
   204.4   * @summary enum switch case labels required to be unqualified.
   204.5   * @author gafter
   204.6   *
   204.7 - * @compile -source 1.5 EnumSwitch1.java
   204.8 + * @compile EnumSwitch1.java
   204.9   */
  204.10  
  204.11  package enumswitch1;
   205.1 --- a/test/tools/javac/enum/EnumSwitch2.java	Thu Jun 11 10:54:31 2009 -0700
   205.2 +++ b/test/tools/javac/enum/EnumSwitch2.java	Thu Jun 11 21:35:12 2009 -0700
   205.3 @@ -27,7 +27,7 @@
   205.4   * @summary enum switch case labels required to be unqualified.
   205.5   * @author gafter
   205.6   *
   205.7 - * @compile/fail -source 1.5 EnumSwitch2.java
   205.8 + * @compile/fail EnumSwitch2.java
   205.9   */
  205.10  
  205.11  package enumswitch2;
   206.1 --- a/test/tools/javac/enum/EnumSwitch3.java	Thu Jun 11 10:54:31 2009 -0700
   206.2 +++ b/test/tools/javac/enum/EnumSwitch3.java	Thu Jun 11 21:35:12 2009 -0700
   206.3 @@ -27,7 +27,7 @@
   206.4   * @summary javac crash when enum defined after use
   206.5   * @author gafter
   206.6   *
   206.7 - * @compile -source 1.5 EnumSwitch3.java
   206.8 + * @compile EnumSwitch3.java
   206.9   */
  206.10  
  206.11  package enumswitch3;
   207.1 --- a/test/tools/javac/enum/EnumSwitch4.java	Thu Jun 11 10:54:31 2009 -0700
   207.2 +++ b/test/tools/javac/enum/EnumSwitch4.java	Thu Jun 11 21:35:12 2009 -0700
   207.3 @@ -26,9 +26,6 @@
   207.4   * @bug 5006662
   207.5   * @summary enum switch on null fails to throw NullPointerException
   207.6   * @author gafter
   207.7 - *
   207.8 - * @compile -source 1.5 EnumSwitch4.java
   207.9 - * @run main EnumSwitch4
  207.10   */
  207.11  
  207.12  public enum EnumSwitch4 {
   208.1 --- a/test/tools/javac/enum/ExplicitlyAbstractEnum1.java	Thu Jun 11 10:54:31 2009 -0700
   208.2 +++ b/test/tools/javac/enum/ExplicitlyAbstractEnum1.java	Thu Jun 11 21:35:12 2009 -0700
   208.3 @@ -27,7 +27,7 @@
   208.4   * @summary enum's cannot be explicitly declared abstract
   208.5   * @author Joseph D. Darcy
   208.6   *
   208.7 - * @compile/fail -source 1.5 ExplicitlyAbstractEnum1.java
   208.8 + * @compile/fail ExplicitlyAbstractEnum1.java
   208.9   */
  208.10  
  208.11  abstract enum ExplicitlyAbstractEnum1 {
   209.1 --- a/test/tools/javac/enum/ExplicitlyAbstractEnum2.java	Thu Jun 11 10:54:31 2009 -0700
   209.2 +++ b/test/tools/javac/enum/ExplicitlyAbstractEnum2.java	Thu Jun 11 21:35:12 2009 -0700
   209.3 @@ -27,7 +27,7 @@
   209.4   * @summary enum's cannot be explicitly declared abstract even if they are abstract
   209.5   * @author Joseph D. Darcy
   209.6   *
   209.7 - * @compile/fail -source 1.5 ExplicitlyAbstractEnum2.java
   209.8 + * @compile/fail ExplicitlyAbstractEnum2.java
   209.9   */
  209.10  
  209.11  abstract enum ExplicitlyAbstractEnum2 {
   210.1 --- a/test/tools/javac/enum/ExplicitlyFinalEnum1.java	Thu Jun 11 10:54:31 2009 -0700
   210.2 +++ b/test/tools/javac/enum/ExplicitlyFinalEnum1.java	Thu Jun 11 21:35:12 2009 -0700
   210.3 @@ -27,7 +27,7 @@
   210.4   * @summary enum's cannot be explicitly declared final even if they are
   210.5   * @author Joseph D. Darcy
   210.6   *
   210.7 - * @compile/fail -source 1.5 ExplicitlyFinalEnum1.java
   210.8 + * @compile/fail ExplicitlyFinalEnum1.java
   210.9   */
  210.10  
  210.11  final enum ExplicitlyFinalEnum1 {
   211.1 --- a/test/tools/javac/enum/ExplicitlyFinalEnum2.java	Thu Jun 11 10:54:31 2009 -0700
   211.2 +++ b/test/tools/javac/enum/ExplicitlyFinalEnum2.java	Thu Jun 11 21:35:12 2009 -0700
   211.3 @@ -27,7 +27,7 @@
   211.4   * @summary enum's cannot be explicitly declared final
   211.5   * @author Joseph D. Darcy
   211.6   *
   211.7 - * @compile/fail -source 1.5 ExplicitlyFinalEnum2.java
   211.8 + * @compile/fail ExplicitlyFinalEnum2.java
   211.9   */
  211.10  
  211.11  final enum ExplicitlyFinalEnum2 {
   212.1 --- a/test/tools/javac/enum/FauxEnum1.java	Thu Jun 11 10:54:31 2009 -0700
   212.2 +++ b/test/tools/javac/enum/FauxEnum1.java	Thu Jun 11 21:35:12 2009 -0700
   212.3 @@ -27,7 +27,7 @@
   212.4   * @summary verify java.lang.Enum can't be directly subclassed
   212.5   * @author Joseph D. Darcy
   212.6   *
   212.7 - * @compile/fail -source 1.5 FauxEnum1.java
   212.8 + * @compile/fail FauxEnum1.java
   212.9   */
  212.10  
  212.11  public class FauxEnum1 extends java.lang.Enum {
   213.1 --- a/test/tools/javac/enum/FauxEnum3.java	Thu Jun 11 10:54:31 2009 -0700
   213.2 +++ b/test/tools/javac/enum/FauxEnum3.java	Thu Jun 11 21:35:12 2009 -0700
   213.3 @@ -27,7 +27,7 @@
   213.4   * @summary verify an enum type can't be directly subclassed
   213.5   * @author Joseph D. Darcy
   213.6   *
   213.7 - * @compile/fail -source 1.5 FauxEnum3.java
   213.8 + * @compile/fail FauxEnum3.java
   213.9   */
  213.10  
  213.11  public class FauxEnum3 extends SpecializedEnum {
   214.1 --- a/test/tools/javac/enum/FauxSpecialEnum1.java	Thu Jun 11 10:54:31 2009 -0700
   214.2 +++ b/test/tools/javac/enum/FauxSpecialEnum1.java	Thu Jun 11 21:35:12 2009 -0700
   214.3 @@ -27,7 +27,7 @@
   214.4   * @summary verify specialized enum classes can't be abstract
   214.5   * @author Joseph D. Darcy
   214.6   *
   214.7 - * @compile/fail -source 1.5 FauxSpecialEnum1.java
   214.8 + * @compile/fail FauxSpecialEnum1.java
   214.9   */
  214.10  
  214.11  public enum FauxSpecialEnum1 {
   215.1 --- a/test/tools/javac/enum/FauxSpecialEnum2.java	Thu Jun 11 10:54:31 2009 -0700
   215.2 +++ b/test/tools/javac/enum/FauxSpecialEnum2.java	Thu Jun 11 21:35:12 2009 -0700
   215.3 @@ -27,7 +27,7 @@
   215.4   * @summary verify specialized enum classes can't be abstract
   215.5   * @author Joseph D. Darcy
   215.6   *
   215.7 - * @compile/fail -source 1.5 FauxSpecialEnum2.java
   215.8 + * @compile/fail FauxSpecialEnum2.java
   215.9   */
  215.10  
  215.11  public enum FauxSpecialEnum2 {
   216.1 --- a/test/tools/javac/enum/LocalEnum.java	Thu Jun 11 10:54:31 2009 -0700
   216.2 +++ b/test/tools/javac/enum/LocalEnum.java	Thu Jun 11 21:35:12 2009 -0700
   216.3 @@ -27,7 +27,7 @@
   216.4   * @summary javac fails to reject local enums
   216.5   * @author gafter
   216.6   *
   216.7 - * @compile/fail -source 1.5 LocalEnum.java
   216.8 + * @compile/fail LocalEnum.java
   216.9   */
  216.10  
  216.11  public class LocalEnum {
   217.1 --- a/test/tools/javac/enum/NoFinal.java	Thu Jun 11 10:54:31 2009 -0700
   217.2 +++ b/test/tools/javac/enum/NoFinal.java	Thu Jun 11 21:35:12 2009 -0700
   217.3 @@ -26,7 +26,7 @@
   217.4   * @bug 5097250 5087624
   217.5   * @summary Finalize methods on enums must be compile time error
   217.6   * @author Peter von der Ah\u00e9
   217.7 - * @compile/fail -source 5 NoFinal.java
   217.8 + * @compile/fail NoFinal.java
   217.9   */
  217.10  
  217.11  enum NoFinal {
   218.1 --- a/test/tools/javac/enum/NoFinal2.java	Thu Jun 11 10:54:31 2009 -0700
   218.2 +++ b/test/tools/javac/enum/NoFinal2.java	Thu Jun 11 21:35:12 2009 -0700
   218.3 @@ -26,7 +26,7 @@
   218.4   * @bug 5097250 5087624
   218.5   * @summary Finalize methods on enums must be compile time error
   218.6   * @author Peter von der Ah\u00e9
   218.7 - * @compile/fail -source 5 NoFinal2.java
   218.8 + * @compile/fail NoFinal2.java
   218.9   */
  218.10  
  218.11  enum NoFinal2 {
   219.1 --- a/test/tools/javac/enum/NoFinal3.java	Thu Jun 11 10:54:31 2009 -0700
   219.2 +++ b/test/tools/javac/enum/NoFinal3.java	Thu Jun 11 21:35:12 2009 -0700
   219.3 @@ -26,7 +26,7 @@
   219.4   * @bug 5097250 5087624
   219.5   * @summary Finalize methods on enums must be compile time error
   219.6   * @author Peter von der Ah\u00e9
   219.7 - * @compile/fail -source 5 NoFinal3.java
   219.8 + * @compile/fail NoFinal3.java
   219.9   */
  219.10  
  219.11  enum NoFinal3 {
   220.1 --- a/test/tools/javac/enum/NoFinal4.java	Thu Jun 11 10:54:31 2009 -0700
   220.2 +++ b/test/tools/javac/enum/NoFinal4.java	Thu Jun 11 21:35:12 2009 -0700
   220.3 @@ -26,7 +26,7 @@
   220.4   * @bug 5097250 5087624
   220.5   * @summary Finalize methods on enums must be compile time error
   220.6   * @author Peter von der Ah\u00e9
   220.7 - * @compile/fail -source 5 NoFinal4.java
   220.8 + * @compile/fail NoFinal4.java
   220.9   */
  220.10  
  220.11  enum NoFinal4 {
   221.1 --- a/test/tools/javac/enum/NoFinal5.java	Thu Jun 11 10:54:31 2009 -0700
   221.2 +++ b/test/tools/javac/enum/NoFinal5.java	Thu Jun 11 21:35:12 2009 -0700
   221.3 @@ -26,7 +26,7 @@
   221.4   * @bug 5097250 5087624
   221.5   * @summary Finalize methods on enums must be compile time error
   221.6   * @author Peter von der Ah\u00e9
   221.7 - * @compile/fail -source 5 NoFinal5.java
   221.8 + * @compile/fail NoFinal5.java
   221.9   */
  221.10  
  221.11  enum NoFinal5 {
   222.1 --- a/test/tools/javac/enum/OkFinal.java	Thu Jun 11 10:54:31 2009 -0700
   222.2 +++ b/test/tools/javac/enum/OkFinal.java	Thu Jun 11 21:35:12 2009 -0700
   222.3 @@ -26,8 +26,6 @@
   222.4   * @bug 5097250
   222.5   * @summary Finalize methods on enums must be compile time error
   222.6   * @author Peter von der Ah\u00e9
   222.7 - * @compile -source 5 OkFinal.java
   222.8 - * @run main OkFinal
   222.9   */
  222.10  
  222.11  public enum OkFinal {
   223.1 --- a/test/tools/javac/enum/SynthValues.java	Thu Jun 11 10:54:31 2009 -0700
   223.2 +++ b/test/tools/javac/enum/SynthValues.java	Thu Jun 11 21:35:12 2009 -0700
   223.3 @@ -26,9 +26,6 @@
   223.4   * @bug 4984627
   223.5   * @summary Enums: +VALUES field has no synthetic attribute
   223.6   * @author gafter
   223.7 - *
   223.8 - * @compile -source 1.5 SynthValues.java
   223.9 - * @run main SynthValues
  223.10   */
  223.11  
  223.12  public enum SynthValues {
   224.1 --- a/test/tools/javac/enum/T5075242.java	Thu Jun 11 10:54:31 2009 -0700
   224.2 +++ b/test/tools/javac/enum/T5075242.java	Thu Jun 11 21:35:12 2009 -0700
   224.3 @@ -27,7 +27,7 @@
   224.4   * @summary Cannot make compound type involving Enums
   224.5   * @author Peter von der Ah\u00e9
   224.6   *
   224.7 - * @compile -source 5 T5075242.java
   224.8 + * @compile T5075242.java
   224.9   */
  224.10  
  224.11  interface Iface {
   225.1 --- a/test/tools/javac/enum/T5081785.java	Thu Jun 11 10:54:31 2009 -0700
   225.2 +++ b/test/tools/javac/enum/T5081785.java	Thu Jun 11 21:35:12 2009 -0700
   225.3 @@ -28,10 +28,10 @@
   225.4   * @summary Empty Enums allowed in non-static contexts
   225.5   * @author Peter von der Ah\u00e9
   225.6   *
   225.7 - * @compile/fail -source 1.5 T5081785.java
   225.8 - * @compile/fail -source 1.5 T5081785a.java
   225.9 - * @compile/fail -source 1.5 T5081785b.java
  225.10 - * @compile/fail -source 1.5 T5081785c.java
  225.11 + * @compile/fail T5081785.java
  225.12 + * @compile/fail T5081785a.java
  225.13 + * @compile/fail T5081785b.java
  225.14 + * @compile/fail T5081785c.java
  225.15   */
  225.16  
  225.17  class A {
   226.1 --- a/test/tools/javac/enum/TrailingComma.java	Thu Jun 11 10:54:31 2009 -0700
   226.2 +++ b/test/tools/javac/enum/TrailingComma.java	Thu Jun 11 21:35:12 2009 -0700
   226.3 @@ -27,7 +27,7 @@
   226.4   * @summary enum spec allows trailing comma on enum constant list
   226.5   * @author gafter
   226.6   *
   226.7 - * @compile -source 1.5 TrailingComma.java
   226.8 + * @compile TrailingComma.java
   226.9   */
  226.10  
  226.11  class TrailingComma {
   227.1 --- a/test/tools/javac/enum/UserValue.java	Thu Jun 11 10:54:31 2009 -0700
   227.2 +++ b/test/tools/javac/enum/UserValue.java	Thu Jun 11 21:35:12 2009 -0700
   227.3 @@ -27,7 +27,7 @@
   227.4   * @summary compiler crash on user-defined valueOf in enum
   227.5   * @author gafter
   227.6   *
   227.7 - * @compile -source 1.5 UserValue.java
   227.8 + * @compile UserValue.java
   227.9   */
  227.10  
  227.11  public enum UserValue {
   228.1 --- a/test/tools/javac/enum/ValueOf.java	Thu Jun 11 10:54:31 2009 -0700
   228.2 +++ b/test/tools/javac/enum/ValueOf.java	Thu Jun 11 21:35:12 2009 -0700
   228.3 @@ -26,9 +26,6 @@
   228.4   * @bug 4872708 5058132
   228.5   * @summary Improper signature for valueOf
   228.6   * @author gafter
   228.7 - *
   228.8 - * @compile -source 1.5 ValueOf.java
   228.9 - * @run main ValueOf
  228.10   */
  228.11  
  228.12  public enum ValueOf {
   229.1 --- a/test/tools/javac/enum/enumSwitch/EnumSwitch.java	Thu Jun 11 10:54:31 2009 -0700
   229.2 +++ b/test/tools/javac/enum/enumSwitch/EnumSwitch.java	Thu Jun 11 21:35:12 2009 -0700
   229.3 @@ -27,8 +27,8 @@
   229.4   * @summary javac-generated code doesn't obey binary compatibility for enums
   229.5   * @author gafter
   229.6   *
   229.7 - * @compile -source 1.5 EnumSwitch.java
   229.8 - * @compile -source 1.5 Color2.java
   229.9 + * @compile EnumSwitch.java
  229.10 + * @compile Color2.java
  229.11   * @run main EnumSwitch
  229.12   */
  229.13  
   230.1 --- a/test/tools/javac/foreach/Foreach.java	Thu Jun 11 10:54:31 2009 -0700
   230.2 +++ b/test/tools/javac/foreach/Foreach.java	Thu Jun 11 21:35:12 2009 -0700
   230.3 @@ -26,9 +26,6 @@
   230.4   * @bug 4855355
   230.5   * @summary implement "foreach" loops as specified in JSR 201
   230.6   * @author gafter
   230.7 - *
   230.8 - * @compile -source 1.5 Foreach.java
   230.9 - * @run main Foreach
  230.10   */
  230.11  
  230.12  import java.util.Iterator;
   231.1 --- a/test/tools/javac/foreach/GenericIterator.java	Thu Jun 11 10:54:31 2009 -0700
   231.2 +++ b/test/tools/javac/foreach/GenericIterator.java	Thu Jun 11 21:35:12 2009 -0700
   231.3 @@ -27,7 +27,7 @@
   231.4   * @summary extended 'for' with generic collections causes the compiler to crash
   231.5   * @author gafter
   231.6   *
   231.7 - * @compile -source 1.5 GenericIterator.java
   231.8 + * @compile GenericIterator.java
   231.9   */
  231.10  
  231.11  import java.util.*;
   232.1 --- a/test/tools/javac/foreach/IntersectIterator.java	Thu Jun 11 10:54:31 2009 -0700
   232.2 +++ b/test/tools/javac/foreach/IntersectIterator.java	Thu Jun 11 21:35:12 2009 -0700
   232.3 @@ -26,9 +26,6 @@
   232.4   * @bug 5003207
   232.5   * @summary new "for" statement  fails to cast to second upper bound
   232.6   * @author gafter
   232.7 - *
   232.8 - * @compile -source 1.5 IntersectIterator.java
   232.9 - * @run main IntersectIterator
  232.10   */
  232.11  
  232.12  import java.util.*;
   233.1 --- a/test/tools/javac/foreach/ListOfListTest.java	Thu Jun 11 10:54:31 2009 -0700
   233.2 +++ b/test/tools/javac/foreach/ListOfListTest.java	Thu Jun 11 21:35:12 2009 -0700
   233.3 @@ -26,9 +26,6 @@
   233.4   * @bug 4915435
   233.5   * @summary NullPointerError in Resolve.findMethod() with foreach vs generics
   233.6   * @author gafter
   233.7 - *
   233.8 - * @compile -source 1.5 ListOfListTest.java
   233.9 - * @run main ListOfListTest
  233.10   */
  233.11  
  233.12  import java.util.List;
   234.1 --- a/test/tools/javac/foreach/SpecIterable.java	Thu Jun 11 10:54:31 2009 -0700
   234.2 +++ b/test/tools/javac/foreach/SpecIterable.java	Thu Jun 11 21:35:12 2009 -0700
   234.3 @@ -26,9 +26,6 @@
   234.4   * @bug 4911157
   234.5   * @summary Runtime error because of missing method in iterator
   234.6   * @author gafter
   234.7 - *
   234.8 - * @compile -source 1.5 SpecIterable.java
   234.9 - * @run main SpecIterable
  234.10   */
  234.11  
  234.12  import java.util.Iterator;
   235.1 --- a/test/tools/javac/foreach/StaticBlock.java	Thu Jun 11 10:54:31 2009 -0700
   235.2 +++ b/test/tools/javac/foreach/StaticBlock.java	Thu Jun 11 21:35:12 2009 -0700
   235.3 @@ -27,7 +27,7 @@
   235.4   * @summary compiler crash (NullPointerException) with foreach in static context
   235.5   * @author gafter
   235.6   *
   235.7 - * @compile -source 1.5 StaticBlock.java
   235.8 + * @compile StaticBlock.java
   235.9   */
  235.10  
  235.11  public class StaticBlock {
   236.1 --- a/test/tools/javac/foreach/SuperfluousAbstract.java	Thu Jun 11 10:54:31 2009 -0700
   236.2 +++ b/test/tools/javac/foreach/SuperfluousAbstract.java	Thu Jun 11 21:35:12 2009 -0700
   236.3 @@ -26,9 +26,6 @@
   236.4   * @bug 4912795
   236.5   * @summary AbstractMethodError throws if not redeclare abstract iterator() method
   236.6   * @author gafter
   236.7 - *
   236.8 - * @compile -source 1.5 SuperfluousAbstract.java
   236.9 - * @run main SuperfluousAbstract
  236.10   */
  236.11  
  236.12  import java.util.AbstractCollection;
   237.1 --- a/test/tools/javac/foreach/T6682380.java	Thu Jun 11 10:54:31 2009 -0700
   237.2 +++ b/test/tools/javac/foreach/T6682380.java	Thu Jun 11 21:35:12 2009 -0700
   237.3 @@ -26,7 +26,7 @@
   237.4   * @bug 6682380 6679509
   237.5   * @summary Foreach loop with generics inside finally block crashes javac with -target 1.5
   237.6   * @author Jan Lahoda, Maurizio Cimadamore
   237.7 - * @compile -target 1.5 T6682380.java
   237.8 + * @compile -source 1.5 -target 1.5 T6682380.java
   237.9   */
  237.10  
  237.11  import java.util.List;
   238.1 --- a/test/tools/javac/generics/ArrayClone.java	Thu Jun 11 10:54:31 2009 -0700
   238.2 +++ b/test/tools/javac/generics/ArrayClone.java	Thu Jun 11 21:35:12 2009 -0700
   238.3 @@ -27,7 +27,7 @@
   238.4   * @summary The clone method on arrays should be strongly typed
   238.5   * @author gafter
   238.6   *
   238.7 - * @compile -source 1.5 ArrayClone.java
   238.8 + * @compile  ArrayClone.java
   238.9   * @run main ArrayClone
  238.10   */
  238.11  
   239.1 --- a/test/tools/javac/generics/ArrayTypearg.java	Thu Jun 11 10:54:31 2009 -0700
   239.2 +++ b/test/tools/javac/generics/ArrayTypearg.java	Thu Jun 11 21:35:12 2009 -0700
   239.3 @@ -27,7 +27,7 @@
   239.4   * @summary generics: array as generic argument type fails
   239.5   * @author gafter
   239.6   *
   239.7 - * @compile -source 1.5 ArrayTypearg.java
   239.8 + * @compile  ArrayTypearg.java
   239.9   */
  239.10  
  239.11  import java.util.List;
   240.1 --- a/test/tools/javac/generics/BridgeClash.java	Thu Jun 11 10:54:31 2009 -0700
   240.2 +++ b/test/tools/javac/generics/BridgeClash.java	Thu Jun 11 21:35:12 2009 -0700
   240.3 @@ -27,7 +27,7 @@
   240.4   * @summary generics: incorrect erasure clash reported
   240.5   * @author gafter
   240.6   *
   240.7 - * @compile -source 1.5 BridgeClash.java
   240.8 + * @compile  BridgeClash.java
   240.9   */
  240.10  
  240.11  interface I<T> {
   241.1 --- a/test/tools/javac/generics/BridgeOrder.java	Thu Jun 11 10:54:31 2009 -0700
   241.2 +++ b/test/tools/javac/generics/BridgeOrder.java	Thu Jun 11 21:35:12 2009 -0700
   241.3 @@ -27,7 +27,7 @@
   241.4   * @summary generics: overridden method gets invoked (bridge method problem)
   241.5   * @author gafter
   241.6   *
   241.7 - * @compile -source 1.5 BridgeOrder.java
   241.8 + * @compile  BridgeOrder.java
   241.9   * @run main BridgeOrder
  241.10   */
  241.11  
   242.1 --- a/test/tools/javac/generics/CastCrash.java	Thu Jun 11 10:54:31 2009 -0700
   242.2 +++ b/test/tools/javac/generics/CastCrash.java	Thu Jun 11 21:35:12 2009 -0700
   242.3 @@ -27,7 +27,7 @@
   242.4   * @summary Crash on cast
   242.5   * @author gafter
   242.6   *
   242.7 - * @compile/fail -source 1.5 CastCrash.java
   242.8 + * @compile/fail  CastCrash.java
   242.9   */
  242.10  
  242.11  package cast.crash;
   243.1 --- a/test/tools/javac/generics/Casting.java	Thu Jun 11 10:54:31 2009 -0700
   243.2 +++ b/test/tools/javac/generics/Casting.java	Thu Jun 11 21:35:12 2009 -0700
   243.3 @@ -27,7 +27,7 @@
   243.4   * @summary generics problem with casting
   243.5   * @author gafter
   243.6   *
   243.7 - * @compile -source 1.5 Casting.java
   243.8 + * @compile  Casting.java
   243.9   */
  243.10  
  243.11  package test.tools.javac.generics.Casting;
   244.1 --- a/test/tools/javac/generics/Casting2.java	Thu Jun 11 10:54:31 2009 -0700
   244.2 +++ b/test/tools/javac/generics/Casting2.java	Thu Jun 11 21:35:12 2009 -0700
   244.3 @@ -27,7 +27,7 @@
   244.4   * @summary stack overflow error compiling EnumSet.java
   244.5   * @author gafter
   244.6   *
   244.7 - * @compile -source 1.5 Casting2.java
   244.8 + * @compile  Casting2.java
   244.9   */
  244.10  
  244.11  import java.util.*;
   245.1 --- a/test/tools/javac/generics/Casting3.java	Thu Jun 11 10:54:31 2009 -0700
   245.2 +++ b/test/tools/javac/generics/Casting3.java	Thu Jun 11 21:35:12 2009 -0700
   245.3 @@ -27,7 +27,7 @@
   245.4   * @summary compiler crash with stack overflow on unchecked cast
   245.5   * @author gafter
   245.6   *
   245.7 - * @compile -source 1.5 Casting3.java
   245.8 + * @compile  Casting3.java
   245.9   */
  245.10  
  245.11  package test.tools.javac.generics.Casting3;
   246.1 --- a/test/tools/javac/generics/Casting4.java	Thu Jun 11 10:54:31 2009 -0700
   246.2 +++ b/test/tools/javac/generics/Casting4.java	Thu Jun 11 21:35:12 2009 -0700
   246.3 @@ -27,7 +27,7 @@
   246.4   * @summary Cannot cast Comparable<?>s
   246.5   * @author gafter
   246.6   *
   246.7 - * @compile -Werror -Xlint:unchecked -source 1.5 Casting4.java
   246.8 + * @compile -Werror -Xlint:unchecked  Casting4.java
   246.9   */
  246.10  
  246.11  package test.tools.javac.generics.Casting4;
   247.1 --- a/test/tools/javac/generics/Conditional.java	Thu Jun 11 10:54:31 2009 -0700
   247.2 +++ b/test/tools/javac/generics/Conditional.java	Thu Jun 11 21:35:12 2009 -0700
   247.3 @@ -27,7 +27,7 @@
   247.4   * @summary Rule for semantics of ?: in the presence of generics and generic class Class
   247.5   * @author gafter
   247.6   *
   247.7 - * @compile -source 1.5 Conditional.java
   247.8 + * @compile  Conditional.java
   247.9   */
  247.10  
  247.11  package conditional;
   248.1 --- a/test/tools/javac/generics/Covar2.java	Thu Jun 11 10:54:31 2009 -0700
   248.2 +++ b/test/tools/javac/generics/Covar2.java	Thu Jun 11 21:35:12 2009 -0700
   248.3 @@ -27,7 +27,7 @@
   248.4   * @summary Additional unit tests for covariant returns
   248.5   * @author gafter
   248.6   *
   248.7 - * @compile -source 1.5 Covar2.java
   248.8 + * @compile  Covar2.java
   248.9   * @run main Covar2
  248.10   */
  248.11  
   249.1 --- a/test/tools/javac/generics/Covar3.java	Thu Jun 11 10:54:31 2009 -0700
   249.2 +++ b/test/tools/javac/generics/Covar3.java	Thu Jun 11 21:35:12 2009 -0700
   249.3 @@ -27,7 +27,7 @@
   249.4   * @summary missing ambiguity error
   249.5   * @author gafter
   249.6   *
   249.7 - * @compile/fail -source 1.5 Covar3.java
   249.8 + * @compile/fail  Covar3.java
   249.9   */
  249.10  
  249.11  package covar3;
   250.1 --- a/test/tools/javac/generics/Covar4.java	Thu Jun 11 10:54:31 2009 -0700
   250.2 +++ b/test/tools/javac/generics/Covar4.java	Thu Jun 11 21:35:12 2009 -0700
   250.3 @@ -27,7 +27,7 @@
   250.4   * @summary no covariant returns involving primitives
   250.5   * @author gafter
   250.6   *
   250.7 - * @compile/fail -source 1.5 Covar4.java
   250.8 + * @compile/fail  Covar4.java
   250.9   */
  250.10  
  250.11  public class Covar4 {
   251.1 --- a/test/tools/javac/generics/Crash01.java	Thu Jun 11 10:54:31 2009 -0700
   251.2 +++ b/test/tools/javac/generics/Crash01.java	Thu Jun 11 21:35:12 2009 -0700
   251.3 @@ -27,7 +27,7 @@
   251.4   * @summary generics: crash when using class in bound defined after usage
   251.5   * @author gafter
   251.6   *
   251.7 - * @compile -source 1.5 Crash01.java
   251.8 + * @compile  Crash01.java
   251.9   */
  251.10  
  251.11  public class Crash01<A extends TestClass1 & IA> {
   252.1 --- a/test/tools/javac/generics/Crash02.java	Thu Jun 11 10:54:31 2009 -0700
   252.2 +++ b/test/tools/javac/generics/Crash02.java	Thu Jun 11 21:35:12 2009 -0700
   252.3 @@ -27,7 +27,7 @@
   252.4   * @summary compiler crash in class writer
   252.5   * @author gafter
   252.6   *
   252.7 - * @compile -source 1.5 Crash02.java
   252.8 + * @compile  Crash02.java
   252.9   */
  252.10  
  252.11  import java.util.ArrayList;
   253.1 --- a/test/tools/javac/generics/CyclicInheritance3.java	Thu Jun 11 10:54:31 2009 -0700
   253.2 +++ b/test/tools/javac/generics/CyclicInheritance3.java	Thu Jun 11 21:35:12 2009 -0700
   253.3 @@ -26,7 +26,7 @@
   253.4   * @bug 4861743
   253.5   * @summary generics: incorrect cyclic inheritance error with type parameters
   253.6   *
   253.7 - * @compile -source 1.5 CyclicInheritance3.java
   253.8 + * @compile  CyclicInheritance3.java
   253.9   */
  253.10  
  253.11  class Cycle {
   254.1 --- a/test/tools/javac/generics/CyclicInheritance5.java	Thu Jun 11 10:54:31 2009 -0700
   254.2 +++ b/test/tools/javac/generics/CyclicInheritance5.java	Thu Jun 11 21:35:12 2009 -0700
   254.3 @@ -26,7 +26,7 @@
   254.4   * @bug 4862621
   254.5   * @summary generics: incorrect cyclic inheritance error
   254.6   *
   254.7 - * @compile -source 1.5 CyclicInheritance5.java
   254.8 + * @compile  CyclicInheritance5.java
   254.9   */
  254.10  
  254.11  class G<N extends G.Node<N>> {
   255.1 --- a/test/tools/javac/generics/ErasureClashCrash.java	Thu Jun 11 10:54:31 2009 -0700
   255.2 +++ b/test/tools/javac/generics/ErasureClashCrash.java	Thu Jun 11 21:35:12 2009 -0700
   255.3 @@ -27,7 +27,7 @@
   255.4   * @summary javac crash with improper overrider
   255.5   * @author gafter
   255.6   *
   255.7 - * @compile/fail -source 1.5 ErasureClashCrash.java
   255.8 + * @compile/fail  ErasureClashCrash.java
   255.9   */
  255.10  
  255.11  interface Compar<T> {
   256.1 --- a/test/tools/javac/generics/ExtendedRaw1.java	Thu Jun 11 10:54:31 2009 -0700
   256.2 +++ b/test/tools/javac/generics/ExtendedRaw1.java	Thu Jun 11 21:35:12 2009 -0700
   256.3 @@ -27,7 +27,7 @@
   256.4   * @summary generics: extension of raw not treated as raw.
   256.5   * @author gafter
   256.6   *
   256.7 - * @compile -source 1.5 ExtendedRaw1.java
   256.8 + * @compile  ExtendedRaw1.java
   256.9   */
  256.10  
  256.11  class Comparator<T> {}
   257.1 --- a/test/tools/javac/generics/ExtendedRaw2.java	Thu Jun 11 10:54:31 2009 -0700
   257.2 +++ b/test/tools/javac/generics/ExtendedRaw2.java	Thu Jun 11 21:35:12 2009 -0700
   257.3 @@ -27,7 +27,7 @@
   257.4   * @summary generics: extension of raw not treated as raw.
   257.5   * @author gafter
   257.6   *
   257.7 - * @compile -source 1.5 ExtendedRaw2.java
   257.8 + * @compile  ExtendedRaw2.java
   257.9   */
  257.10  
  257.11  // from library
   258.1 --- a/test/tools/javac/generics/ExtendedRaw3.java	Thu Jun 11 10:54:31 2009 -0700
   258.2 +++ b/test/tools/javac/generics/ExtendedRaw3.java	Thu Jun 11 21:35:12 2009 -0700
   258.3 @@ -27,7 +27,7 @@
   258.4   * @summary generics: bridge method not considered to fulfil interface in abstract class
   258.5   * @author gafter
   258.6   *
   258.7 - * @compile -source 1.5 ExtendedRaw3.java
   258.8 + * @compile  ExtendedRaw3.java
   258.9   */
  258.10  
  258.11  interface MyComparable<T extends MyComparable<T>> {
   259.1 --- a/test/tools/javac/generics/ExtendedRaw4.java	Thu Jun 11 10:54:31 2009 -0700
   259.2 +++ b/test/tools/javac/generics/ExtendedRaw4.java	Thu Jun 11 21:35:12 2009 -0700
   259.3 @@ -27,7 +27,7 @@
   259.4   * @summary REGRESSION: compatibility problem inheriting raw type
   259.5   * @author gafter
   259.6   *
   259.7 - * @compile -source 1.5 ExtendedRaw4.java
   259.8 + * @compile  ExtendedRaw4.java
   259.9   */
  259.10  
  259.11  class ExtendedRaw4 extends java.util.TreeSet {}
   260.1 --- a/test/tools/javac/generics/FinalBridge.java	Thu Jun 11 10:54:31 2009 -0700
   260.2 +++ b/test/tools/javac/generics/FinalBridge.java	Thu Jun 11 21:35:12 2009 -0700
   260.3 @@ -27,7 +27,7 @@
   260.4   * @summary generics: bridge for inherited final method can cause verify error
   260.5   * @author gafter
   260.6   *
   260.7 - * @compile -source 1.5 FinalBridge.java
   260.8 + * @compile  FinalBridge.java
   260.9   * @run main FinalBridge
  260.10   */
  260.11  
   261.1 --- a/test/tools/javac/generics/GenLit1.java	Thu Jun 11 10:54:31 2009 -0700
   261.2 +++ b/test/tools/javac/generics/GenLit1.java	Thu Jun 11 21:35:12 2009 -0700
   261.3 @@ -27,7 +27,7 @@
   261.4   * @summary compiler crash with ill-formed annotation
   261.5   * @author gafter
   261.6   *
   261.7 - * @compile/fail -source 1.5 GenLit1.java
   261.8 + * @compile/fail  GenLit1.java
   261.9   */
  261.10  
  261.11  package genLit1;
   262.1 --- a/test/tools/javac/generics/GenLit2.java	Thu Jun 11 10:54:31 2009 -0700
   262.2 +++ b/test/tools/javac/generics/GenLit2.java	Thu Jun 11 21:35:12 2009 -0700
   262.3 @@ -27,7 +27,7 @@
   262.4   * @summary java allows class literal on generic type parameter array
   262.5   * @author gafter
   262.6   *
   262.7 - * @compile/fail -source 1.5 GenLit2.java
   262.8 + * @compile/fail  GenLit2.java
   262.9   */
  262.10  
  262.11  package genLit2;
   263.1 --- a/test/tools/javac/generics/GenericAnonCtor.java	Thu Jun 11 10:54:31 2009 -0700
   263.2 +++ b/test/tools/javac/generics/GenericAnonCtor.java	Thu Jun 11 21:35:12 2009 -0700
   263.3 @@ -27,7 +27,7 @@
   263.4   * @summary javac crash on parameterized anonymous constructor invocation
   263.5   * @author gafter
   263.6   *
   263.7 - * @compile -source 1.5 GenericAnonCtor.java
   263.8 + * @compile  GenericAnonCtor.java
   263.9   * @run main GenericAnonCtor
  263.10   */
  263.11  
   264.1 --- a/test/tools/javac/generics/GenericMerge.java	Thu Jun 11 10:54:31 2009 -0700
   264.2 +++ b/test/tools/javac/generics/GenericMerge.java	Thu Jun 11 21:35:12 2009 -0700
   264.3 @@ -27,7 +27,7 @@
   264.4   * @summary generics: compiler crash merging signatures of generic methods
   264.5   * @author gafter
   264.6   *
   264.7 - * @compile -source 1.5 GenericMerge.java
   264.8 + * @compile  GenericMerge.java
   264.9   */
  264.10  
  264.11  class Box<T> {}
   265.1 --- a/test/tools/javac/generics/GenericOverride.java	Thu Jun 11 10:54:31 2009 -0700
   265.2 +++ b/test/tools/javac/generics/GenericOverride.java	Thu Jun 11 21:35:12 2009 -0700
   265.3 @@ -27,7 +27,7 @@
   265.4   * @summary Cannot override non-trivial generic method
   265.5   * @author gafter
   265.6   *
   265.7 - * @compile -source 1.5 GenericOverride.java
   265.8 + * @compile  GenericOverride.java
   265.9   */
  265.10  
  265.11  package generic.override;
   266.1 --- a/test/tools/javac/generics/GenericThrowable.java	Thu Jun 11 10:54:31 2009 -0700
   266.2 +++ b/test/tools/javac/generics/GenericThrowable.java	Thu Jun 11 21:35:12 2009 -0700
   266.3 @@ -27,7 +27,7 @@
   266.4   * @summary java.lang.Throwable inheritance in parameterized type
   266.5   * @author gafter
   266.6   *
   266.7 - * @compile/fail -source 1.5 GenericThrowable.java
   266.8 + * @compile/fail  GenericThrowable.java
   266.9   */
  266.10  
  266.11  class GenericThrowable<T> extends NullPointerException {
   267.1 --- a/test/tools/javac/generics/GetClass.java	Thu Jun 11 10:54:31 2009 -0700
   267.2 +++ b/test/tools/javac/generics/GetClass.java	Thu Jun 11 21:35:12 2009 -0700
   267.3 @@ -27,7 +27,7 @@
   267.4   * @summary the type of x.getClass() is no longer Class<? extends X>
   267.5   * @author gafter
   267.6   *
   267.7 - * @compile/fail -source 1.5 GetClass.java
   267.8 + * @compile/fail  GetClass.java
   267.9   */
  267.10  
  267.11  public class GetClass {
   268.1 --- a/test/tools/javac/generics/GetClass2.java	Thu Jun 11 10:54:31 2009 -0700
   268.2 +++ b/test/tools/javac/generics/GetClass2.java	Thu Jun 11 21:35:12 2009 -0700
   268.3 @@ -27,7 +27,7 @@
   268.4   * @summary the type of x.getClass() is Class<? extends |X|>
   268.5   * @author seligman
   268.6   *
   268.7 - * @compile -source 1.5 GetClass2.java
   268.8 + * @compile  GetClass2.java
   268.9   * @run main GetClass2
  268.10   */
  268.11  
   269.1 --- a/test/tools/javac/generics/InheritanceConflict.java	Thu Jun 11 10:54:31 2009 -0700
   269.2 +++ b/test/tools/javac/generics/InheritanceConflict.java	Thu Jun 11 21:35:12 2009 -0700
   269.3 @@ -27,7 +27,7 @@
   269.4   * @summary two inherited methods with same signature
   269.5   * @author gafter, Maurizio Cimadamore
   269.6   *
   269.7 - * @compile/fail -source 1.5 InheritanceConflict.java
   269.8 + * @compile/fail  InheritanceConflict.java
   269.9   */
  269.10  
  269.11  package inheritance.conflict;
   270.1 --- a/test/tools/javac/generics/InheritanceConflict2.java	Thu Jun 11 10:54:31 2009 -0700
   270.2 +++ b/test/tools/javac/generics/InheritanceConflict2.java	Thu Jun 11 21:35:12 2009 -0700
   270.3 @@ -27,7 +27,7 @@
   270.4   * @summary two inherited methods with same signature
   270.5   * @author gafter, Maurizio Cimadamore
   270.6   *
   270.7 - * @compile -source 1.5 InheritanceConflict2.java
   270.8 + * @compile  InheritanceConflict2.java
   270.9   */
  270.10  
  270.11  package inheritance.conflict2;
   271.1 --- a/test/tools/javac/generics/InheritanceConflict3.java	Thu Jun 11 10:54:31 2009 -0700
   271.2 +++ b/test/tools/javac/generics/InheritanceConflict3.java	Thu Jun 11 21:35:12 2009 -0700
   271.3 @@ -27,7 +27,7 @@
   271.4   * @summary two inherited methods with same signature
   271.5   * @author darcy
   271.6   *
   271.7 - * @compile/fail -source 1.5 InheritanceConflict3.java
   271.8 + * @compile/fail  InheritanceConflict3.java
   271.9   */
  271.10  
  271.11  package inheritance.conflict3;
   272.1 --- a/test/tools/javac/generics/InnerInterface1.java	Thu Jun 11 10:54:31 2009 -0700
   272.2 +++ b/test/tools/javac/generics/InnerInterface1.java	Thu Jun 11 21:35:12 2009 -0700
   272.3 @@ -27,7 +27,7 @@
   272.4   * @summary Inner interfaces are not treated as static
   272.5   * @author gafter
   272.6   *
   272.7 - * @compile -source 1.5 InnerInterface1.java
   272.8 + * @compile  InnerInterface1.java
   272.9   */
  272.10  
  272.11  package test.tools.javac.generics.InnerInterface1;
   273.1 --- a/test/tools/javac/generics/InnerInterface2.java	Thu Jun 11 10:54:31 2009 -0700
   273.2 +++ b/test/tools/javac/generics/InnerInterface2.java	Thu Jun 11 21:35:12 2009 -0700
   273.3 @@ -27,7 +27,7 @@
   273.4   * @summary inner interface causes "not within bounds"
   273.5   * @author gafter
   273.6   *
   273.7 - * @compile -source 1.5 InnerInterface2.java
   273.8 + * @compile  InnerInterface2.java
   273.9   */
  273.10  
  273.11  package test.tools.javac.generics.InnerInterface2;
   274.1 --- a/test/tools/javac/generics/InstanceOf1.java	Thu Jun 11 10:54:31 2009 -0700
   274.2 +++ b/test/tools/javac/generics/InstanceOf1.java	Thu Jun 11 21:35:12 2009 -0700
   274.3 @@ -27,7 +27,7 @@
   274.4   * @summary the type in an instanceof expression must be reifiable
   274.5   * @author seligman
   274.6   *
   274.7 - * @compile -source 1.5 InstanceOf1.java
   274.8 + * @compile  InstanceOf1.java
   274.9   */
  274.10  
  274.11  public class InstanceOf1 {
   275.1 --- a/test/tools/javac/generics/InstanceOf2.java	Thu Jun 11 10:54:31 2009 -0700
   275.2 +++ b/test/tools/javac/generics/InstanceOf2.java	Thu Jun 11 21:35:12 2009 -0700
   275.3 @@ -27,7 +27,7 @@
   275.4   * @summary the type in an instanceof expression must be reifiable
   275.5   * @author seligman
   275.6   *
   275.7 - * @compile/fail -source 1.5 InstanceOf2.java
   275.8 + * @compile/fail  InstanceOf2.java
   275.9   */
  275.10  
  275.11  public class InstanceOf2 {
   276.1 --- a/test/tools/javac/generics/InstanceOf3.java	Thu Jun 11 10:54:31 2009 -0700
   276.2 +++ b/test/tools/javac/generics/InstanceOf3.java	Thu Jun 11 21:35:12 2009 -0700
   276.3 @@ -27,7 +27,7 @@
   276.4   * @summary the type in an instanceof expression must be reifiable
   276.5   * @author seligman
   276.6   *
   276.7 - * @compile/fail -source 1.5 InstanceOf3.java
   276.8 + * @compile/fail  InstanceOf3.java
   276.9   */
  276.10  
  276.11  public class InstanceOf3 {
   277.1 --- a/test/tools/javac/generics/InterfaceCast1.java	Thu Jun 11 10:54:31 2009 -0700
   277.2 +++ b/test/tools/javac/generics/InterfaceCast1.java	Thu Jun 11 21:35:12 2009 -0700
   277.3 @@ -27,7 +27,7 @@
   277.4   * @summary overridden interface method causes the compiler to reject cast
   277.5   * @author gafter
   277.6   *
   277.7 - * @compile -source 1.5 InterfaceCast1.java
   277.8 + * @compile  InterfaceCast1.java
   277.9   */
  277.10  
  277.11  public class InterfaceCast1 {
   278.1 --- a/test/tools/javac/generics/LoadOrder.java	Thu Jun 11 10:54:31 2009 -0700
   278.2 +++ b/test/tools/javac/generics/LoadOrder.java	Thu Jun 11 21:35:12 2009 -0700
   278.3 @@ -27,7 +27,7 @@
   278.4   * @summary generics: generic class files can cause recursive class loading (crashing javac)
   278.5   * @author gafter
   278.6   *
   278.7 - * @compile -source 1.5 LoadOrder.java
   278.8 + * @compile  LoadOrder.java
   278.9   */
  278.10  
  278.11  import java.util.Collections;
   279.1 --- a/test/tools/javac/generics/MissingBridge.java	Thu Jun 11 10:54:31 2009 -0700
   279.2 +++ b/test/tools/javac/generics/MissingBridge.java	Thu Jun 11 21:35:12 2009 -0700
   279.3 @@ -27,7 +27,7 @@
   279.4   * @summary Calling inherited generics method via interface causes AbstractMethodError
   279.5   * @author gafter
   279.6   *
   279.7 - * @compile -source 1.5 MissingBridge.java
   279.8 + * @compile  MissingBridge.java
   279.9   * @run main MissingBridge
  279.10   */
  279.11  
   280.1 --- a/test/tools/javac/generics/MissingCast.java	Thu Jun 11 10:54:31 2009 -0700
   280.2 +++ b/test/tools/javac/generics/MissingCast.java	Thu Jun 11 21:35:12 2009 -0700
   280.3 @@ -27,7 +27,7 @@
   280.4   * @summary redundant cast with generified APIs causes verify error
   280.5   * @author gafter
   280.6   *
   280.7 - * @compile -source 1.5 MissingCast.java
   280.8 + * @compile  MissingCast.java
   280.9   * @run main MissingCast
  280.10   */
  280.11  
   281.1 --- a/test/tools/javac/generics/Multibound1.java	Thu Jun 11 10:54:31 2009 -0700
   281.2 +++ b/test/tools/javac/generics/Multibound1.java	Thu Jun 11 21:35:12 2009 -0700
   281.3 @@ -27,7 +27,7 @@
   281.4   * @summary javac failed to check second bound
   281.5   * @author gafter
   281.6   *
   281.7 - * @compile/fail -source 1.5 Multibound1.java
   281.8 + * @compile/fail  Multibound1.java
   281.9   */
  281.10  
  281.11  package test.tools.javac.generics.Multibound1;
   282.1 --- a/test/tools/javac/generics/MultipleInheritance.java	Thu Jun 11 10:54:31 2009 -0700
   282.2 +++ b/test/tools/javac/generics/MultipleInheritance.java	Thu Jun 11 21:35:12 2009 -0700
   282.3 @@ -27,7 +27,7 @@
   282.4   * @summary generics problem with multiple interface extension
   282.5   * @author gafter
   282.6   *
   282.7 - * @compile -source 1.5 MultipleInheritance.java
   282.8 + * @compile  MultipleInheritance.java
   282.9   */
  282.10  
  282.11  package test.tools.javac.generics.MultipleInheritance;
   283.1 --- a/test/tools/javac/generics/NameOrder.java	Thu Jun 11 10:54:31 2009 -0700
   283.2 +++ b/test/tools/javac/generics/NameOrder.java	Thu Jun 11 21:35:12 2009 -0700
   283.3 @@ -27,7 +27,7 @@
   283.4   * @summary generics: type inference failure due to a bug in ClassSymbol.isLess
   283.5   * @author gafter
   283.6   *
   283.7 - * @compile -source 1.5 NameOrder.java
   283.8 + * @compile  NameOrder.java
   283.9   */
  283.10  
  283.11  package test.tools.javac.generics.NameOrder;
   284.1 --- a/test/tools/javac/generics/Nonlinear.java	Thu Jun 11 10:54:31 2009 -0700
   284.2 +++ b/test/tools/javac/generics/Nonlinear.java	Thu Jun 11 21:35:12 2009 -0700
   284.3 @@ -27,7 +27,7 @@
   284.4   * @summary A bug in the original JSR14 generics specification
   284.5   *          created a loophole in the type system.
   284.6   *
   284.7 - * @compile/fail -source 1.5 Nonlinear.java
   284.8 + * @compile/fail  Nonlinear.java
   284.9   */
  284.10  
  284.11  
   285.1 --- a/test/tools/javac/generics/ParametricException.java	Thu Jun 11 10:54:31 2009 -0700
   285.2 +++ b/test/tools/javac/generics/ParametricException.java	Thu Jun 11 21:35:12 2009 -0700
   285.3 @@ -27,7 +27,7 @@
   285.4   * @summary generics: parametric exception type versus overriding
   285.5   * @author gafter
   285.6   *
   285.7 - * @compile -source 1.5 ParametricException.java
   285.8 + * @compile  ParametricException.java
   285.9   */
  285.10  
  285.11  import java.io.*;
   286.1 --- a/test/tools/javac/generics/ParenVerify.java	Thu Jun 11 10:54:31 2009 -0700
   286.2 +++ b/test/tools/javac/generics/ParenVerify.java	Thu Jun 11 21:35:12 2009 -0700
   286.3 @@ -27,7 +27,7 @@
   286.4   * @summary generics: verify error when redundant parens used!
   286.5   * @author gafter
   286.6   *
   286.7 - * @compile -source 1.5 ParenVerify.java
   286.8 + * @compile  ParenVerify.java
   286.9   * @run main ParenVerify
  286.10   */
  286.11  
   287.1 --- a/test/tools/javac/generics/PermuteBound.java	Thu Jun 11 10:54:31 2009 -0700
   287.2 +++ b/test/tools/javac/generics/PermuteBound.java	Thu Jun 11 21:35:12 2009 -0700
   287.3 @@ -27,7 +27,7 @@
   287.4   * @summary generics: subtyping problem when type parameters permuted
   287.5   * @author gafter
   287.6   *
   287.7 - * @compile -source 1.5 PermuteBound.java
   287.8 + * @compile  PermuteBound.java
   287.9   */
  287.10  
  287.11  package test.tools.javac.generics.PermuteBound;
   288.1 --- a/test/tools/javac/generics/PrimitiveClass.java	Thu Jun 11 10:54:31 2009 -0700
   288.2 +++ b/test/tools/javac/generics/PrimitiveClass.java	Thu Jun 11 21:35:12 2009 -0700
   288.3 @@ -27,7 +27,7 @@
   288.4   * @summary int.class and ilk have wrong type (5028351 rejected)
   288.5   * @author gafter
   288.6   *
   288.7 - * @compile -source 1.5 PrimitiveClass.java
   288.8 + * @compile  PrimitiveClass.java
   288.9   */
  288.10  
  288.11  package primitive._class;
   289.1 --- a/test/tools/javac/generics/PrimitiveVariant.java	Thu Jun 11 10:54:31 2009 -0700
   289.2 +++ b/test/tools/javac/generics/PrimitiveVariant.java	Thu Jun 11 21:35:12 2009 -0700
   289.3 @@ -27,7 +27,7 @@
   289.4   * @summary compiler allows overriding with different primitive return type
   289.5   * @author gafter
   289.6   *
   289.7 - * @compile/fail -source 1.5 PrimitiveVariant.java
   289.8 + * @compile/fail  PrimitiveVariant.java
   289.9   */
  289.10  
  289.11  package test.tools.javac.generics.PrimitiveVariant;
   290.1 --- a/test/tools/javac/generics/RawClient.java	Thu Jun 11 10:54:31 2009 -0700
   290.2 +++ b/test/tools/javac/generics/RawClient.java	Thu Jun 11 21:35:12 2009 -0700
   290.3 @@ -27,7 +27,7 @@
   290.4   * @summary javac should implement JLS3 three-pass overload resolution
   290.5   * @author gafter
   290.6   *
   290.7 - * @compile -source 1.5 RawClient.java
   290.8 + * @compile  RawClient.java
   290.9   */
  290.10  
  290.11  package rawClient;
   291.1 --- a/test/tools/javac/generics/RefEqual.java	Thu Jun 11 10:54:31 2009 -0700
   291.2 +++ b/test/tools/javac/generics/RefEqual.java	Thu Jun 11 21:35:12 2009 -0700
   291.3 @@ -28,7 +28,7 @@
   291.4   * @author gafter
   291.5   *
   291.6   * @compile -source 1.4 RefEqual.java
   291.7 - * @compile/fail -source 1.5 RefEqual.java
   291.8 + * @compile/fail  RefEqual.java
   291.9   */
  291.10  
  291.11  class RefEqual {
   292.1 --- a/test/tools/javac/generics/RelaxedArrays.java	Thu Jun 11 10:54:31 2009 -0700
   292.2 +++ b/test/tools/javac/generics/RelaxedArrays.java	Thu Jun 11 21:35:12 2009 -0700
   292.3 @@ -27,7 +27,7 @@
   292.4   * @summary relaxed rules for array of generic type and varargs.
   292.5   * @author gafter
   292.6   *
   292.7 - * @compile -source 1.5 RelaxedArrays.java
   292.8 + * @compile  RelaxedArrays.java
   292.9   * @run main RelaxedArrays
  292.10   */
  292.11  
   293.1 --- a/test/tools/javac/generics/ReverseOrder.java	Thu Jun 11 10:54:31 2009 -0700
   293.2 +++ b/test/tools/javac/generics/ReverseOrder.java	Thu Jun 11 21:35:12 2009 -0700
   293.3 @@ -27,7 +27,7 @@
   293.4   * @summary problem with generic signature for reverseOrder
   293.5   * @author gafter
   293.6   *
   293.7 - * @compile -source 1.5 ReverseOrder.java
   293.8 + * @compile  ReverseOrder.java
   293.9   */
  293.10  
  293.11  package test.reverseOrder;
   294.1 --- a/test/tools/javac/generics/SelfImplement.java	Thu Jun 11 10:54:31 2009 -0700
   294.2 +++ b/test/tools/javac/generics/SelfImplement.java	Thu Jun 11 21:35:12 2009 -0700
   294.3 @@ -27,7 +27,7 @@
   294.4   * @summary generics: reject implementation with incorrect return type
   294.5   * @author gafter
   294.6   *
   294.7 - * @compile/fail -source 1.5 SelfImplement.java
   294.8 + * @compile/fail  SelfImplement.java
   294.9   */
  294.10  
  294.11  class SelfImplement {
   295.1 --- a/test/tools/javac/generics/SilentUnchecked.java	Thu Jun 11 10:54:31 2009 -0700
   295.2 +++ b/test/tools/javac/generics/SilentUnchecked.java	Thu Jun 11 21:35:12 2009 -0700
   295.3 @@ -27,7 +27,7 @@
   295.4   * @summary unchecked conversion from raw to reifiable generic requires no warning
   295.5   * @author gafter
   295.6   *
   295.7 - * @compile -Xlint:unchecked -Werror -source 1.5 SilentUnchecked.java
   295.8 + * @compile -Xlint:unchecked -Werror  SilentUnchecked.java
   295.9   */
  295.10  
  295.11  package silent.unchecked;
   296.1 --- a/test/tools/javac/generics/SuperTypeargs.java	Thu Jun 11 10:54:31 2009 -0700
   296.2 +++ b/test/tools/javac/generics/SuperTypeargs.java	Thu Jun 11 21:35:12 2009 -0700
   296.3 @@ -27,7 +27,7 @@
   296.4   * @summary compilation error for super.<T,E>f() and ClassName.super.<T,E>f()
   296.5   * @author gafter
   296.6   *
   296.7 - * @compile -source 1.5 SuperTypeargs.java
   296.8 + * @compile  SuperTypeargs.java
   296.9   */
  296.10  
  296.11  package superTypeargs;
   297.1 --- a/test/tools/javac/generics/T4661029.java	Thu Jun 11 10:54:31 2009 -0700
   297.2 +++ b/test/tools/javac/generics/T4661029.java	Thu Jun 11 21:35:12 2009 -0700
   297.3 @@ -26,7 +26,7 @@
   297.4   * @summary generics: assertion error using Arrays.fill
   297.5   * @author gafter
   297.6   *
   297.7 - * @compile -source 1.5 T4661029.java
   297.8 + * @compile  T4661029.java
   297.9   */
  297.10  
  297.11  public class T4661029 {
   298.1 --- a/test/tools/javac/generics/T4683314.java	Thu Jun 11 10:54:31 2009 -0700
   298.2 +++ b/test/tools/javac/generics/T4683314.java	Thu Jun 11 21:35:12 2009 -0700
   298.3 @@ -27,7 +27,7 @@
   298.4   * @summary generics: overload resolution error in non-generic code
   298.5   * @author gafter
   298.6   *
   298.7 - * @compile -source 1.5 T4683314.java
   298.8 + * @compile  T4683314.java
   298.9   */
  298.10  
  298.11  class T4683314a {
   299.1 --- a/test/tools/javac/generics/T4684378.java	Thu Jun 11 10:54:31 2009 -0700
   299.2 +++ b/test/tools/javac/generics/T4684378.java	Thu Jun 11 21:35:12 2009 -0700
   299.3 @@ -27,7 +27,7 @@
   299.4   * @summary generics: verify error in generated bytecode
   299.5   * @author gafter
   299.6   *
   299.7 - * @compile -source 1.5 T4684378.java
   299.8 + * @compile  T4684378.java
   299.9   * @run main T4684378
  299.10   */
  299.11  
   300.1 --- a/test/tools/javac/generics/T4695348.java	Thu Jun 11 10:54:31 2009 -0700
   300.2 +++ b/test/tools/javac/generics/T4695348.java	Thu Jun 11 21:35:12 2009 -0700
   300.3 @@ -27,7 +27,7 @@
   300.4   * @summary generics: compiler allows ref to type bounds in static members
   300.5   * @author gafter
   300.6   *
   300.7 - * @compile/fail -source 1.5 T4695348.java
   300.8 + * @compile/fail  T4695348.java
   300.9   */
  300.10  
  300.11  class T4695348<T> {
   301.1 --- a/test/tools/javac/generics/T4695415.java	Thu Jun 11 10:54:31 2009 -0700
   301.2 +++ b/test/tools/javac/generics/T4695415.java	Thu Jun 11 21:35:12 2009 -0700
   301.3 @@ -27,7 +27,7 @@
   301.4   * @summary generics: bug in type inference when method result used as an argument
   301.5   * @author gafter
   301.6   *
   301.7 - * @compile -source 1.5 T4695415.java
   301.8 + * @compile  T4695415.java
   301.9   */
  301.10  
  301.11  class X<T extends Number> {
   302.1 --- a/test/tools/javac/generics/T4695847.java	Thu Jun 11 10:54:31 2009 -0700
   302.2 +++ b/test/tools/javac/generics/T4695847.java	Thu Jun 11 21:35:12 2009 -0700
   302.3 @@ -27,7 +27,7 @@
   302.4   * @summary generics: problem with inference of primitive return values
   302.5   * @author gafter
   302.6   *
   302.7 - * @compile -source 1.5 T4695847.java
   302.8 + * @compile  T4695847.java
   302.9   */
  302.10  
  302.11  public class T4695847<T> {
   303.1 --- a/test/tools/javac/generics/T4711570.java	Thu Jun 11 10:54:31 2009 -0700
   303.2 +++ b/test/tools/javac/generics/T4711570.java	Thu Jun 11 21:35:12 2009 -0700
   303.3 @@ -27,7 +27,7 @@
   303.4   * @summary generics: problem with methods when type parameter doesn't appear in signature
   303.5   * @author gafter
   303.6   *
   303.7 - * @compile -source 1.5 T4711570.java
   303.8 + * @compile  T4711570.java
   303.9   */
  303.10  
  303.11  class T4711570 {
   304.1 --- a/test/tools/javac/generics/T4711572.java	Thu Jun 11 10:54:31 2009 -0700
   304.2 +++ b/test/tools/javac/generics/T4711572.java	Thu Jun 11 21:35:12 2009 -0700
   304.3 @@ -27,7 +27,7 @@
   304.4   * @summary generics: problem with type inference for recursive methods
   304.5   * @author gafter
   304.6   *
   304.7 - * @compile -source 1.5 T4683314.java
   304.8 + * @compile  T4683314.java
   304.9   */
  304.10  
  304.11  class T4711572 {
   305.1 --- a/test/tools/javac/generics/T4711694.java	Thu Jun 11 10:54:31 2009 -0700
   305.2 +++ b/test/tools/javac/generics/T4711694.java	Thu Jun 11 21:35:12 2009 -0700
   305.3 @@ -27,7 +27,7 @@
   305.4   * @summary generics: missing bridge method for inherited implementation
   305.5   * @author gafter
   305.6   *
   305.7 - * @compile -source 1.5 T4711694.java
   305.8 + * @compile  T4711694.java
   305.9   * @run main T4711694
  305.10   */
  305.11  
   306.1 --- a/test/tools/javac/generics/T4738171.java	Thu Jun 11 10:54:31 2009 -0700
   306.2 +++ b/test/tools/javac/generics/T4738171.java	Thu Jun 11 21:35:12 2009 -0700
   306.3 @@ -27,7 +27,7 @@
   306.4   * @summary generics: problem with equivalence of generic types
   306.5   * @author gafter
   306.6   *
   306.7 - * @compile/fail -source 1.5 T4738171.java
   306.8 + * @compile/fail  T4738171.java
   306.9   */
  306.10  
  306.11  interface If<T> {
   307.1 --- a/test/tools/javac/generics/T4739399.java	Thu Jun 11 10:54:31 2009 -0700
   307.2 +++ b/test/tools/javac/generics/T4739399.java	Thu Jun 11 21:35:12 2009 -0700
   307.3 @@ -27,7 +27,7 @@
   307.4   * @summary generics: crash after error regarding bounds on type variable
   307.5   * @author gafter
   307.6   *
   307.7 - * @compile/fail -source 1.5 T4739399.java
   307.8 + * @compile/fail  T4739399.java
   307.9   */
  307.10  
  307.11  class T4739399 {
   308.1 --- a/test/tools/javac/generics/T4757416.java	Thu Jun 11 10:54:31 2009 -0700
   308.2 +++ b/test/tools/javac/generics/T4757416.java	Thu Jun 11 21:35:12 2009 -0700
   308.3 @@ -27,7 +27,7 @@
   308.4   * @summary generics: erasure clash not detected
   308.5   * @author gafter
   308.6   *
   308.7 - * @compile/fail -source 1.5 T4757416.java
   308.8 + * @compile/fail  T4757416.java
   308.9   */
  308.10  
  308.11  class T4756416 {
   309.1 --- a/test/tools/javac/generics/T4784207a.java	Thu Jun 11 10:54:31 2009 -0700
   309.2 +++ b/test/tools/javac/generics/T4784207a.java	Thu Jun 11 21:35:12 2009 -0700
   309.3 @@ -27,8 +27,8 @@
   309.4   * @summary generics: method overriding missed with separate compilation
   309.5   * @author gafter
   309.6   *
   309.7 - * @compile -source 1.5 T4784207a.java
   309.8 - * @compile -source 1.5 T4784207b.java
   309.9 + * @compile  T4784207a.java
  309.10 + * @compile  T4784207b.java
  309.11   */
  309.12  
  309.13  interface T4784207a_i extends Comparable<T4784207a_i>{
   310.1 --- a/test/tools/javac/generics/T4784219.java	Thu Jun 11 10:54:31 2009 -0700
   310.2 +++ b/test/tools/javac/generics/T4784219.java	Thu Jun 11 21:35:12 2009 -0700
   310.3 @@ -27,7 +27,7 @@
   310.4   * @summary generics: compiler crash after diagnostic
   310.5   * @author gafter
   310.6   *
   310.7 - * @compile -source 1.5 T4683314.java
   310.8 + * @compile  T4683314.java
   310.9   */
  310.10  
  310.11  public class T4784219 {
   311.1 --- a/test/tools/javac/generics/T5011073.java	Thu Jun 11 10:54:31 2009 -0700
   311.2 +++ b/test/tools/javac/generics/T5011073.java	Thu Jun 11 21:35:12 2009 -0700
   311.3 @@ -27,7 +27,7 @@
   311.4   * @summary javac should implement JLS3 three-pass overload resolution
   311.5   * @author gafter
   311.6   *
   311.7 - * @compile/fail -source 1.5 T5011073.java
   311.8 + * @compile/fail  T5011073.java
   311.9   */
  311.10  
  311.11  import java.util.*;
   312.1 --- a/test/tools/javac/generics/T5094318.java	Thu Jun 11 10:54:31 2009 -0700
   312.2 +++ b/test/tools/javac/generics/T5094318.java	Thu Jun 11 21:35:12 2009 -0700
   312.3 @@ -28,7 +28,7 @@
   312.4   *
   312.5   * @compile -source 1.4 T5094318.java
   312.6   * @run main T5094318
   312.7 - * @compile -source 1.5 T5094318.java
   312.8 + * @compile  T5094318.java
   312.9   * @run main/fail T5094318
  312.10   */
  312.11  
   313.1 --- a/test/tools/javac/generics/TyparamLit.java	Thu Jun 11 10:54:31 2009 -0700
   313.2 +++ b/test/tools/javac/generics/TyparamLit.java	Thu Jun 11 21:35:12 2009 -0700
   313.3 @@ -27,7 +27,7 @@
   313.4   * @summary generics: compiler allows T.class for type variable T
   313.5   * @author gafter
   313.6   *
   313.7 - * @compile/fail -source 1.5 TyparamLit.java
   313.8 + * @compile/fail  TyparamLit.java
   313.9   */
  313.10  
  313.11  class TyparamLit<T> {
   314.1 --- a/test/tools/javac/generics/TyparamStaticScope.java	Thu Jun 11 10:54:31 2009 -0700
   314.2 +++ b/test/tools/javac/generics/TyparamStaticScope.java	Thu Jun 11 21:35:12 2009 -0700
   314.3 @@ -27,7 +27,7 @@
   314.4   * @summary javac mistakenly reports static use error for enclosing type parameter
   314.5   * @author gafter
   314.6   *
   314.7 - * @compile -source 1.5 TyparamStaticScope.java
   314.8 + * @compile  TyparamStaticScope.java
   314.9   */
  314.10  
  314.11  package typaram.static_.scope;
   315.1 --- a/test/tools/javac/generics/TyparamStaticScope2.java	Thu Jun 11 10:54:31 2009 -0700
   315.2 +++ b/test/tools/javac/generics/TyparamStaticScope2.java	Thu Jun 11 21:35:12 2009 -0700
   315.3 @@ -27,7 +27,7 @@
   315.4   * @summary type parameter referenced in static inner class improperly allowed!
   315.5   * @author gafter
   315.6   *
   315.7 - * @compile/fail -source 1.5 TyparamStaticScope2.java
   315.8 + * @compile/fail  TyparamStaticScope2.java
   315.9   */
  315.10  
  315.11  package typaram.static_.scope2;
   316.1 --- a/test/tools/javac/generics/UncheckedArray.java	Thu Jun 11 10:54:31 2009 -0700
   316.2 +++ b/test/tools/javac/generics/UncheckedArray.java	Thu Jun 11 21:35:12 2009 -0700
   316.3 @@ -27,7 +27,7 @@
   316.4   * @summary compiler allows new array of array of type parameter
   316.5   * @author gafter
   316.6   *
   316.7 - * @compile/fail -source 1.5 UncheckedArray.java
   316.8 + * @compile/fail  UncheckedArray.java
   316.9   */
  316.10  
  316.11  package unchecked.array;
   317.1 --- a/test/tools/javac/generics/UncheckedConstructor.java	Thu Jun 11 10:54:31 2009 -0700
   317.2 +++ b/test/tools/javac/generics/UncheckedConstructor.java	Thu Jun 11 21:35:12 2009 -0700
   317.3 @@ -27,8 +27,8 @@
   317.4   * @summary compiler disallows raw call to generic constructor
   317.5   * @author gafter
   317.6   *
   317.7 - * @compile      -source 1.5 -Werror                  UncheckedConstructor.java
   317.8 - * @compile/fail -source 1.5 -Werror -Xlint:unchecked UncheckedConstructor.java
   317.9 + * @compile       -Werror                  UncheckedConstructor.java
  317.10 + * @compile/fail  -Werror -Xlint:unchecked UncheckedConstructor.java
  317.11   */
  317.12  
  317.13  import java.util.*;
   318.1 --- a/test/tools/javac/generics/UncheckedCovariance.java	Thu Jun 11 10:54:31 2009 -0700
   318.2 +++ b/test/tools/javac/generics/UncheckedCovariance.java	Thu Jun 11 21:35:12 2009 -0700
   318.3 @@ -27,8 +27,8 @@
   318.4   * @summary A method returning a raw type cannot override a method returning a generic type
   318.5   * @author gafter
   318.6   *
   318.7 - * @compile -source 1.5 UncheckedCovariance.java
   318.8 - * @compile/fail -Xlint:unchecked -Werror -source 1.5 UncheckedCovariance.java
   318.9 + * @compile  UncheckedCovariance.java
  318.10 + * @compile/fail -Xlint:unchecked -Werror  UncheckedCovariance.java
  318.11   */
  318.12  
  318.13  class UncheckedCovariance {
   319.1 --- a/test/tools/javac/generics/UnsoundInference.java	Thu Jun 11 10:54:31 2009 -0700
   319.2 +++ b/test/tools/javac/generics/UnsoundInference.java	Thu Jun 11 21:35:12 2009 -0700
   319.3 @@ -27,7 +27,7 @@
   319.4   * @summary Generic method allowing passing of types that don't match collection types
   319.5   * @author gafter
   319.6   *
   319.7 - * @compile/fail -source 1.5 UnsoundInference.java
   319.8 + * @compile/fail  UnsoundInference.java
   319.9   */
  319.10  
  319.11  import java.util.ArrayList;
   320.1 --- a/test/tools/javac/generics/Varargs.java	Thu Jun 11 10:54:31 2009 -0700
   320.2 +++ b/test/tools/javac/generics/Varargs.java	Thu Jun 11 21:35:12 2009 -0700
   320.3 @@ -27,7 +27,7 @@
   320.4   * @summary varargs doesn't work for generic methods
   320.5   * @author gafter
   320.6   *
   320.7 - * @compile -source 1.5 Varargs.java
   320.8 + * @compile  Varargs.java
   320.9   */
  320.10  
  320.11  package varargs.versus.generics;
   321.1 --- a/test/tools/javac/generics/Varargs2.java	Thu Jun 11 10:54:31 2009 -0700
   321.2 +++ b/test/tools/javac/generics/Varargs2.java	Thu Jun 11 21:35:12 2009 -0700
   321.3 @@ -27,7 +27,7 @@
   321.4   * @summary generics + varargs API changes
   321.5   * @author gafter
   321.6   *
   321.7 - * @compile -source 1.5 Varargs2.java
   321.8 + * @compile  Varargs2.java
   321.9   * @run main Varargs2
  321.10   */
  321.11  
   322.1 --- a/test/tools/javac/generics/WrongNew.java	Thu Jun 11 10:54:31 2009 -0700
   322.2 +++ b/test/tools/javac/generics/WrongNew.java	Thu Jun 11 21:35:12 2009 -0700
   322.3 @@ -27,7 +27,7 @@
   322.4   * @summary generics: javac generares "new" of wrong class
   322.5   * @author gafter
   322.6   *
   322.7 - * @compile -source 1.5 WrongNew.java
   322.8 + * @compile  WrongNew.java
   322.9   * @run main WrongNew
  322.10   */
  322.11  
   323.1 --- a/test/tools/javac/generics/abstract/T4717181c.java	Thu Jun 11 10:54:31 2009 -0700
   323.2 +++ b/test/tools/javac/generics/abstract/T4717181c.java	Thu Jun 11 21:35:12 2009 -0700
   323.3 @@ -27,7 +27,7 @@
   323.4   * @summary javac treats inherited abstract method as an overrider
   323.5   * @author gafter
   323.6   *
   323.7 - * @compile/fail -source 1.5 T4717181c.java
   323.8 + * @compile/fail  T4717181c.java
   323.9   */
  323.10  
  323.11  class T4717181c {
   324.1 --- a/test/tools/javac/generics/bridge1/D.java	Thu Jun 11 10:54:31 2009 -0700
   324.2 +++ b/test/tools/javac/generics/bridge1/D.java	Thu Jun 11 21:35:12 2009 -0700
   324.3 @@ -27,7 +27,7 @@
   324.4   * @summary generics: missing bridge method
   324.5   * @author gafter
   324.6   *
   324.7 - * @compile -source 1.5 A.java C.java D.java E.java
   324.8 + * @compile  A.java C.java D.java E.java
   324.9   * @run main D
  324.10   */
  324.11  
   325.1 --- a/test/tools/javac/generics/classreader/HArrayMethod.java	Thu Jun 11 10:54:31 2009 -0700
   325.2 +++ b/test/tools/javac/generics/classreader/HArrayMethod.java	Thu Jun 11 21:35:12 2009 -0700
   325.3 @@ -27,8 +27,8 @@
   325.4   * @summary generics: override checks break when using separate compilation
   325.5   * @author gafter
   325.6   *
   325.7 - * @compile -source 1.5 HArrayMethod.java HMember.java HMethod.java HMethodImpl.java
   325.8 - * @compile -source 1.5 HArrayMethod.java
   325.9 + * @compile  HArrayMethod.java HMember.java HMethod.java HMethodImpl.java
  325.10 + * @compile  HArrayMethod.java
  325.11   */
  325.12  
  325.13  class HArrayMethod extends HMethodImpl {
   326.1 --- a/test/tools/javac/generics/compat/CovariantCompat1.java	Thu Jun 11 10:54:31 2009 -0700
   326.2 +++ b/test/tools/javac/generics/compat/CovariantCompat1.java	Thu Jun 11 21:35:12 2009 -0700
   326.3 @@ -27,7 +27,7 @@
   326.4   * @summary generics: non-generic code should be able to call covariant method
   326.5   * @author gafter
   326.6   *
   326.7 - * @compile -source 1.5 CovariantCompat1.java
   326.8 + * @compile  CovariantCompat1.java
   326.9   * @compile -source 1.4 CovariantCompat2.java
  326.10   */
  326.11  
   327.1 --- a/test/tools/javac/generics/compat/OverrideBridge1.java	Thu Jun 11 10:54:31 2009 -0700
   327.2 +++ b/test/tools/javac/generics/compat/OverrideBridge1.java	Thu Jun 11 21:35:12 2009 -0700
   327.3 @@ -27,10 +27,10 @@
   327.4   * @summary generics: compiler allows 1.4 code to override a bridge method
   327.5   * @author gafter
   327.6   *
   327.7 - * @compile -source 1.5 OverrideBridge1.java
   327.8 + * @compile  OverrideBridge1.java
   327.9   * @compile/fail -Werror -source 1.4 OverrideBridge2.java
  327.10   * @compile -source 1.4 OverrideBridge2.java
  327.11 - * @compile -source 1.5 OverrideBridge3.java
  327.12 + * @compile  OverrideBridge3.java
  327.13   */
  327.14  
  327.15  // ALLOW users to override bridge methods.
   328.1 --- a/test/tools/javac/generics/forwardSeparateBound/ForwardSeparateBound2.java	Thu Jun 11 10:54:31 2009 -0700
   328.2 +++ b/test/tools/javac/generics/forwardSeparateBound/ForwardSeparateBound2.java	Thu Jun 11 21:35:12 2009 -0700
   328.3 @@ -27,8 +27,8 @@
   328.4   * @summary generics: forward referenced bounds vs separate compilation
   328.5   * @author gafter
   328.6   *
   328.7 - * @compile -source 1.5 ForwardSeparateBound1.java ForwardSeparateBound2.java
   328.8 - * @compile -source 1.5 ForwardSeparateBound2.java
   328.9 + * @compile  ForwardSeparateBound1.java ForwardSeparateBound2.java
  328.10 + * @compile  ForwardSeparateBound2.java
  328.11   */
  328.12  
  328.13  class Z {}
   329.1 --- a/test/tools/javac/generics/genericAbstract/A.java	Thu Jun 11 10:54:31 2009 -0700
   329.2 +++ b/test/tools/javac/generics/genericAbstract/A.java	Thu Jun 11 21:35:12 2009 -0700
   329.3 @@ -27,7 +27,7 @@
   329.4   * @summary generics: generic interface method not implemented in abstract class causes err
   329.5   * @author gafter
   329.6   *
   329.7 - * @compile -source 1.5 A.java B.java
   329.8 + * @compile  A.java B.java
   329.9   */
  329.10  
  329.11  interface A {
   330.1 --- a/test/tools/javac/generics/inference/6365166/NewTest.java	Thu Jun 11 10:54:31 2009 -0700
   330.2 +++ b/test/tools/javac/generics/inference/6365166/NewTest.java	Thu Jun 11 21:35:12 2009 -0700
   330.3 @@ -25,7 +25,6 @@
   330.4   * @test
   330.5   * @bug     6365166
   330.6   * @summary javac (generic) unable to resolve methods
   330.7 - * @ignore  waiting for 6365166
   330.8   * @compile NewTest.java
   330.9   */
  330.10  
   331.1 --- a/test/tools/javac/generics/odersky/BadTest.java	Thu Jun 11 10:54:31 2009 -0700
   331.2 +++ b/test/tools/javac/generics/odersky/BadTest.java	Thu Jun 11 21:35:12 2009 -0700
   331.3 @@ -27,7 +27,7 @@
   331.4   * @summary Negative regression test from odersky
   331.5   * @author odersky
   331.6   *
   331.7 - * @compile/fail -source 1.5 BadTest.java
   331.8 + * @compile/fail  BadTest.java
   331.9   */
  331.10  
  331.11  class BadTest {
   332.1 --- a/test/tools/javac/generics/odersky/BadTest2.java	Thu Jun 11 10:54:31 2009 -0700
   332.2 +++ b/test/tools/javac/generics/odersky/BadTest2.java	Thu Jun 11 21:35:12 2009 -0700
   332.3 @@ -27,7 +27,7 @@
   332.4   * @summary Regression test from odersky
   332.5   * @author odersky
   332.6   *
   332.7 - * @compile -source 1.5 BadTest2.java
   332.8 + * @compile  BadTest2.java
   332.9   */
  332.10  
  332.11  // this used to be a negative regression test, but when we
   333.1 --- a/test/tools/javac/generics/odersky/BadTest3.java	Thu Jun 11 10:54:31 2009 -0700
   333.2 +++ b/test/tools/javac/generics/odersky/BadTest3.java	Thu Jun 11 21:35:12 2009 -0700
   333.3 @@ -27,7 +27,7 @@
   333.4   * @summary Negative regression test from odersky
   333.5   * @author odersky
   333.6   *
   333.7 - * @compile/fail -source 1.5 BadTest3.java
   333.8 + * @compile/fail  BadTest3.java
   333.9   */
  333.10  
  333.11  class BadTest3 {
   334.1 --- a/test/tools/javac/generics/odersky/BadTest4.java	Thu Jun 11 10:54:31 2009 -0700
   334.2 +++ b/test/tools/javac/generics/odersky/BadTest4.java	Thu Jun 11 21:35:12 2009 -0700
   334.3 @@ -27,7 +27,7 @@
   334.4   * @summary Negative regression test from odersky
   334.5   * @author odersky
   334.6   *
   334.7 - * @compile/fail -source 1.5 BadTest4.java
   334.8 + * @compile/fail  BadTest4.java
   334.9   */
  334.10  
  334.11  class BadTest4 {
   335.1 --- a/test/tools/javac/generics/odersky/Test.java	Thu Jun 11 10:54:31 2009 -0700
   335.2 +++ b/test/tools/javac/generics/odersky/Test.java	Thu Jun 11 21:35:12 2009 -0700
   335.3 @@ -27,7 +27,7 @@
   335.4   * @summary Positive regression test from odersky
   335.5   * @author odersky
   335.6   *
   335.7 - * @compile -source 1.5 Test.java
   335.8 + * @compile  Test.java
   335.9   */
  335.10  
  335.11  class Test {
   336.1 --- a/test/tools/javac/generics/odersky/Test2.java	Thu Jun 11 10:54:31 2009 -0700
   336.2 +++ b/test/tools/javac/generics/odersky/Test2.java	Thu Jun 11 21:35:12 2009 -0700
   336.3 @@ -27,7 +27,7 @@
   336.4   * @summary Positive regression test from odersky
   336.5   * @author odersky
   336.6   *
   336.7 - * @compile -source 1.5 Test2.java
   336.8 + * @compile  Test2.java
   336.9   */
  336.10  
  336.11  class Test2 {
   337.1 --- a/test/tools/javac/generics/odersky/Test3.java	Thu Jun 11 10:54:31 2009 -0700
   337.2 +++ b/test/tools/javac/generics/odersky/Test3.java	Thu Jun 11 21:35:12 2009 -0700
   337.3 @@ -27,7 +27,7 @@
   337.4   * @summary Positive regression test from odersky
   337.5   * @author odersky
   337.6   *
   337.7 - * @compile -source 1.5 Test3.java
   337.8 + * @compile  Test3.java
   337.9   */
  337.10  
  337.11  class Test3 {
   338.1 --- a/test/tools/javac/generics/odersky/Test4.java	Thu Jun 11 10:54:31 2009 -0700
   338.2 +++ b/test/tools/javac/generics/odersky/Test4.java	Thu Jun 11 21:35:12 2009 -0700
   338.3 @@ -27,7 +27,7 @@
   338.4   * @summary Positive regression test from odersky
   338.5   * @author odersky
   338.6   *
   338.7 - * @compile -source 1.5 Test4.java
   338.8 + * @compile  Test4.java
   338.9   */
  338.10  
  338.11  class Test4 {
   339.1 --- a/test/tools/javac/generics/parametricException/J.java	Thu Jun 11 10:54:31 2009 -0700
   339.2 +++ b/test/tools/javac/generics/parametricException/J.java	Thu Jun 11 21:35:12 2009 -0700
   339.3 @@ -27,8 +27,8 @@
   339.4   * @summary javac appears to omit throws portion of generic signature attribute
   339.5   * @author gafter
   339.6   *
   339.7 - * @compile -source 1.5 J.java
   339.8 - * @compile -source 1.5 K.java
   339.9 + * @compile  J.java
  339.10 + * @compile  K.java
  339.11   */
  339.12  
  339.13  class J<T extends Exception> {
   340.1 --- a/test/tools/javac/generics/rare/Rare1.java	Thu Jun 11 10:54:31 2009 -0700
   340.2 +++ b/test/tools/javac/generics/rare/Rare1.java	Thu Jun 11 21:35:12 2009 -0700
   340.3 @@ -27,7 +27,7 @@
   340.4   * @summary "rare" types
   340.5   * @author gafter
   340.6   *
   340.7 - * @compile -source 1.5 Rare1.java
   340.8 + * @compile  Rare1.java
   340.9   */
  340.10  
  340.11  package rare1;
   341.1 --- a/test/tools/javac/generics/rare/Rare10.java	Thu Jun 11 10:54:31 2009 -0700
   341.2 +++ b/test/tools/javac/generics/rare/Rare10.java	Thu Jun 11 21:35:12 2009 -0700
   341.3 @@ -27,7 +27,7 @@
   341.4   * @summary "rare" types
   341.5   * @author gafter
   341.6   *
   341.7 - * @compile -source 1.5 Rare10.java
   341.8 + * @compile  Rare10.java
   341.9   */
  341.10  
  341.11  package rare10;
   342.1 --- a/test/tools/javac/generics/rare/Rare11.java	Thu Jun 11 10:54:31 2009 -0700
   342.2 +++ b/test/tools/javac/generics/rare/Rare11.java	Thu Jun 11 21:35:12 2009 -0700
   342.3 @@ -27,7 +27,7 @@
   342.4   * @summary "rare" types
   342.5   * @author gafter
   342.6   *
   342.7 - * @compile -source 1.5 Rare11.java
   342.8 + * @compile  Rare11.java
   342.9   */
  342.10  
  342.11  package rare11;
   343.1 --- a/test/tools/javac/generics/rare/Rare2.java	Thu Jun 11 10:54:31 2009 -0700
   343.2 +++ b/test/tools/javac/generics/rare/Rare2.java	Thu Jun 11 21:35:12 2009 -0700
   343.3 @@ -27,7 +27,7 @@
   343.4   * @summary "rare" types
   343.5   * @author gafter
   343.6   *
   343.7 - * @compile/fail -source 1.5 Rare2.java
   343.8 + * @compile/fail  Rare2.java
   343.9   */
  343.10  
  343.11  package rare2;
   344.1 --- a/test/tools/javac/generics/rare/Rare3.java	Thu Jun 11 10:54:31 2009 -0700
   344.2 +++ b/test/tools/javac/generics/rare/Rare3.java	Thu Jun 11 21:35:12 2009 -0700
   344.3 @@ -27,7 +27,7 @@
   344.4   * @summary "rare" types
   344.5   * @author gafter
   344.6   *
   344.7 - * @compile/fail -source 1.5 Rare3.java
   344.8 + * @compile/fail  Rare3.java
   344.9   */
  344.10  
  344.11  package rare3;
   345.1 --- a/test/tools/javac/generics/rare/Rare4.java	Thu Jun 11 10:54:31 2009 -0700
   345.2 +++ b/test/tools/javac/generics/rare/Rare4.java	Thu Jun 11 21:35:12 2009 -0700
   345.3 @@ -27,7 +27,7 @@
   345.4   * @summary "rare" types
   345.5   * @author gafter
   345.6   *
   345.7 - * @compile/fail -source 1.5 Rare4.java
   345.8 + * @compile/fail  Rare4.java
   345.9   */
  345.10  
  345.11  package rare4;
   346.1 --- a/test/tools/javac/generics/rare/Rare5.java	Thu Jun 11 10:54:31 2009 -0700
   346.2 +++ b/test/tools/javac/generics/rare/Rare5.java	Thu Jun 11 21:35:12 2009 -0700
   346.3 @@ -27,7 +27,7 @@
   346.4   * @summary "rare" types
   346.5   * @author gafter
   346.6   *
   346.7 - * @compile/fail -source 1.5 Rare5.java
   346.8 + * @compile/fail  Rare5.java
   346.9   */
  346.10  
  346.11  package rare5;
   347.1 --- a/test/tools/javac/generics/rare/Rare6.java	Thu Jun 11 10:54:31 2009 -0700
   347.2 +++ b/test/tools/javac/generics/rare/Rare6.java	Thu Jun 11 21:35:12 2009 -0700
   347.3 @@ -27,7 +27,7 @@
   347.4   * @summary "rare" types
   347.5   * @author gafter
   347.6   *
   347.7 - * @compile/fail -source 1.5 Rare6.java
   347.8 + * @compile/fail  Rare6.java
   347.9   */
  347.10  
  347.11  package rare6;
   348.1 --- a/test/tools/javac/generics/rare/Rare7.java	Thu Jun 11 10:54:31 2009 -0700
   348.2 +++ b/test/tools/javac/generics/rare/Rare7.java	Thu Jun 11 21:35:12 2009 -0700
   348.3 @@ -27,7 +27,7 @@
   348.4   * @summary "rare" types
   348.5   * @author gafter
   348.6   *
   348.7 - * @compile/fail -source 1.5 Rare7.java
   348.8 + * @compile/fail  Rare7.java
   348.9   */
  348.10  
  348.11  package rare7;
   349.1 --- a/test/tools/javac/generics/rare/Rare8.java	Thu Jun 11 10:54:31 2009 -0700
   349.2 +++ b/test/tools/javac/generics/rare/Rare8.java	Thu Jun 11 21:35:12 2009 -0700
   349.3 @@ -27,7 +27,7 @@
   349.4   * @summary "rare" types
   349.5   * @author gafter
   349.6   *
   349.7 - * @compile -source 1.5 Rare8.java
   349.8 + * @compile  Rare8.java
   349.9   */
  349.10  
  349.11  package rare8;
   350.1 --- a/test/tools/javac/generics/rare/Rare9.java	Thu Jun 11 10:54:31 2009 -0700
   350.2 +++ b/test/tools/javac/generics/rare/Rare9.java	Thu Jun 11 21:35:12 2009 -0700
   350.3 @@ -27,7 +27,7 @@
   350.4   * @summary "rare" types
   350.5   * @author gafter
   350.6   *
   350.7 - * @compile -source 1.5 Rare9.java
   350.8 + * @compile  Rare9.java
   350.9   */
  350.10  
  350.11  package rare9;
   351.1 --- a/test/tools/javac/generics/rawSeparate/RetroLexer.java	Thu Jun 11 10:54:31 2009 -0700
   351.2 +++ b/test/tools/javac/generics/rawSeparate/RetroLexer.java	Thu Jun 11 21:35:12 2009 -0700
   351.3 @@ -27,9 +27,9 @@
   351.4   * @summary raw types versus separate compilation causes type error
   351.5   * @author gafter
   351.6   *
   351.7 - * @compile -source 1.5 Hashtable.java
   351.8 - * @compile -source 1.5 CharScanner.java
   351.9 - * @compile -source 1.5 RetroLexer.java
  351.10 + * @compile  Hashtable.java
  351.11 + * @compile  CharScanner.java
  351.12 + * @compile  RetroLexer.java
  351.13   */
  351.14  
  351.15  package parser;
   352.1 --- a/test/tools/javac/generics/typeargs/Basic.java	Thu Jun 11 10:54:31 2009 -0700
   352.2 +++ b/test/tools/javac/generics/typeargs/Basic.java	Thu Jun 11 21:35:12 2009 -0700
   352.3 @@ -27,7 +27,7 @@
   352.4   * @summary explicit type arguments
   352.5   * @author gafter
   352.6   *
   352.7 - * @compile -source 1.5 Basic.java
   352.8 + * @compile  Basic.java
   352.9   */
  352.10  
  352.11  // Test all of the basic forms for explicit type arguments
   353.1 --- a/test/tools/javac/generics/typeargs/Metharg1.java	Thu Jun 11 10:54:31 2009 -0700
   353.2 +++ b/test/tools/javac/generics/typeargs/Metharg1.java	Thu Jun 11 21:35:12 2009 -0700
   353.3 @@ -27,7 +27,7 @@
   353.4   * @summary explicit type arguments
   353.5   * @author gafter
   353.6   *
   353.7 - * @compile/fail -source 1.5 Metharg1.java
   353.8 + * @compile/fail  Metharg1.java
   353.9   */
  353.10  
  353.11  // Test type mismatch on type argument for method call
   354.1 --- a/test/tools/javac/generics/typeargs/Metharg2.java	Thu Jun 11 10:54:31 2009 -0700
   354.2 +++ b/test/tools/javac/generics/typeargs/Metharg2.java	Thu Jun 11 21:35:12 2009 -0700
   354.3 @@ -27,7 +27,7 @@
   354.4   * @summary explicit type arguments
   354.5   * @author gafter
   354.6   *
   354.7 - * @compile/fail -source 1.5 Metharg2.java
   354.8 + * @compile/fail  Metharg2.java
   354.9   */
  354.10  
  354.11  // Test type mismatch on type argument for qualified method call
   355.1 --- a/test/tools/javac/generics/typeargs/Newarg1.java	Thu Jun 11 10:54:31 2009 -0700
   355.2 +++ b/test/tools/javac/generics/typeargs/Newarg1.java	Thu Jun 11 21:35:12 2009 -0700
   355.3 @@ -27,7 +27,7 @@
   355.4   * @summary explicit type arguments
   355.5   * @author gafter
   355.6   *
   355.7 - * @compile/fail -source 1.5 Newarg1.java
   355.8 + * @compile/fail  Newarg1.java
   355.9   */
  355.10  
  355.11  // Test type mismatch on type argument for constructor
   356.1 --- a/test/tools/javac/generics/typeargs/Newarg2.java	Thu Jun 11 10:54:31 2009 -0700
   356.2 +++ b/test/tools/javac/generics/typeargs/Newarg2.java	Thu Jun 11 21:35:12 2009 -0700
   356.3 @@ -27,7 +27,7 @@
   356.4   * @summary explicit type arguments
   356.5   * @author gafter
   356.6   *
   356.7 - * @compile/fail -source 1.5 Newarg2.java
   356.8 + * @compile/fail  Newarg2.java
   356.9   */
  356.10  
  356.11  // Test type mismatch on type argument for inner constructor
   357.1 --- a/test/tools/javac/generics/typeargs/Superarg1.java	Thu Jun 11 10:54:31 2009 -0700
   357.2 +++ b/test/tools/javac/generics/typeargs/Superarg1.java	Thu Jun 11 21:35:12 2009 -0700
   357.3 @@ -27,7 +27,7 @@
   357.4   * @summary explicit type arguments
   357.5   * @author gafter
   357.6   *
   357.7 - * @compile/fail -source 1.5 Superarg1.java
   357.8 + * @compile/fail  Superarg1.java
   357.9   */
  357.10  
  357.11  // Test type mismatch on type argument for super constructor
   358.1 --- a/test/tools/javac/generics/typeargs/Superarg2.java	Thu Jun 11 10:54:31 2009 -0700
   358.2 +++ b/test/tools/javac/generics/typeargs/Superarg2.java	Thu Jun 11 21:35:12 2009 -0700
   358.3 @@ -27,7 +27,7 @@
   358.4   * @summary explicit type arguments
   358.5   * @author gafter
   358.6   *
   358.7 - * @compile/fail -source 1.5 Superarg2.java
   358.8 + * @compile/fail  Superarg2.java
   358.9   */
  358.10  
  358.11  // Test type mismatch on type argument for inner super constructor
   359.1 --- a/test/tools/javac/generics/typeargs/ThisArg.java	Thu Jun 11 10:54:31 2009 -0700
   359.2 +++ b/test/tools/javac/generics/typeargs/ThisArg.java	Thu Jun 11 21:35:12 2009 -0700
   359.3 @@ -27,7 +27,7 @@
   359.4   * @summary explicit type arguments
   359.5   * @author gafter
   359.6   *
   359.7 - * @compile/fail -source 1.5 ThisArg.java
   359.8 + * @compile/fail  ThisArg.java
   359.9   */
  359.10  
  359.11  // Test type mismatch on type argument for this constructor
   360.1 --- a/test/tools/javac/generics/typevars/4856983/T4856983.java	Thu Jun 11 10:54:31 2009 -0700
   360.2 +++ b/test/tools/javac/generics/typevars/4856983/T4856983.java	Thu Jun 11 21:35:12 2009 -0700
   360.3 @@ -27,7 +27,7 @@
   360.4   * @summary (crash) mutually f-bounded type vars with multiple bounds may crash javac
   360.5   * @author Peter von der Ah\u00e9
   360.6   *
   360.7 - * @compile -source 5 T4856983.java
   360.8 + * @compile  T4856983.java
   360.9   */
  360.10  
  360.11  import java.lang.Comparable;
   361.1 --- a/test/tools/javac/generics/typevars/4856983/T4856983a.java	Thu Jun 11 10:54:31 2009 -0700
   361.2 +++ b/test/tools/javac/generics/typevars/4856983/T4856983a.java	Thu Jun 11 21:35:12 2009 -0700
   361.3 @@ -26,7 +26,7 @@
   361.4   * @bug 4856983
   361.5   * @summary (crash) mutually f-bounded type vars with multiple bounds may crash javac
   361.6   * @author Peter von der Ah\u00e9
   361.7 - * @compile/fail -source 5 T4856983a.java
   361.8 + * @compile/fail  T4856983a.java
   361.9   */
  361.10  
  361.11  interface I1 { Number m(); }
   362.1 --- a/test/tools/javac/generics/typevars/4856983/T4856983b.java	Thu Jun 11 10:54:31 2009 -0700
   362.2 +++ b/test/tools/javac/generics/typevars/4856983/T4856983b.java	Thu Jun 11 21:35:12 2009 -0700
   362.3 @@ -26,7 +26,7 @@
   362.4   * @bug 4856983
   362.5   * @summary (crash) mutually f-bounded type vars with multiple bounds may crash javac
   362.6   * @author Peter von der Ah\u00e9
   362.7 - * @compile/fail -source 5 T4856983b.java
   362.8 + * @compile/fail  T4856983b.java
   362.9   */
  362.10  
  362.11  interface I1 { Number m(); }
   363.1 --- a/test/tools/javac/generics/wildcards/AssignmentDifferentTypes1.java	Thu Jun 11 10:54:31 2009 -0700
   363.2 +++ b/test/tools/javac/generics/wildcards/AssignmentDifferentTypes1.java	Thu Jun 11 21:35:12 2009 -0700
   363.3 @@ -25,7 +25,7 @@
   363.4   * @test
   363.5   * @summary Test subtyping for wildcards with related type bounds.
   363.6   *
   363.7 - * @compile -source 1.5 AssignmentDifferentTypes1.java
   363.8 + * @compile  AssignmentDifferentTypes1.java
   363.9   */
  363.10  
  363.11  public class AssignmentDifferentTypes1 {
   364.1 --- a/test/tools/javac/generics/wildcards/AssignmentDifferentTypes2.java	Thu Jun 11 10:54:31 2009 -0700
   364.2 +++ b/test/tools/javac/generics/wildcards/AssignmentDifferentTypes2.java	Thu Jun 11 21:35:12 2009 -0700
   364.3 @@ -25,7 +25,7 @@
   364.4   * @test
   364.5   * @summary Test subtyping for wildcards with related type bounds.
   364.6   *
   364.7 - * @compile/fail -source 1.5 AssignmentDifferentTypes2.java
   364.8 + * @compile/fail  AssignmentDifferentTypes2.java
   364.9   */
  364.10  
  364.11  public class AssignmentDifferentTypes2 {
   365.1 --- a/test/tools/javac/generics/wildcards/AssignmentDifferentTypes3.java	Thu Jun 11 10:54:31 2009 -0700
   365.2 +++ b/test/tools/javac/generics/wildcards/AssignmentDifferentTypes3.java	Thu Jun 11 21:35:12 2009 -0700
   365.3 @@ -25,7 +25,7 @@
   365.4   * @test
   365.5   * @summary Test subtyping for wildcards with related type bounds.
   365.6   *
   365.7 - * @compile/fail -source 1.5 AssignmentDifferentTypes3.java
   365.8 + * @compile/fail  AssignmentDifferentTypes3.java
   365.9   */
  365.10  
  365.11  public class AssignmentDifferentTypes3 {
   366.1 --- a/test/tools/javac/generics/wildcards/AssignmentDifferentTypes4.java	Thu Jun 11 10:54:31 2009 -0700
   366.2 +++ b/test/tools/javac/generics/wildcards/AssignmentDifferentTypes4.java	Thu Jun 11 21:35:12 2009 -0700
   366.3 @@ -25,7 +25,7 @@
   366.4   * @test
   366.5   * @summary Test subtyping for wildcards with related type bounds.
   366.6   *
   366.7 - * @compile/fail -source 1.5 AssignmentDifferentTypes4.java
   366.8 + * @compile/fail  AssignmentDifferentTypes4.java
   366.9   */
  366.10  
  366.11  public class AssignmentDifferentTypes4 {
   367.1 --- a/test/tools/javac/generics/wildcards/AssignmentDifferentTypes5.java	Thu Jun 11 10:54:31 2009 -0700
   367.2 +++ b/test/tools/javac/generics/wildcards/AssignmentDifferentTypes5.java	Thu Jun 11 21:35:12 2009 -0700
   367.3 @@ -25,7 +25,7 @@
   367.4   * @test
   367.5   * @summary Test subtyping for wildcards with related type bounds.
   367.6   *
   367.7 - * @compile/fail -source 1.5 AssignmentDifferentTypes5.java
   367.8 + * @compile/fail  AssignmentDifferentTypes5.java
   367.9   */
  367.10  
  367.11  public class AssignmentDifferentTypes5 {
   368.1 --- a/test/tools/javac/generics/wildcards/AssignmentDifferentTypes6.java	Thu Jun 11 10:54:31 2009 -0700
   368.2 +++ b/test/tools/javac/generics/wildcards/AssignmentDifferentTypes6.java	Thu Jun 11 21:35:12 2009 -0700
   368.3 @@ -25,7 +25,7 @@
   368.4   * @test
   368.5   * @summary Test subtyping for wildcards with related type bounds.
   368.6   *
   368.7 - * @compile/fail -source 1.5 AssignmentDifferentTypes6.java
   368.8 + * @compile/fail  AssignmentDifferentTypes6.java
   368.9   */
  368.10  
  368.11  public class AssignmentDifferentTypes6 {
   369.1 --- a/test/tools/javac/generics/wildcards/AssignmentDifferentTypes7.java	Thu Jun 11 10:54:31 2009 -0700
   369.2 +++ b/test/tools/javac/generics/wildcards/AssignmentDifferentTypes7.java	Thu Jun 11 21:35:12 2009 -0700
   369.3 @@ -25,7 +25,7 @@
   369.4   * @test
   369.5   * @summary Test subtyping for wildcards with related type bounds.
   369.6   *
   369.7 - * @compile/fail -source 1.5 AssignmentDifferentTypes7.java
   369.8 + * @compile/fail  AssignmentDifferentTypes7.java
   369.9   */
  369.10  
  369.11  public class AssignmentDifferentTypes7 {
   370.1 --- a/test/tools/javac/generics/wildcards/AssignmentDifferentTypes8.java	Thu Jun 11 10:54:31 2009 -0700
   370.2 +++ b/test/tools/javac/generics/wildcards/AssignmentDifferentTypes8.java	Thu Jun 11 21:35:12 2009 -0700
   370.3 @@ -25,7 +25,7 @@
   370.4   * @test
   370.5   * @summary Test subtyping for wildcards with related type bounds.
   370.6   *
   370.7 - * @compile/fail -source 1.5 AssignmentDifferentTypes8.java
   370.8 + * @compile/fail  AssignmentDifferentTypes8.java
   370.9   */
  370.10  
  370.11  public class AssignmentDifferentTypes8 {
   371.1 --- a/test/tools/javac/generics/wildcards/AssignmentDifferentTypes9.java	Thu Jun 11 10:54:31 2009 -0700
   371.2 +++ b/test/tools/javac/generics/wildcards/AssignmentDifferentTypes9.java	Thu Jun 11 21:35:12 2009 -0700
   371.3 @@ -25,7 +25,7 @@
   371.4   * @test
   371.5   * @summary Test subtyping for wildcards with related type bounds.
   371.6   *
   371.7 - * @compile/fail -source 1.5 AssignmentDifferentTypes9.java
   371.8 + * @compile/fail  AssignmentDifferentTypes9.java
   371.9   */
  371.10  
  371.11  public class AssignmentDifferentTypes9 {
   372.1 --- a/test/tools/javac/generics/wildcards/AssignmentSameType1.java	Thu Jun 11 10:54:31 2009 -0700
   372.2 +++ b/test/tools/javac/generics/wildcards/AssignmentSameType1.java	Thu Jun 11 21:35:12 2009 -0700
   372.3 @@ -25,7 +25,7 @@
   372.4   * @test
   372.5   * @summary Test subtyping for wildcards with the same type bound.
   372.6   *
   372.7 - * @compile -source 1.5 AssignmentSameType1.java
   372.8 + * @compile  AssignmentSameType1.java
   372.9   */
  372.10  
  372.11  public class AssignmentSameType1 {
   373.1 --- a/test/tools/javac/generics/wildcards/AssignmentSameType2.java	Thu Jun 11 10:54:31 2009 -0700
   373.2 +++ b/test/tools/javac/generics/wildcards/AssignmentSameType2.java	Thu Jun 11 21:35:12 2009 -0700
   373.3 @@ -25,7 +25,7 @@
   373.4   * @test
   373.5   * @summary Test subtyping for wildcards with the same type bound.
   373.6   *
   373.7 - * @compile/fail -source 1.5 AssignmentSameType2.java
   373.8 + * @compile/fail  AssignmentSameType2.java
   373.9   */
  373.10  
  373.11  public class AssignmentSameType2 {
   374.1 --- a/test/tools/javac/generics/wildcards/AssignmentSameType3.java	Thu Jun 11 10:54:31 2009 -0700
   374.2 +++ b/test/tools/javac/generics/wildcards/AssignmentSameType3.java	Thu Jun 11 21:35:12 2009 -0700
   374.3 @@ -25,7 +25,7 @@
   374.4   * @test
   374.5   * @summary Test subtyping for wildcards with the same type bound.
   374.6   *
   374.7 - * @compile/fail -source 1.5 AssignmentSameType3.java
   374.8 + * @compile/fail  AssignmentSameType3.java
   374.9   */
  374.10  
  374.11  public class AssignmentSameType3 {
   375.1 --- a/test/tools/javac/generics/wildcards/AssignmentSameType4.java	Thu Jun 11 10:54:31 2009 -0700
   375.2 +++ b/test/tools/javac/generics/wildcards/AssignmentSameType4.java	Thu Jun 11 21:35:12 2009 -0700
   375.3 @@ -25,7 +25,7 @@
   375.4   * @test
   375.5   * @summary Test subtyping for wildcards with the same type bound.
   375.6   *
   375.7 - * @compile/fail -source 1.5 AssignmentSameType4.java
   375.8 + * @compile/fail  AssignmentSameType4.java
   375.9   */
  375.10  
  375.11  public class AssignmentSameType4 {
   376.1 --- a/test/tools/javac/generics/wildcards/AssignmentSameType5.java	Thu Jun 11 10:54:31 2009 -0700
   376.2 +++ b/test/tools/javac/generics/wildcards/AssignmentSameType5.java	Thu Jun 11 21:35:12 2009 -0700
   376.3 @@ -25,7 +25,7 @@
   376.4   * @test
   376.5   * @summary Test subtyping for wildcards with the same type bound.
   376.6   *
   376.7 - * @compile/fail -source 1.5 AssignmentSameType5.java
   376.8 + * @compile/fail  AssignmentSameType5.java
   376.9   */
  376.10  
  376.11  public class AssignmentSameType5 {
   377.1 --- a/test/tools/javac/generics/wildcards/AssignmentSameType6.java	Thu Jun 11 10:54:31 2009 -0700
   377.2 +++ b/test/tools/javac/generics/wildcards/AssignmentSameType6.java	Thu Jun 11 21:35:12 2009 -0700
   377.3 @@ -25,7 +25,7 @@
   377.4   * @test
   377.5   * @summary Test subtyping for wildcards with the same type bound.
   377.6   *
   377.7 - * @compile/fail -source 1.5 AssignmentSameType6.java
   377.8 + * @compile/fail  AssignmentSameType6.java
   377.9   */
  377.10  
  377.11  public class AssignmentSameType6 {
   378.1 --- a/test/tools/javac/generics/wildcards/AssignmentSameType7.java	Thu Jun 11 10:54:31 2009 -0700
   378.2 +++ b/test/tools/javac/generics/wildcards/AssignmentSameType7.java	Thu Jun 11 21:35:12 2009 -0700
   378.3 @@ -25,7 +25,7 @@
   378.4   * @test
   378.5   * @summary Test subtyping for wildcards with the same type bound.
   378.6   *
   378.7 - * @compile/fail -source 1.5 AssignmentSameType7.java
   378.8 + * @compile/fail  AssignmentSameType7.java
   378.9   */
  378.10  
  378.11  public class AssignmentSameType7 {
   379.1 --- a/test/tools/javac/generics/wildcards/AssignmentSameType8.java	Thu Jun 11 10:54:31 2009 -0700
   379.2 +++ b/test/tools/javac/generics/wildcards/AssignmentSameType8.java	Thu Jun 11 21:35:12 2009 -0700
   379.3 @@ -25,7 +25,7 @@
   379.4   * @test
   379.5   * @summary Test subtyping for wildcards with the same type bound.
   379.6   *
   379.7 - * @compile/fail -source 1.5 AssignmentSameType8.java
   379.8 + * @compile/fail  AssignmentSameType8.java
   379.9   */
  379.10  
  379.11  public class AssignmentSameType8 {
   380.1 --- a/test/tools/javac/generics/wildcards/BoundBug.java	Thu Jun 11 10:54:31 2009 -0700
   380.2 +++ b/test/tools/javac/generics/wildcards/BoundBug.java	Thu Jun 11 21:35:12 2009 -0700
   380.3 @@ -27,7 +27,7 @@
   380.4   * @summary generics: used of ? get bound error
   380.5   * @author gafter
   380.6   *
   380.7 - * @compile -source 1.5 BoundBug.java
   380.8 + * @compile  BoundBug.java
   380.9   */
  380.10  
  380.11  class BoundBug {
   381.1 --- a/test/tools/javac/generics/wildcards/ContraArg.java	Thu Jun 11 10:54:31 2009 -0700
   381.2 +++ b/test/tools/javac/generics/wildcards/ContraArg.java	Thu Jun 11 21:35:12 2009 -0700
   381.3 @@ -27,7 +27,7 @@
   381.4   * @summary generics: incorrect ambiguity error with super-bouded wildcards
   381.5   * @author gafter
   381.6   *
   381.7 - * @compile -source 1.5 ContraArg.java
   381.8 + * @compile  ContraArg.java
   381.9   */
  381.10  
  381.11  class ContraArg {
   382.1 --- a/test/tools/javac/generics/wildcards/T5097548.java	Thu Jun 11 10:54:31 2009 -0700
   382.2 +++ b/test/tools/javac/generics/wildcards/T5097548.java	Thu Jun 11 21:35:12 2009 -0700
   382.3 @@ -26,7 +26,7 @@
   382.4   * @bug 5097548
   382.5   * @summary (crash) Stack overflow in capture conversion
   382.6   * @author Peter von der Ah\u00e9
   382.7 - * @compile -source 5 T5097548.java
   382.8 + * @compile  T5097548.java
   382.9   * @run main T5097548
  382.10   */
  382.11  
   383.1 --- a/test/tools/javac/generics/wildcards/T5097548b.java	Thu Jun 11 10:54:31 2009 -0700
   383.2 +++ b/test/tools/javac/generics/wildcards/T5097548b.java	Thu Jun 11 21:35:12 2009 -0700
   383.3 @@ -26,7 +26,7 @@
   383.4   * @bug 5097548
   383.5   * @summary Stack overflow in capture conversion
   383.6   * @author Peter von der Ah\u00e9
   383.7 - * @compile -source 5 T5097548b.java
   383.8 + * @compile  T5097548b.java
   383.9   */
  383.10  
  383.11  interface Edge<N extends Node<? extends Edge<N>>> {
   384.1 --- a/test/tools/javac/generics/wildcards/UnboundArray.java	Thu Jun 11 10:54:31 2009 -0700
   384.2 +++ b/test/tools/javac/generics/wildcards/UnboundArray.java	Thu Jun 11 21:35:12 2009 -0700
   384.3 @@ -27,7 +27,7 @@
   384.4   * @summary generics: allow arrays of unbounded generic types
   384.5   * @author gafter
   384.6   *
   384.7 - * @compile -source 1.5 UnboundArray.java
   384.8 + * @compile  UnboundArray.java
   384.9   */
  384.10  
  384.11  class C<E> {
   385.1 --- a/test/tools/javac/generics/wildcards/neg/AmbiguousCast.java	Thu Jun 11 10:54:31 2009 -0700
   385.2 +++ b/test/tools/javac/generics/wildcards/neg/AmbiguousCast.java	Thu Jun 11 21:35:12 2009 -0700
   385.3 @@ -27,7 +27,7 @@
   385.4   * @summary cast to parameterized type is accepted although it should be rejected
   385.5   * @author gafter
   385.6   *
   385.7 - * @compile/fail -source 1.5 -Werror -Xlint:unchecked AmbiguousCast.java
   385.8 + * @compile/fail  -Werror -Xlint:unchecked AmbiguousCast.java
   385.9   */
  385.10  
  385.11  class Test {
   386.1 --- a/test/tools/javac/generics/wildcards/neg/Capture.java	Thu Jun 11 10:54:31 2009 -0700
   386.2 +++ b/test/tools/javac/generics/wildcards/neg/Capture.java	Thu Jun 11 21:35:12 2009 -0700
   386.3 @@ -27,7 +27,7 @@
   386.4   * @summary Wildcard capture
   386.5   * @author gafter
   386.6   *
   386.7 - * @compile/fail -source 1.5 Capture.java
   386.8 + * @compile/fail  Capture.java
   386.9   */
  386.10  
  386.11  class X<T> {}
   387.1 --- a/test/tools/javac/generics/wildcards/neg/CastFail1.java	Thu Jun 11 10:54:31 2009 -0700
   387.2 +++ b/test/tools/javac/generics/wildcards/neg/CastFail1.java	Thu Jun 11 21:35:12 2009 -0700
   387.3 @@ -27,7 +27,7 @@
   387.4   * @summary Test casts (legal, warning, and errors)
   387.5   * @author gafter
   387.6   *
   387.7 - * @compile/fail -source 1.5 CastFail1.java
   387.8 + * @compile/fail  CastFail1.java
   387.9   */
  387.10  
  387.11  import java.util.*;
   388.1 --- a/test/tools/javac/generics/wildcards/neg/CastFail10.java	Thu Jun 11 10:54:31 2009 -0700
   388.2 +++ b/test/tools/javac/generics/wildcards/neg/CastFail10.java	Thu Jun 11 21:35:12 2009 -0700
   388.3 @@ -27,7 +27,7 @@
   388.4   * @summary Test casts (legal, warning, and errors)
   388.5   * @author gafter
   388.6   *
   388.7 - * @compile/fail -source 1.5 CastFail10.java
   388.8 + * @compile/fail  CastFail10.java
   388.9   */
  388.10  
  388.11  import java.util.*;
   389.1 --- a/test/tools/javac/generics/wildcards/neg/CastFail11.java	Thu Jun 11 10:54:31 2009 -0700
   389.2 +++ b/test/tools/javac/generics/wildcards/neg/CastFail11.java	Thu Jun 11 21:35:12 2009 -0700
   389.3 @@ -27,7 +27,7 @@
   389.4   * @summary Test casts (legal, warning, and errors)
   389.5   * @author gafter
   389.6   *
   389.7 - * @compile/fail -source 1.5 CastFail11.java
   389.8 + * @compile/fail  CastFail11.java
   389.9   */
  389.10  
  389.11  import java.util.*;
   390.1 --- a/test/tools/javac/generics/wildcards/neg/CastFail12.java	Thu Jun 11 10:54:31 2009 -0700
   390.2 +++ b/test/tools/javac/generics/wildcards/neg/CastFail12.java	Thu Jun 11 21:35:12 2009 -0700
   390.3 @@ -27,7 +27,7 @@
   390.4   * @summary Test casts (legal, warning, and errors)
   390.5   * @author gafter
   390.6   *
   390.7 - * @compile/fail -source 1.5 CastFail12.java
   390.8 + * @compile/fail  CastFail12.java
   390.9   */
  390.10  
  390.11  import java.util.*;
   391.1 --- a/test/tools/javac/generics/wildcards/neg/CastFail13.java	Thu Jun 11 10:54:31 2009 -0700
   391.2 +++ b/test/tools/javac/generics/wildcards/neg/CastFail13.java	Thu Jun 11 21:35:12 2009 -0700
   391.3 @@ -27,7 +27,7 @@
   391.4   * @summary Test casts (legal, warning, and errors)
   391.5   * @author gafter
   391.6   *
   391.7 - * @compile/fail -source 1.5 CastFail13.java
   391.8 + * @compile/fail  CastFail13.java
   391.9   */
  391.10  
  391.11  import java.util.*;
   392.1 --- a/test/tools/javac/generics/wildcards/neg/CastFail14.java	Thu Jun 11 10:54:31 2009 -0700
   392.2 +++ b/test/tools/javac/generics/wildcards/neg/CastFail14.java	Thu Jun 11 21:35:12 2009 -0700
   392.3 @@ -27,7 +27,7 @@
   392.4   * @summary Test casts (legal, warning, and errors)
   392.5   * @author gafter
   392.6   *
   392.7 - * @compile/fail -source 1.5 CastFail14.java
   392.8 + * @compile/fail  CastFail14.java
   392.9   */
  392.10  
  392.11  import java.util.*;
   393.1 --- a/test/tools/javac/generics/wildcards/neg/CastFail15.java	Thu Jun 11 10:54:31 2009 -0700
   393.2 +++ b/test/tools/javac/generics/wildcards/neg/CastFail15.java	Thu Jun 11 21:35:12 2009 -0700
   393.3 @@ -27,7 +27,7 @@
   393.4   * @summary Test casts (legal, warning, and errors)
   393.5   * @author gafter
   393.6   *
   393.7 - * @compile/fail -source 1.5 CastFail15.java
   393.8 + * @compile/fail  CastFail15.java
   393.9   */
  393.10  
  393.11  import java.util.*;
   394.1 --- a/test/tools/javac/generics/wildcards/neg/CastFail16.java	Thu Jun 11 10:54:31 2009 -0700
   394.2 +++ b/test/tools/javac/generics/wildcards/neg/CastFail16.java	Thu Jun 11 21:35:12 2009 -0700
   394.3 @@ -27,7 +27,7 @@
   394.4   * @summary Test casts (legal, warning, and errors)
   394.5   * @author gafter
   394.6   *
   394.7 - * @compile/fail -source 1.5 CastFail16.java
   394.8 + * @compile/fail  CastFail16.java
   394.9   */
  394.10  
  394.11  import java.util.*;
   395.1 --- a/test/tools/javac/generics/wildcards/neg/CastFail17.java	Thu Jun 11 10:54:31 2009 -0700
   395.2 +++ b/test/tools/javac/generics/wildcards/neg/CastFail17.java	Thu Jun 11 21:35:12 2009 -0700
   395.3 @@ -27,7 +27,7 @@
   395.4   * @summary Test casts (legal, warning, and errors)
   395.5   * @author gafter
   395.6   *
   395.7 - * @compile/fail -source 1.5 CastFail17.java
   395.8 + * @compile/fail  CastFail17.java
   395.9   */
  395.10  
  395.11  import java.util.*;
   396.1 --- a/test/tools/javac/generics/wildcards/neg/CastFail18.java	Thu Jun 11 10:54:31 2009 -0700
   396.2 +++ b/test/tools/javac/generics/wildcards/neg/CastFail18.java	Thu Jun 11 21:35:12 2009 -0700
   396.3 @@ -27,7 +27,7 @@
   396.4   * @summary Test casts (legal, warning, and errors)
   396.5   * @author gafter
   396.6   *
   396.7 - * @compile/fail -source 1.5 CastFail18.java
   396.8 + * @compile/fail  CastFail18.java
   396.9   */
  396.10  
  396.11  import java.util.*;
   397.1 --- a/test/tools/javac/generics/wildcards/neg/CastFail19.java	Thu Jun 11 10:54:31 2009 -0700
   397.2 +++ b/test/tools/javac/generics/wildcards/neg/CastFail19.java	Thu Jun 11 21:35:12 2009 -0700
   397.3 @@ -27,7 +27,7 @@
   397.4   * @summary Test casts (legal, warning, and errors)
   397.5   * @author gafter
   397.6   *
   397.7 - * @compile/fail -source 1.5 CastFail19.java
   397.8 + * @compile/fail  CastFail19.java
   397.9   */
  397.10  
  397.11  import java.util.*;
   398.1 --- a/test/tools/javac/generics/wildcards/neg/CastFail2.java	Thu Jun 11 10:54:31 2009 -0700
   398.2 +++ b/test/tools/javac/generics/wildcards/neg/CastFail2.java	Thu Jun 11 21:35:12 2009 -0700
   398.3 @@ -27,7 +27,7 @@
   398.4   * @summary Test casts (legal, warning, and errors)
   398.5   * @author gafter
   398.6   *
   398.7 - * @compile/fail -source 1.5 CastFail2.java
   398.8 + * @compile/fail  CastFail2.java
   398.9   */
  398.10  
  398.11  import java.util.*;
   399.1 --- a/test/tools/javac/generics/wildcards/neg/CastFail20.java	Thu Jun 11 10:54:31 2009 -0700
   399.2 +++ b/test/tools/javac/generics/wildcards/neg/CastFail20.java	Thu Jun 11 21:35:12 2009 -0700
   399.3 @@ -27,7 +27,7 @@
   399.4   * @summary Test casts (legal, warning, and errors)
   399.5   * @author gafter
   399.6   *
   399.7 - * @compile/fail -source 1.5 CastFail20.java
   399.8 + * @compile/fail  CastFail20.java
   399.9   */
  399.10  
  399.11  import java.util.*;
   400.1 --- a/test/tools/javac/generics/wildcards/neg/CastFail21.java	Thu Jun 11 10:54:31 2009 -0700
   400.2 +++ b/test/tools/javac/generics/wildcards/neg/CastFail21.java	Thu Jun 11 21:35:12 2009 -0700
   400.3 @@ -27,7 +27,7 @@
   400.4   * @summary Test casts (legal, warning, and errors)
   400.5   * @author gafter
   400.6   *
   400.7 - * @compile/fail -source 1.5 CastFail20.java
   400.8 + * @compile/fail  CastFail20.java
   400.9   */
  400.10  
  400.11  import java.util.*;
   401.1 --- a/test/tools/javac/generics/wildcards/neg/CastFail3.java	Thu Jun 11 10:54:31 2009 -0700
   401.2 +++ b/test/tools/javac/generics/wildcards/neg/CastFail3.java	Thu Jun 11 21:35:12 2009 -0700
   401.3 @@ -27,7 +27,7 @@
   401.4   * @summary Test casts (legal, warning, and errors)
   401.5   * @author gafter
   401.6   *
   401.7 - * @compile/fail -source 1.5 CastFail3.java
   401.8 + * @compile/fail  CastFail3.java
   401.9   */
  401.10  
  401.11  import java.util.*;
   402.1 --- a/test/tools/javac/generics/wildcards/neg/CastFail4.java	Thu Jun 11 10:54:31 2009 -0700
   402.2 +++ b/test/tools/javac/generics/wildcards/neg/CastFail4.java	Thu Jun 11 21:35:12 2009 -0700
   402.3 @@ -27,7 +27,7 @@
   402.4   * @summary Test casts (legal, warning, and errors)
   402.5   * @author gafter
   402.6   *
   402.7 - * @compile/fail -source 1.5 CastFail4.java
   402.8 + * @compile/fail  CastFail4.java
   402.9   */
  402.10  
  402.11  import java.util.*;
   403.1 --- a/test/tools/javac/generics/wildcards/neg/CastFail5.java	Thu Jun 11 10:54:31 2009 -0700
   403.2 +++ b/test/tools/javac/generics/wildcards/neg/CastFail5.java	Thu Jun 11 21:35:12 2009 -0700
   403.3 @@ -27,7 +27,7 @@
   403.4   * @summary Test casts (legal, warning, and errors)
   403.5   * @author gafter
   403.6   *
   403.7 - * @compile/fail -source 1.5 CastFail5.java
   403.8 + * @compile/fail  CastFail5.java
   403.9   */
  403.10  
  403.11  import java.util.*;
   404.1 --- a/test/tools/javac/generics/wildcards/neg/CastFail6.java	Thu Jun 11 10:54:31 2009 -0700
   404.2 +++ b/test/tools/javac/generics/wildcards/neg/CastFail6.java	Thu Jun 11 21:35:12 2009 -0700
   404.3 @@ -27,7 +27,7 @@
   404.4   * @summary Test casts (legal, warning, and errors)
   404.5   * @author gafter
   404.6   *
   404.7 - * @compile/fail -source 1.5 CastFail6.java
   404.8 + * @compile/fail  CastFail6.java
   404.9   */
  404.10  
  404.11  import java.util.*;
   405.1 --- a/test/tools/javac/generics/wildcards/neg/CastFail7.java	Thu Jun 11 10:54:31 2009 -0700
   405.2 +++ b/test/tools/javac/generics/wildcards/neg/CastFail7.java	Thu Jun 11 21:35:12 2009 -0700
   405.3 @@ -27,7 +27,7 @@
   405.4   * @summary Test casts (legal, warning, and errors)
   405.5   * @author gafter
   405.6   *
   405.7 - * @compile/fail -source 1.5 CastFail7.java
   405.8 + * @compile/fail  CastFail7.java
   405.9   */
  405.10  
  405.11  import java.util.*;
   406.1 --- a/test/tools/javac/generics/wildcards/neg/CastFail8.java	Thu Jun 11 10:54:31 2009 -0700
   406.2 +++ b/test/tools/javac/generics/wildcards/neg/CastFail8.java	Thu Jun 11 21:35:12 2009 -0700
   406.3 @@ -27,7 +27,7 @@
   406.4   * @summary Test casts (legal, warning, and errors)
   406.5   * @author gafter
   406.6   *
   406.7 - * @compile/fail -source 1.5 CastFail8.java
   406.8 + * @compile/fail  CastFail8.java
   406.9   */
  406.10  
  406.11  import java.util.*;
   407.1 --- a/test/tools/javac/generics/wildcards/neg/CastFail9.java	Thu Jun 11 10:54:31 2009 -0700
   407.2 +++ b/test/tools/javac/generics/wildcards/neg/CastFail9.java	Thu Jun 11 21:35:12 2009 -0700
   407.3 @@ -27,7 +27,7 @@
   407.4   * @summary Test casts (legal, warning, and errors)
   407.5   * @author gafter
   407.6   *
   407.7 - * @compile/fail -source 1.5 CastFail9.java
   407.8 + * @compile/fail  CastFail9.java
   407.9   */
  407.10  
  407.11  import java.util.*;
   408.1 --- a/test/tools/javac/generics/wildcards/neg/CastWarn10.java	Thu Jun 11 10:54:31 2009 -0700
   408.2 +++ b/test/tools/javac/generics/wildcards/neg/CastWarn10.java	Thu Jun 11 21:35:12 2009 -0700
   408.3 @@ -27,7 +27,7 @@
   408.4   * @summary Test casts (legal, warning, and errors)
   408.5   * @author gafter
   408.6   *
   408.7 - * @compile/fail -source 1.5 -Werror -Xlint:unchecked CastWarn10.java
   408.8 + * @compile/fail  -Werror -Xlint:unchecked CastWarn10.java
   408.9   */
  408.10  
  408.11  import java.util.*;
   409.1 --- a/test/tools/javac/generics/wildcards/neg/CastWarn11.java	Thu Jun 11 10:54:31 2009 -0700
   409.2 +++ b/test/tools/javac/generics/wildcards/neg/CastWarn11.java	Thu Jun 11 21:35:12 2009 -0700
   409.3 @@ -27,7 +27,7 @@
   409.4   * @summary Test casts (legal, warning, and errors)
   409.5   * @author gafter
   409.6   *
   409.7 - * @compile/fail -source 1.5 -Werror -Xlint:unchecked CastWarn11.java
   409.8 + * @compile/fail  -Werror -Xlint:unchecked CastWarn11.java
   409.9   */
  409.10  
  409.11  import java.util.*;
   410.1 --- a/test/tools/javac/generics/wildcards/neg/CastWarn12.java	Thu Jun 11 10:54:31 2009 -0700
   410.2 +++ b/test/tools/javac/generics/wildcards/neg/CastWarn12.java	Thu Jun 11 21:35:12 2009 -0700
   410.3 @@ -27,7 +27,7 @@
   410.4   * @summary Test casts (legal, warning, and errors)
   410.5   * @author gafter
   410.6   *
   410.7 - * @compile/fail -source 1.5 -Werror -Xlint:unchecked CastWarn12.java
   410.8 + * @compile/fail  -Werror -Xlint:unchecked CastWarn12.java
   410.9   */
  410.10  
  410.11  import java.util.*;
   411.1 --- a/test/tools/javac/generics/wildcards/neg/CastWarn13.java	Thu Jun 11 10:54:31 2009 -0700
   411.2 +++ b/test/tools/javac/generics/wildcards/neg/CastWarn13.java	Thu Jun 11 21:35:12 2009 -0700
   411.3 @@ -27,7 +27,7 @@
   411.4   * @summary Test casts (legal, warning, and errors)
   411.5   * @author gafter
   411.6   *
   411.7 - * @compile/fail -source 1.5 -Werror -Xlint:unchecked CastWarn13.java
   411.8 + * @compile/fail  -Werror -Xlint:unchecked CastWarn13.java
   411.9   */
  411.10  
  411.11  import java.util.*;
   412.1 --- a/test/tools/javac/generics/wildcards/neg/CastWarn14.java	Thu Jun 11 10:54:31 2009 -0700
   412.2 +++ b/test/tools/javac/generics/wildcards/neg/CastWarn14.java	Thu Jun 11 21:35:12 2009 -0700
   412.3 @@ -27,7 +27,7 @@
   412.4   * @summary Test casts (legal, warning, and errors)
   412.5   * @author gafter
   412.6   *
   412.7 - * @compile/fail -source 1.5 -Werror -Xlint:unchecked CastWarn14.java
   412.8 + * @compile/fail  -Werror -Xlint:unchecked CastWarn14.java
   412.9   */
  412.10  
  412.11  import java.util.*;
   413.1 --- a/test/tools/javac/generics/wildcards/neg/CastWarn2.java	Thu Jun 11 10:54:31 2009 -0700
   413.2 +++ b/test/tools/javac/generics/wildcards/neg/CastWarn2.java	Thu Jun 11 21:35:12 2009 -0700
   413.3 @@ -27,7 +27,7 @@
   413.4   * @summary Test casts (legal, warning, and errors)
   413.5   * @author gafter
   413.6   *
   413.7 - * @compile/fail -source 1.5 -Werror -Xlint:unchecked CastWarn2.java
   413.8 + * @compile/fail  -Werror -Xlint:unchecked CastWarn2.java
   413.9   */
  413.10  
  413.11  import java.util.*;
   414.1 --- a/test/tools/javac/generics/wildcards/neg/CastWarn3.java	Thu Jun 11 10:54:31 2009 -0700
   414.2 +++ b/test/tools/javac/generics/wildcards/neg/CastWarn3.java	Thu Jun 11 21:35:12 2009 -0700
   414.3 @@ -27,7 +27,7 @@
   414.4   * @summary Test casts (legal, warning, and errors)
   414.5   * @author gafter
   414.6   *
   414.7 - * @compile/fail -source 1.5 -Werror -Xlint:unchecked CastWarn3.java
   414.8 + * @compile/fail  -Werror -Xlint:unchecked CastWarn3.java
   414.9   */
  414.10  
  414.11  import java.util.*;
   415.1 --- a/test/tools/javac/generics/wildcards/neg/CastWarn4.java	Thu Jun 11 10:54:31 2009 -0700
   415.2 +++ b/test/tools/javac/generics/wildcards/neg/CastWarn4.java	Thu Jun 11 21:35:12 2009 -0700
   415.3 @@ -27,7 +27,7 @@
   415.4   * @summary Test casts (legal, warning, and errors)
   415.5   * @author gafter
   415.6   *
   415.7 - * @compile/fail -source 1.5 -Werror -Xlint:unchecked CastWarn4.java
   415.8 + * @compile/fail  -Werror -Xlint:unchecked CastWarn4.java
   415.9   */
  415.10  
  415.11  import java.util.*;
   416.1 --- a/test/tools/javac/generics/wildcards/neg/CastWarn5.java	Thu Jun 11 10:54:31 2009 -0700
   416.2 +++ b/test/tools/javac/generics/wildcards/neg/CastWarn5.java	Thu Jun 11 21:35:12 2009 -0700
   416.3 @@ -27,7 +27,7 @@
   416.4   * @summary Test casts (legal, warning, and errors)
   416.5   * @author gafter
   416.6   *
   416.7 - * @compile/fail -source 1.5 -Werror -Xlint:unchecked CastWarn5.java
   416.8 + * @compile/fail  -Werror -Xlint:unchecked CastWarn5.java
   416.9   */
  416.10  
  416.11  import java.util.*;
   417.1 --- a/test/tools/javac/generics/wildcards/neg/CastWarn6.java	Thu Jun 11 10:54:31 2009 -0700
   417.2 +++ b/test/tools/javac/generics/wildcards/neg/CastWarn6.java	Thu Jun 11 21:35:12 2009 -0700
   417.3 @@ -27,7 +27,7 @@
   417.4   * @summary Test casts (legal, warning, and errors)
   417.5   * @author gafter
   417.6   *
   417.7 - * @compile/fail -source 1.5 -Werror -Xlint:unchecked CastWarn6.java
   417.8 + * @compile/fail  -Werror -Xlint:unchecked CastWarn6.java
   417.9   */
  417.10  
  417.11  import java.util.*;
   418.1 --- a/test/tools/javac/generics/wildcards/neg/CastWarn7.java	Thu Jun 11 10:54:31 2009 -0700
   418.2 +++ b/test/tools/javac/generics/wildcards/neg/CastWarn7.java	Thu Jun 11 21:35:12 2009 -0700
   418.3 @@ -27,7 +27,7 @@
   418.4   * @summary Test casts (legal, warning, and errors)
   418.5   * @author gafter
   418.6   *
   418.7 - * @compile/fail -source 1.5 -Werror -Xlint:unchecked CastWarn7.java
   418.8 + * @compile/fail  -Werror -Xlint:unchecked CastWarn7.java
   418.9   */
  418.10  
  418.11  import java.util.*;
   419.1 --- a/test/tools/javac/generics/wildcards/neg/CastWarn8.java	Thu Jun 11 10:54:31 2009 -0700
   419.2 +++ b/test/tools/javac/generics/wildcards/neg/CastWarn8.java	Thu Jun 11 21:35:12 2009 -0700
   419.3 @@ -27,7 +27,7 @@
   419.4   * @summary Test casts (legal, warning, and errors)
   419.5   * @author gafter
   419.6   *
   419.7 - * @compile/fail -source 1.5 -Werror -Xlint:unchecked CastWarn8.java
   419.8 + * @compile/fail  -Werror -Xlint:unchecked CastWarn8.java
   419.9   */
  419.10  
  419.11  import java.util.*;
   420.1 --- a/test/tools/javac/generics/wildcards/neg/CastWarn9.java	Thu Jun 11 10:54:31 2009 -0700
   420.2 +++ b/test/tools/javac/generics/wildcards/neg/CastWarn9.java	Thu Jun 11 21:35:12 2009 -0700
   420.3 @@ -27,7 +27,7 @@
   420.4   * @summary Test casts (legal, warning, and errors)
   420.5   * @author gafter
   420.6   *
   420.7 - * @compile/fail -source 1.5 -Werror -Xlint:unchecked CastWarn9.java
   420.8 + * @compile/fail  -Werror -Xlint:unchecked CastWarn9.java
   420.9   */
  420.10  
  420.11  import java.util.*;
   421.1 --- a/test/tools/javac/generics/wildcards/neg/ParamCast.java	Thu Jun 11 10:54:31 2009 -0700
   421.2 +++ b/test/tools/javac/generics/wildcards/neg/ParamCast.java	Thu Jun 11 21:35:12 2009 -0700
   421.3 @@ -27,7 +27,7 @@
   421.4   * @summary Description
   421.5   * @author gafter
   421.6   *
   421.7 - * @compile/fail -source 1.5 ParamCast.java
   421.8 + * @compile/fail  ParamCast.java
   421.9   */
  421.10  
  421.11  class A<T> {}
   422.1 --- a/test/tools/javac/generics/wildcards/neg/Readonly.java	Thu Jun 11 10:54:31 2009 -0700
   422.2 +++ b/test/tools/javac/generics/wildcards/neg/Readonly.java	Thu Jun 11 21:35:12 2009 -0700
   422.3 @@ -27,7 +27,7 @@
   422.4   * @summary an extends-bound (covariant) wildcard is like readonly
   422.5   * @author gafter
   422.6   *
   422.7 - * @compile/fail -source 1.5 Readonly.java
   422.8 + * @compile/fail  Readonly.java
   422.9   */
  422.10  
  422.11  class Err<T> {
   423.1 --- a/test/tools/javac/generics/wildcards/neg/Unbounded.java	Thu Jun 11 10:54:31 2009 -0700
   423.2 +++ b/test/tools/javac/generics/wildcards/neg/Unbounded.java	Thu Jun 11 21:35:12 2009 -0700
   423.3 @@ -27,7 +27,7 @@
   423.4   * @summary an unbounded (bivariant) wildcard doesn't allow reading
   423.5   * @author gafter
   423.6   *
   423.7 - * @compile/fail -source 1.5 Unbounded.java
   423.8 + * @compile/fail  Unbounded.java
   423.9   */
  423.10  
  423.11  import java.util.Stack;
   424.1 --- a/test/tools/javac/generics/wildcards/pos/AmbiguousCast2.java	Thu Jun 11 10:54:31 2009 -0700
   424.2 +++ b/test/tools/javac/generics/wildcards/pos/AmbiguousCast2.java	Thu Jun 11 21:35:12 2009 -0700
   424.3 @@ -27,7 +27,7 @@
   424.4   * @summary generics: unable to cast between two convertible types
   424.5   * @author gafter
   424.6   *
   424.7 - * @compile -source 1.5 AmbiguousCast2.java
   424.8 + * @compile  AmbiguousCast2.java
   424.9   */
  424.10  
  424.11  import java.lang.ref.*;
   425.1 --- a/test/tools/javac/generics/wildcards/pos/BoundsCollision.java	Thu Jun 11 10:54:31 2009 -0700
   425.2 +++ b/test/tools/javac/generics/wildcards/pos/BoundsCollision.java	Thu Jun 11 21:35:12 2009 -0700
   425.3 @@ -27,7 +27,7 @@
   425.4   * @summary when upper bounds and lower bounds collide
   425.5   * @author gafter
   425.6   *
   425.7 - * @compile -source 1.5 -Werror BoundsCollision.java
   425.8 + * @compile  -Werror BoundsCollision.java
   425.9   */
  425.10  
  425.11  class StreinBug {
   426.1 --- a/test/tools/javac/generics/wildcards/pos/Capture.java	Thu Jun 11 10:54:31 2009 -0700
   426.2 +++ b/test/tools/javac/generics/wildcards/pos/Capture.java	Thu Jun 11 21:35:12 2009 -0700
   426.3 @@ -27,7 +27,7 @@
   426.4   * @summary Wildcard capture
   426.5   * @author gafter
   426.6   *
   426.7 - * @compile -source 1.5 -Werror Capture.java
   426.8 + * @compile  -Werror Capture.java
   426.9   */
  426.10  
  426.11  class X<T> {}
   427.1 --- a/test/tools/javac/generics/wildcards/pos/CastTest.java	Thu Jun 11 10:54:31 2009 -0700
   427.2 +++ b/test/tools/javac/generics/wildcards/pos/CastTest.java	Thu Jun 11 21:35:12 2009 -0700
   427.3 @@ -27,7 +27,7 @@
   427.4   * @summary Test casts (legal, warning, and errors)
   427.5   * @author gafter
   427.6   *
   427.7 - * @compile -source 1.5 -Werror CastTest.java
   427.8 + * @compile  -Werror CastTest.java
   427.9   */
  427.10  
  427.11  import java.util.*;
   428.1 --- a/test/tools/javac/generics/wildcards/pos/InstanceOf.java	Thu Jun 11 10:54:31 2009 -0700
   428.2 +++ b/test/tools/javac/generics/wildcards/pos/InstanceOf.java	Thu Jun 11 21:35:12 2009 -0700
   428.3 @@ -27,7 +27,7 @@
   428.4   * @summary generics: type cast with instance of
   428.5   * @author gafter
   428.6   *
   428.7 - * @compile -source 1.5 -Werror InstanceOf.java
   428.8 + * @compile  -Werror InstanceOf.java
   428.9   */
  428.10  
  428.11  class InstanceOf<T> {
   429.1 --- a/test/tools/javac/generics/wildcards/pos/ParamCast.java	Thu Jun 11 10:54:31 2009 -0700
   429.2 +++ b/test/tools/javac/generics/wildcards/pos/ParamCast.java	Thu Jun 11 21:35:12 2009 -0700
   429.3 @@ -27,7 +27,7 @@
   429.4   * @summary integrate improved wildcard substitution from CPH
   429.5   * @author gafter
   429.6   *
   429.7 - * @compile -source 1.5 -Werror -Xlint:unchecked ParamCast.java
   429.8 + * @compile  -Werror -Xlint:unchecked ParamCast.java
   429.9   */
  429.10  
  429.11  class A<T> {}
   430.1 --- a/test/tools/javac/generics/wildcards/pos/RvalConversion.java	Thu Jun 11 10:54:31 2009 -0700
   430.2 +++ b/test/tools/javac/generics/wildcards/pos/RvalConversion.java	Thu Jun 11 21:35:12 2009 -0700
   430.3 @@ -27,7 +27,7 @@
   430.4   * @summary rvalue conversion changes "? extends X" to "X".
   430.5   * @author gafter
   430.6   *
   430.7 - * @compile -source 1.5 RvalConversion.java
   430.8 + * @compile  RvalConversion.java
   430.9   */
  430.10  
  430.11  import java.util.*;
   431.1 --- a/test/tools/javac/generics/wildcards/pos/UncheckedCast1.java	Thu Jun 11 10:54:31 2009 -0700
   431.2 +++ b/test/tools/javac/generics/wildcards/pos/UncheckedCast1.java	Thu Jun 11 21:35:12 2009 -0700
   431.3 @@ -27,7 +27,7 @@
   431.4   * @summary generics: failure of some unchecked casts
   431.5   * @author gafter
   431.6   *
   431.7 - * @compile -source 1.5 UncheckedCast1.java
   431.8 + * @compile  UncheckedCast1.java
   431.9   */
  431.10  
  431.11  class Z {
   432.1 --- a/test/tools/javac/importscope/A.java	Thu Jun 11 10:54:31 2009 -0700
   432.2 +++ b/test/tools/javac/importscope/A.java	Thu Jun 11 21:35:12 2009 -0700
   432.3 @@ -27,7 +27,7 @@
   432.4   * @summary static import of private field crashes compiler
   432.5   * @author gafter
   432.6   *
   432.7 - * @compile -source 1.5 A.java B.java
   432.8 + * @compile A.java B.java
   432.9   */
  432.10  
  432.11  package p1;
   433.1 --- a/test/tools/javac/limits/FinallyNesting.java	Thu Jun 11 10:54:31 2009 -0700
   433.2 +++ b/test/tools/javac/limits/FinallyNesting.java	Thu Jun 11 21:35:12 2009 -0700
   433.3 @@ -29,7 +29,7 @@
   433.4   *
   433.5   * @compile -source 1.4 -target 1.4 FinallyNesting.java
   433.6   */
   433.7 -
   433.8 +// Source and target 1.4 are needed for the test to pass with default memory sizes.
   433.9  class FinallyNesting {
  433.10      public static void main(String[] args) {
  433.11          int x;
   434.1 --- a/test/tools/javac/lint/Unchecked.java	Thu Jun 11 10:54:31 2009 -0700
   434.2 +++ b/test/tools/javac/lint/Unchecked.java	Thu Jun 11 21:35:12 2009 -0700
   434.3 @@ -27,7 +27,7 @@
   434.4   * @summary Add -Xlint flag
   434.5   * @author gafter
   434.6   *
   434.7 - * @compile/fail -source 1.5 -Xlint:unchecked -Werror Unchecked.java
   434.8 + * @compile/fail -Xlint:unchecked -Werror Unchecked.java
   434.9   */
  434.10  
  434.11  class Unchecked<T> {
   435.1 --- a/test/tools/javac/miranda/T4666866.java	Thu Jun 11 10:54:31 2009 -0700
   435.2 +++ b/test/tools/javac/miranda/T4666866.java	Thu Jun 11 21:35:12 2009 -0700
   435.3 @@ -4,7 +4,7 @@
   435.4   * @summary REGRESSION: Generated error message unhelpful for missing methods
   435.5   * @author gafter
   435.6   *
   435.7 - * @compile/fail/ref=T4666866.out -XDstdout -XDdiags=%b:%l:%_%m T4666866.java
   435.8 + * @compile/fail/ref=T4666866.out -XDstdout -XDrawDiagnostics T4666866.java
   435.9   */
  435.10  
  435.11  class t implements Runnable {}
   436.1 --- a/test/tools/javac/miranda/T4666866.out	Thu Jun 11 10:54:31 2009 -0700
   436.2 +++ b/test/tools/javac/miranda/T4666866.out	Thu Jun 11 21:35:12 2009 -0700
   436.3 @@ -1,4 +1,2 @@
   436.4 -T4666866.java:10: t is not abstract and does not override abstract method run() in java.lang.Runnable
   436.5 -class t implements Runnable {}
   436.6 -^
   436.7 +T4666866.java:10:1: compiler.err.does.not.override.abstract: t, run(), java.lang.Runnable
   436.8  1 error
   437.1 --- a/test/tools/javac/miranda/T4711325.java	Thu Jun 11 10:54:31 2009 -0700
   437.2 +++ b/test/tools/javac/miranda/T4711325.java	Thu Jun 11 21:35:12 2009 -0700
   437.3 @@ -27,7 +27,7 @@
   437.4   * @summary compiler allows unimplementable interfaces
   437.5   * @author gafter
   437.6   *
   437.7 - * @compile -source 1.5 T4711325.java
   437.8 + * @compile                  T4711325.java
   437.9   * @compile/fail -source 1.4 T4711325.java
  437.10   */
  437.11  
   438.1 --- a/test/tools/javac/mixedTarget/CompatibleAbstracts1.java	Thu Jun 11 10:54:31 2009 -0700
   438.2 +++ b/test/tools/javac/mixedTarget/CompatibleAbstracts1.java	Thu Jun 11 21:35:12 2009 -0700
   438.3 @@ -27,14 +27,14 @@
   438.4   * @summary 1.4 javac should not accept the Covariant Return Type
   438.5   * @author gafter
   438.6   *
   438.7 - * @compile      -source 1.5 CompatibleAbstracts1.java
   438.8 - * @compile      -source 1.5 CompatibleAbstracts2.java
   438.9 + * @compile                  CompatibleAbstracts1.java
  438.10 + * @compile                  CompatibleAbstracts2.java
  438.11   * @compile      -source 1.4 CompatibleAbstracts2.java
  438.12 - * @compile      -source 1.5 CompatibleAbstracts3.java
  438.13 + * @compile                  CompatibleAbstracts3.java
  438.14   * @compile/fail -source 1.4 CompatibleAbstracts3.java
  438.15 - * @compile      -source 1.5 CompatibleAbstracts4.java
  438.16 + * @compile                  CompatibleAbstracts4.java
  438.17   * @compile/fail -source 1.4 CompatibleAbstracts4.java
  438.18 - * @compile      -source 1.5 CompatibleAbstracts5.java
  438.19 + * @compile                  CompatibleAbstracts5.java
  438.20   * @compile/fail -source 1.4 CompatibleAbstracts5.java
  438.21   */
  438.22  
   439.1 --- a/test/tools/javac/mixedTarget/ExtendCovariant2.java	Thu Jun 11 10:54:31 2009 -0700
   439.2 +++ b/test/tools/javac/mixedTarget/ExtendCovariant2.java	Thu Jun 11 21:35:12 2009 -0700
   439.3 @@ -28,7 +28,7 @@
   439.4   * @author gafter
   439.5   *
   439.6   * @compile/fail -source 1.4 ExtendCovariant2.java
   439.7 - * @compile -source 1.5 ExtendCovariant2.java
   439.8 + * @compile                  ExtendCovariant2.java
   439.9   */
  439.10  
  439.11  /**
   440.1 --- a/test/tools/javac/overload/T5090220.java	Thu Jun 11 10:54:31 2009 -0700
   440.2 +++ b/test/tools/javac/overload/T5090220.java	Thu Jun 11 21:35:12 2009 -0700
   440.3 @@ -25,7 +25,7 @@
   440.4   * @test
   440.5   * @bug 5090220
   440.6   * @summary Autoboxing applied when calculating most-specific method
   440.7 - * @compile/fail -source 5 T5090220.java
   440.8 + * @compile/fail T5090220.java
   440.9   */
  440.10  
  440.11  class T5090220 {
   441.1 --- a/test/tools/javac/processing/6348499/A.java	Thu Jun 11 10:54:31 2009 -0700
   441.2 +++ b/test/tools/javac/processing/6348499/A.java	Thu Jun 11 21:35:12 2009 -0700
   441.3 @@ -28,7 +28,7 @@
   441.4  import javax.lang.model.element.*;
   441.5  
   441.6  @SupportedAnnotationTypes("*")
   441.7 -@SupportedSourceVersion(SourceVersion.RELEASE_6)
   441.8 +@SupportedSourceVersion(SourceVersion.RELEASE_7)
   441.9  public class A extends AbstractProcessor {
  441.10      public boolean process(Set<? extends TypeElement> tes, RoundEnvironment renv) {
  441.11          Filer filer = processingEnv.getFiler();
   442.1 --- a/test/tools/javac/processing/6414633/A.java	Thu Jun 11 10:54:31 2009 -0700
   442.2 +++ b/test/tools/javac/processing/6414633/A.java	Thu Jun 11 21:35:12 2009 -0700
   442.3 @@ -30,7 +30,7 @@
   442.4  import javax.tools.*;
   442.5  
   442.6  @SupportedAnnotationTypes("*")
   442.7 -@SupportedSourceVersion(SourceVersion.RELEASE_6)
   442.8 +@SupportedSourceVersion(SourceVersion.RELEASE_7)
   442.9  public class A extends AbstractProcessor {
  442.10  
  442.11      public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
   443.1 --- a/test/tools/javac/processing/6430209/b6341534.java	Thu Jun 11 10:54:31 2009 -0700
   443.2 +++ b/test/tools/javac/processing/6430209/b6341534.java	Thu Jun 11 21:35:12 2009 -0700
   443.3 @@ -30,7 +30,7 @@
   443.4  import java.util.Set;
   443.5  
   443.6  @SupportedAnnotationTypes({"*"})
   443.7 -@SupportedSourceVersion(javax.lang.model.SourceVersion.RELEASE_6)
   443.8 +@SupportedSourceVersion(javax.lang.model.SourceVersion.RELEASE_7)
   443.9  public class b6341534 extends AbstractProcessor {
  443.10      static int r = 0;
  443.11      static Elements E = null;
   444.1 --- a/test/tools/javac/processing/T6439826.java	Thu Jun 11 10:54:31 2009 -0700
   444.2 +++ b/test/tools/javac/processing/T6439826.java	Thu Jun 11 21:35:12 2009 -0700
   444.3 @@ -39,7 +39,7 @@
   444.4  
   444.5  
   444.6  @SupportedAnnotationTypes("*")
   444.7 -@SupportedSourceVersion(SourceVersion.RELEASE_6 )
   444.8 +@SupportedSourceVersion(SourceVersion.RELEASE_7 )
   444.9  public class T6439826 extends AbstractProcessor {
  444.10      public static void main(String... args) {
  444.11          String testSrc = System.getProperty("test.src", ".");
   445.1 --- a/test/tools/javac/processing/environment/TestSourceVersion.java	Thu Jun 11 10:54:31 2009 -0700
   445.2 +++ b/test/tools/javac/processing/environment/TestSourceVersion.java	Thu Jun 11 21:35:12 2009 -0700
   445.3 @@ -34,6 +34,8 @@
   445.4   * @compile -processor TestSourceVersion -proc:only -source   5 -AExpectedVersion=RELEASE_5 HelloWorld.java
   445.5   * @compile -processor TestSourceVersion -proc:only -source 1.6 -AExpectedVersion=RELEASE_6 HelloWorld.java
   445.6   * @compile -processor TestSourceVersion -proc:only -source   6 -AExpectedVersion=RELEASE_6 HelloWorld.java
   445.7 + * @compile -processor TestSourceVersion -proc:only -source 1.7 -AExpectedVersion=RELEASE_7 HelloWorld.java
   445.8 + * @compile -processor TestSourceVersion -proc:only -source   7 -AExpectedVersion=RELEASE_7 HelloWorld.java
   445.9   */
  445.10  
  445.11  import java.util.Set;
   446.1 --- a/test/tools/javac/protectedAccess/ProtectedMemberAccess2.java	Thu Jun 11 10:54:31 2009 -0700
   446.2 +++ b/test/tools/javac/protectedAccess/ProtectedMemberAccess2.java	Thu Jun 11 21:35:12 2009 -0700
   446.3 @@ -4,7 +4,7 @@
   446.4   * @summary Verify correct implementation of JLS2e 6.6.2.1
   446.5   * @author maddox
   446.6   *
   446.7 - * @compile/fail/ref=ProtectedMemberAccess2.out -XDstdout -XDdiags=%b:%l:%_%m ProtectedMemberAccess2.java
   446.8 + * @compile/fail/ref=ProtectedMemberAccess2.out -XDstdout -XDdiags=-simpleNames -XDdiagsFormat=%b:%l:%_%m ProtectedMemberAccess2.java
   446.9   */
  446.10  
  446.11  // 71 errors expected.
   447.1 --- a/test/tools/javac/protectedAccess/ProtectedMemberAccess3.java	Thu Jun 11 10:54:31 2009 -0700
   447.2 +++ b/test/tools/javac/protectedAccess/ProtectedMemberAccess3.java	Thu Jun 11 21:35:12 2009 -0700
   447.3 @@ -4,7 +4,7 @@
   447.4   * @summary Verify correct implementation of JLS2e 6.6.2.1
   447.5   * @author maddox
   447.6   *
   447.7 - * @compile/fail/ref=ProtectedMemberAccess3.out -XDstdout -XDdiags=%b:%l:%_%m ProtectedMemberAccess3.java
   447.8 + * @compile/fail/ref=ProtectedMemberAccess3.out -XDstdout -XDdiags=-simpleNames -XDdiagsFormat=%b:%l:%_%m ProtectedMemberAccess3.java
   447.9   */
  447.10  
  447.11  // 46 errors expected.
   448.1 --- a/test/tools/javac/protectedAccess/ProtectedMemberAccess4.java	Thu Jun 11 10:54:31 2009 -0700
   448.2 +++ b/test/tools/javac/protectedAccess/ProtectedMemberAccess4.java	Thu Jun 11 21:35:12 2009 -0700
   448.3 @@ -4,7 +4,7 @@
   448.4   * @summary Verify correct implementation of JLS2e 6.6.2.1
   448.5   * @author maddox
   448.6   *
   448.7 - * @compile/fail/ref=ProtectedMemberAccess4.out -XDstdout -XDdiags=%b:%l:%_%m ProtectedMemberAccess4.java
   448.8 + * @compile/fail/ref=ProtectedMemberAccess4.out -XDstdout -XDdiags=-simpleNames -XDdiagsFormat=%b:%l:%_%m ProtectedMemberAccess4.java
   448.9   */
  448.10  
  448.11  // 33 errors expected.
   449.1 --- a/test/tools/javac/stackmap/T4955930.sh	Thu Jun 11 10:54:31 2009 -0700
   449.2 +++ b/test/tools/javac/stackmap/T4955930.sh	Thu Jun 11 21:35:12 2009 -0700
   449.3 @@ -56,7 +56,7 @@
   449.4  TMP1=T4955930.javap
   449.5  
   449.6  cp "${TESTSRC}${FS}T4955930.java" .
   449.7 -"${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -target 6 T4955930.java
   449.8 +"${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -source 6 -target 6 T4955930.java
   449.9  result=$?
  449.10  if [ $result -ne 0 ]
  449.11  then
   450.1 --- a/test/tools/javac/stackmap/UninitThis.java	Thu Jun 11 10:54:31 2009 -0700
   450.2 +++ b/test/tools/javac/stackmap/UninitThis.java	Thu Jun 11 21:35:12 2009 -0700
   450.3 @@ -26,9 +26,6 @@
   450.4   * @bug 4948063
   450.5   * @summary Invalid java.io.FileInputStream with v49 generate by javac
   450.6   * @author gafter
   450.7 - *
   450.8 - * @compile -source 1.5 -target 1.5 UninitThis.java
   450.9 - * @run main UninitThis
  450.10   */
  450.11  
  450.12  // may fail due to VM bug 4948729
   451.1 --- a/test/tools/javac/staticImport/Ambig1.java	Thu Jun 11 10:54:31 2009 -0700
   451.2 +++ b/test/tools/javac/staticImport/Ambig1.java	Thu Jun 11 21:35:12 2009 -0700
   451.3 @@ -27,7 +27,7 @@
   451.4   * @summary Missing ambiguity error when two methods are equally specific
   451.5   * @author gafter
   451.6   *
   451.7 - * @compile/fail -source 1.5 Ambig1.java
   451.8 + * @compile/fail  Ambig1.java
   451.9   */
  451.10  
  451.11  package ambig1;
   452.1 --- a/test/tools/javac/staticImport/ImportInherit.java	Thu Jun 11 10:54:31 2009 -0700
   452.2 +++ b/test/tools/javac/staticImport/ImportInherit.java	Thu Jun 11 21:35:12 2009 -0700
   452.3 @@ -27,7 +27,7 @@
   452.4   * @summary static import versus inherited members
   452.5   * @author gafter
   452.6   *
   452.7 - * @compile -source 1.5 ImportInherit.java
   452.8 + * @compile  ImportInherit.java
   452.9   */
  452.10  
  452.11  package importInherit;
   453.1 --- a/test/tools/javac/staticImport/ImportPrivate.java	Thu Jun 11 10:54:31 2009 -0700
   453.2 +++ b/test/tools/javac/staticImport/ImportPrivate.java	Thu Jun 11 21:35:12 2009 -0700
   453.3 @@ -27,7 +27,7 @@
   453.4   * @summary NPE while compiling static import of inaccessible class member
   453.5   * @author gafter
   453.6   *
   453.7 - * @compile/fail -source 1.5 ImportPrivate.java
   453.8 + * @compile/fail  ImportPrivate.java
   453.9   */
  453.10  
  453.11  package importPrivate;
   454.1 --- a/test/tools/javac/staticImport/PrivateStaticImport.java	Thu Jun 11 10:54:31 2009 -0700
   454.2 +++ b/test/tools/javac/staticImport/PrivateStaticImport.java	Thu Jun 11 21:35:12 2009 -0700
   454.3 @@ -27,7 +27,7 @@
   454.4   * @summary static import of private field crashes compiler
   454.5   * @author gafter
   454.6   *
   454.7 - * @compile/fail -source 1.5 PrivateStaticImport.java
   454.8 + * @compile/fail  PrivateStaticImport.java
   454.9   */
  454.10  
  454.11  package psi;
   455.1 --- a/test/tools/javac/staticImport/Shadow.java	Thu Jun 11 10:54:31 2009 -0700
   455.2 +++ b/test/tools/javac/staticImport/Shadow.java	Thu Jun 11 21:35:12 2009 -0700
   455.3 @@ -27,7 +27,7 @@
   455.4   * @summary compiler fails to shadow inapplicable method with static import
   455.5   * @author gafter
   455.6   *
   455.7 - * @compile/fail -source 1.5 Shadow.java
   455.8 + * @compile/fail  Shadow.java
   455.9   */
  455.10  
  455.11  package shadow;
   456.1 --- a/test/tools/javac/staticImport/StaticImport.java	Thu Jun 11 10:54:31 2009 -0700
   456.2 +++ b/test/tools/javac/staticImport/StaticImport.java	Thu Jun 11 21:35:12 2009 -0700
   456.3 @@ -27,7 +27,7 @@
   456.4   * @summary add support for JSR 201's static import facility
   456.5   * @author gafter
   456.6   *
   456.7 - * @compile -source 1.5 StaticImport.java
   456.8 + * @compile  StaticImport.java
   456.9   * @run main StaticImport
  456.10   */
  456.11  
   457.1 --- a/test/tools/javac/staticImport/StaticImport2.java	Thu Jun 11 10:54:31 2009 -0700
   457.2 +++ b/test/tools/javac/staticImport/StaticImport2.java	Thu Jun 11 21:35:12 2009 -0700
   457.3 @@ -27,7 +27,7 @@
   457.4   * @summary add support for JSR 201's static import facility
   457.5   * @author gafter
   457.6   *
   457.7 - * @compile/fail -source 1.5 StaticImport2.java
   457.8 + * @compile/fail  StaticImport2.java
   457.9   */
  457.10  
  457.11  package p;
   458.1 --- a/test/tools/javac/unicode/Unmappable.java	Thu Jun 11 10:54:31 2009 -0700
   458.2 +++ b/test/tools/javac/unicode/Unmappable.java	Thu Jun 11 21:35:12 2009 -0700
   458.3 @@ -29,7 +29,7 @@
   458.4   *
   458.5   * @compile              -encoding ascii -source 1.5 Unmappable.java
   458.6   * @compile/fail -Werror -encoding ascii -source 1.5 Unmappable.java
   458.7 - * @compile/fail         -encoding ascii -source 6 Unmappable.java
   458.8 + * @compile/fail         -encoding ascii             Unmappable.java
   458.9   */
  458.10  
  458.11  // example from 4766897
   459.1 --- a/test/tools/javac/varargs/Anon.java	Thu Jun 11 10:54:31 2009 -0700
   459.2 +++ b/test/tools/javac/varargs/Anon.java	Thu Jun 11 21:35:12 2009 -0700
   459.3 @@ -27,7 +27,7 @@
   459.4   * @summary varargs versus anonymous constructors crashes javac
   459.5   * @author gafter
   459.6   *
   459.7 - * @compile -source 1.5 Anon.java
   459.8 + * @compile  Anon.java
   459.9   */
  459.10  
  459.11  class Anon {
   460.1 --- a/test/tools/javac/varargs/BadSyntax2.java	Thu Jun 11 10:54:31 2009 -0700
   460.2 +++ b/test/tools/javac/varargs/BadSyntax2.java	Thu Jun 11 21:35:12 2009 -0700
   460.3 @@ -27,7 +27,7 @@
   460.4   * @summary generic class method with vararg gets "java.lang.AssertionError: arraycode T"
   460.5   * @author gafter
   460.6   *
   460.7 - * @compile -source 1.5 BadSyntax2.java
   460.8 + * @compile  BadSyntax2.java
   460.9   */
  460.10  
  460.11  class Tclass<T> {
   461.1 --- a/test/tools/javac/varargs/Varargs1.java	Thu Jun 11 10:54:31 2009 -0700
   461.2 +++ b/test/tools/javac/varargs/Varargs1.java	Thu Jun 11 21:35:12 2009 -0700
   461.3 @@ -27,7 +27,7 @@
   461.4   * @summary varags, auto boxing
   461.5   * @author gafter
   461.6   *
   461.7 - * @compile -source 1.5 Varargs1.java
   461.8 + * @compile  Varargs1.java
   461.9   * @run main Varargs1
  461.10   */
  461.11  
   462.1 --- a/test/tools/javac/varargs/VarargsOverride.java	Thu Jun 11 10:54:31 2009 -0700
   462.2 +++ b/test/tools/javac/varargs/VarargsOverride.java	Thu Jun 11 21:35:12 2009 -0700
   462.3 @@ -27,8 +27,8 @@
   462.4   * @summary overriding with method of different arity is prohibited
   462.5   * @author gafter
   462.6   *
   462.7 - * @compile -source 1.5 VarargsOverride.java
   462.8 - * @compile/fail -source 1.5 -Werror -Xlint VarargsOverride.java
   462.9 + * @compile  VarargsOverride.java
  462.10 + * @compile/fail  -Werror -Xlint VarargsOverride.java
  462.11   */
  462.12  
  462.13  package varargs.override;
   463.1 --- a/test/tools/javac/varargs/Warn1.java	Thu Jun 11 10:54:31 2009 -0700
   463.2 +++ b/test/tools/javac/varargs/Warn1.java	Thu Jun 11 21:35:12 2009 -0700
   463.3 @@ -27,9 +27,9 @@
   463.4   * @summary need warning if varargs argument isn't boxed
   463.5   * @author gafter
   463.6   *
   463.7 - * @compile      -source 1.5                     Warn1.java
   463.8 - * @compile/fail -source 1.5 -Werror             Warn1.java
   463.9 - * @compile      -source 1.5 -Werror -Xlint:none Warn1.java
  463.10 + * @compile                           Warn1.java
  463.11 + * @compile/fail  -Werror             Warn1.java
  463.12 + * @compile       -Werror -Xlint:none Warn1.java
  463.13   */
  463.14  
  463.15  package varargs.warn1;
   464.1 --- a/test/tools/javac/varargs/Warn2.java	Thu Jun 11 10:54:31 2009 -0700
   464.2 +++ b/test/tools/javac/varargs/Warn2.java	Thu Jun 11 21:35:12 2009 -0700
   464.3 @@ -27,9 +27,9 @@
   464.4   * @summary need warning if varargs argument isn't boxed
   464.5   * @author gafter
   464.6   *
   464.7 - * @compile      -source 1.5                     Warn2.java
   464.8 - * @compile/fail -source 1.5 -Werror             Warn2.java
   464.9 - * @compile      -source 1.5 -Werror -Xlint:none Warn2.java
  464.10 + * @compile                           Warn2.java
  464.11 + * @compile/fail  -Werror             Warn2.java
  464.12 + * @compile       -Werror -Xlint:none Warn2.java
  464.13   */
  464.14  
  464.15  package varargs.warn2;
   465.1 --- a/test/tools/javac/varargs/warning/Warn2.java	Thu Jun 11 10:54:31 2009 -0700
   465.2 +++ b/test/tools/javac/varargs/warning/Warn2.java	Thu Jun 11 21:35:12 2009 -0700
   465.3 @@ -27,7 +27,7 @@
   465.4   * @summary fixed-arity warning given too often
   465.5   * @author gafter
   465.6   *
   465.7 - * @compile -Werror -source 1.5 Warn2.java
   465.8 + * @compile -Werror  Warn2.java
   465.9   */
  465.10  
  465.11  package varargs.warning.warn2;
   466.1 --- a/test/tools/javac/varargs/warning/Warn3.java	Thu Jun 11 10:54:31 2009 -0700
   466.2 +++ b/test/tools/javac/varargs/warning/Warn3.java	Thu Jun 11 21:35:12 2009 -0700
   466.3 @@ -27,7 +27,7 @@
   466.4   * @summary fixed-arity warning given too often
   466.5   * @author gafter
   466.6   *
   466.7 - * @compile -Werror -source 1.5 Warn3.java
   466.8 + * @compile -Werror  Warn3.java
   466.9   */
  466.10  
  466.11  package varargs.warning.warn3;
   467.1 --- a/test/tools/javac/versions/check.sh	Thu Jun 11 10:54:31 2009 -0700
   467.2 +++ b/test/tools/javac/versions/check.sh	Thu Jun 11 21:35:12 2009 -0700
   467.3 @@ -24,9 +24,8 @@
   467.4  # @test
   467.5  # @bug 4981566 5028634 5094412 6304984
   467.6  # @summary Check interpretation of -target and -source options
   467.7 -#
   467.8  # @build CheckClassFileVersion
   467.9 -# @run shell check.sh
  467.10 +# @run shell check.sh 
  467.11  
  467.12  TESTJAVA=${TESTJAVA:?}
  467.13  TC=${TESTCLASSES-.}
  467.14 @@ -48,19 +47,26 @@
  467.15    $JC ${TESTTOOLVMOPTS} -d $TC $* $TC/X.java && $CFV $TC/X.class $V || exit 2
  467.16  }
  467.17  
  467.18 -check 50.0
  467.19  check 48.0 -source 1.4
  467.20 +
  467.21  check 49.0 -source 1.4 -target 1.5
  467.22 -check 49.0 -target 1.5
  467.23 -check 50.0 -source 1.5
  467.24 -check 50.0 -target 1.6
  467.25 -check 50.0 -target 6
  467.26 -check 50.0 -source 1.6
  467.27 -check 50.0 -source 6
  467.28 +check 49.0 -source 1.5 -target 1.5
  467.29 +
  467.30 +check 50.0 -source 1.4 -target 1.6
  467.31 +check 50.0 -source 1.5 -target 1.6
  467.32 +check 50.0 -source 1.6 -target 1.6
  467.33 +check 50.0 -source 1.6 -target 6
  467.34 +check 50.0 -source 6 -target 1.6
  467.35 +check 50.0 -source 6 -target 6
  467.36 +
  467.37 +check 51.0
  467.38 +check 51.0 -source 1.5
  467.39 +check 51.0 -source 1.6
  467.40 +check 51.0 -source 6
  467.41 +check 51.0 -source 1.7
  467.42 +check 51.0 -source 7
  467.43  check 51.0 -target 1.7
  467.44  check 51.0 -target 7
  467.45 -check 51.0 -source 1.7
  467.46 -check 51.0 -source 7
  467.47  
  467.48  
  467.49  # Check source versions
  467.50 @@ -85,21 +91,30 @@
  467.51    fi
  467.52  }
  467.53  
  467.54 +# the following need to be updated when -source 7 features are available
  467.55  checksrc14() { pass $* $TC/X.java; fail $* $TC/Y.java; }
  467.56  checksrc15() { pass $* $TC/X.java; pass $* $TC/Y.java; }
  467.57  checksrc16() { checksrc15 $* ; }
  467.58 +checksrc17() { checksrc15 $* ; }
  467.59  
  467.60  checksrc14 -source 1.4
  467.61  checksrc14 -source 1.4 -target 1.5
  467.62  
  467.63 -checksrc15
  467.64 -checksrc15 -target 1.5
  467.65  checksrc15 -source 1.5
  467.66 +checksrc15 -source 1.5 -target 1.5
  467.67  
  467.68 -checksrc16 -target 1.6
  467.69 -checksrc16 -target 6
  467.70  checksrc16 -source 1.6
  467.71  checksrc16 -source 6
  467.72 +checksrc16 -source 1.6 -target 1.6
  467.73 +checksrc16 -source 6 -target 6
  467.74 +
  467.75 +checksrc17
  467.76 +checksrc17 -target 1.7
  467.77 +checksrc17 -target 7
  467.78 +checksrc17 -source 1.7
  467.79 +checksrc17 -source 7
  467.80 +checksrc17 -source 1.7 -target 1.7
  467.81 +checksrc17 -source 7 -target 7
  467.82  
  467.83  fail -source 1.5 -target 1.4 $TC/X.java
  467.84  fail -source 1.6 -target 1.4 $TC/X.java
   468.1 --- a/test/tools/javadoc/LangVers.java	Thu Jun 11 10:54:31 2009 -0700
   468.2 +++ b/test/tools/javadoc/LangVers.java	Thu Jun 11 21:35:12 2009 -0700
   468.3 @@ -26,8 +26,6 @@
   468.4   * @bug 4909767
   468.5   * @summary Verify that omitting Doclet.languageVersion() hides 1.5 language
   468.6   *      features from the doclet.
   468.7 - * @compile -source 1.5 LangVers.java
   468.8 - * @run main LangVers
   468.9   */
  468.10  
  468.11  import java.util.List;
   469.1 --- a/test/tools/javadoc/annotations/annotateMethodsFields/Main.java	Thu Jun 11 10:54:31 2009 -0700
   469.2 +++ b/test/tools/javadoc/annotations/annotateMethodsFields/Main.java	Thu Jun 11 21:35:12 2009 -0700
   469.3 @@ -28,7 +28,7 @@
   469.4   *          annotation type elements.
   469.5   *          Test an annotation type with a type nested within.
   469.6   * @library ../../lib
   469.7 - * @compile -source 1.5 ../../lib/Tester.java Main.java
   469.8 + * @compile  ../../lib/Tester.java Main.java
   469.9   * @run main Main
  469.10   */
  469.11  
   470.1 --- a/test/tools/javadoc/annotations/annotatePackage/Main.java	Thu Jun 11 10:54:31 2009 -0700
   470.2 +++ b/test/tools/javadoc/annotations/annotatePackage/Main.java	Thu Jun 11 21:35:12 2009 -0700
   470.3 @@ -26,7 +26,7 @@
   470.4   * @bug 5031168
   470.5   * @summary Test package annotations and package-info.java package comments.
   470.6   * @library ../../lib
   470.7 - * @compile -source 1.5 ../../lib/Tester.java Main.java
   470.8 + * @compile  ../../lib/Tester.java Main.java
   470.9   * @run main Main
  470.10   */
  470.11  
   471.1 --- a/test/tools/javadoc/annotations/annotateParams/Main.java	Thu Jun 11 10:54:31 2009 -0700
   471.2 +++ b/test/tools/javadoc/annotations/annotateParams/Main.java	Thu Jun 11 21:35:12 2009 -0700
   471.3 @@ -26,7 +26,7 @@
   471.4   * @bug 5031171
   471.5   * @summary Test parameter annotations.
   471.6   * @library ../../lib
   471.7 - * @compile -source 1.5 ../../lib/Tester.java Main.java
   471.8 + * @compile  ../../lib/Tester.java Main.java
   471.9   * @run main Main
  471.10   */
  471.11  
   472.1 --- a/test/tools/javadoc/annotations/defaults/Main.java	Thu Jun 11 10:54:31 2009 -0700
   472.2 +++ b/test/tools/javadoc/annotations/defaults/Main.java	Thu Jun 11 21:35:12 2009 -0700
   472.3 @@ -27,7 +27,7 @@
   472.4   * @summary Test an annotation type with default element values, and
   472.5   *          annotations that use them.
   472.6   * @library ../../lib
   472.7 - * @compile -source 1.5 ../../lib/Tester.java Main.java
   472.8 + * @compile  ../../lib/Tester.java Main.java
   472.9   * @run main Main
  472.10   */
  472.11  
   473.1 --- a/test/tools/javadoc/annotations/elementTypes/Main.java	Thu Jun 11 10:54:31 2009 -0700
   473.2 +++ b/test/tools/javadoc/annotations/elementTypes/Main.java	Thu Jun 11 21:35:12 2009 -0700
   473.3 @@ -27,7 +27,7 @@
   473.4   * @summary Test an annotation type and annotations with elements of various
   473.5   *          types.
   473.6   * @library ../../lib
   473.7 - * @compile -source 1.5 ../../lib/Tester.java Main.java
   473.8 + * @compile  ../../lib/Tester.java Main.java
   473.9   * @run main Main
  473.10   */
  473.11  
   474.1 --- a/test/tools/javadoc/annotations/shortcuts/Main.java	Thu Jun 11 10:54:31 2009 -0700
   474.2 +++ b/test/tools/javadoc/annotations/shortcuts/Main.java	Thu Jun 11 21:35:12 2009 -0700
   474.3 @@ -26,7 +26,7 @@
   474.4   * @bug 4904495
   474.5   * @summary Verify that "shortcuts" are used when printing annotations.
   474.6   * @library ../../lib
   474.7 - * @compile -source 1.5 ../../lib/Tester.java Main.java
   474.8 + * @compile  ../../lib/Tester.java Main.java
   474.9   * @run main Main
  474.10   */
  474.11  
   475.1 --- a/test/tools/javadoc/enum/docComments/Main.java	Thu Jun 11 10:54:31 2009 -0700
   475.2 +++ b/test/tools/javadoc/enum/docComments/Main.java	Thu Jun 11 21:35:12 2009 -0700
   475.3 @@ -26,7 +26,7 @@
   475.4   * @bug 4421066
   475.5   * @summary Verify the comments in an enum type.
   475.6   * @library ../../lib
   475.7 - * @compile -source 1.5 ../../lib/Tester.java Main.java
   475.8 + * @compile  ../../lib/Tester.java Main.java
   475.9   * @run main Main
  475.10   */
  475.11  
   476.1 --- a/test/tools/javadoc/enum/enumType/Main.java	Thu Jun 11 10:54:31 2009 -0700
   476.2 +++ b/test/tools/javadoc/enum/enumType/Main.java	Thu Jun 11 21:35:12 2009 -0700
   476.3 @@ -26,7 +26,7 @@
   476.4   * @bug 4421066
   476.5   * @summary Verify the contents of an enum type.
   476.6   * @library ../../lib
   476.7 - * @compile -source 1.5 ../../lib/Tester.java Main.java
   476.8 + * @compile  ../../lib/Tester.java Main.java
   476.9   * @run main Main
  476.10   */
  476.11  
   477.1 --- a/test/tools/javadoc/generics/genericClass/Main.java	Thu Jun 11 10:54:31 2009 -0700
   477.2 +++ b/test/tools/javadoc/generics/genericClass/Main.java	Thu Jun 11 21:35:12 2009 -0700
   477.3 @@ -26,7 +26,7 @@
   477.4   * @bug 4421066
   477.5   * @summary Verify the contents of the ClassDoc of a generic class.
   477.6   * @library ../../lib
   477.7 - * @compile -source 1.5 ../../lib/Tester.java Main.java
   477.8 + * @compile  ../../lib/Tester.java Main.java
   477.9   * @run main Main
  477.10   */
  477.11  
   478.1 --- a/test/tools/javadoc/generics/genericInnerAndOuter/Main.java	Thu Jun 11 10:54:31 2009 -0700
   478.2 +++ b/test/tools/javadoc/generics/genericInnerAndOuter/Main.java	Thu Jun 11 21:35:12 2009 -0700
   478.3 @@ -27,7 +27,7 @@
   478.4   * @summary Verify the contents of the ClassDoc of
   478.5   *          a generic class with a generic inner class.
   478.6   * @library ../../lib
   478.7 - * @compile -source 1.5 ../../lib/Tester.java Main.java
   478.8 + * @compile  ../../lib/Tester.java Main.java
   478.9   * @run main Main
  478.10   */
  478.11  
   479.1 --- a/test/tools/javadoc/generics/genericInterface/Main.java	Thu Jun 11 10:54:31 2009 -0700
   479.2 +++ b/test/tools/javadoc/generics/genericInterface/Main.java	Thu Jun 11 21:35:12 2009 -0700
   479.3 @@ -26,7 +26,7 @@
   479.4   * @bug 4421066
   479.5   * @summary Verify the contents of the ClassDoc of a generic interface.
   479.6   * @library ../../lib
   479.7 - * @compile -source 1.5 ../../lib/Tester.java Main.java
   479.8 + * @compile  ../../lib/Tester.java Main.java
   479.9   * @run main Main
  479.10   */
  479.11  
   480.1 --- a/test/tools/javadoc/generics/genericMethod/Main.java	Thu Jun 11 10:54:31 2009 -0700
   480.2 +++ b/test/tools/javadoc/generics/genericMethod/Main.java	Thu Jun 11 21:35:12 2009 -0700
   480.3 @@ -26,7 +26,7 @@
   480.4   * @bug 4421066
   480.5   * @summary Verify the reading of generic methods and constructors.
   480.6   * @library ../../lib
   480.7 - * @compile -source 1.5 ../../lib/Tester.java Main.java
   480.8 + * @compile  ../../lib/Tester.java Main.java
   480.9   * @run main Main
  480.10   */
  480.11  
   481.1 --- a/test/tools/javadoc/generics/genericSuper/Main.java	Thu Jun 11 10:54:31 2009 -0700
   481.2 +++ b/test/tools/javadoc/generics/genericSuper/Main.java	Thu Jun 11 21:35:12 2009 -0700
   481.3 @@ -26,7 +26,7 @@
   481.4   * @bug 4421066
   481.5   * @summary Verify the contents of the ClassDoc of a generic class.
   481.6   * @library ../../lib
   481.7 - * @compile -source 1.5 ../../lib/Tester.java Main.java
   481.8 + * @compile  ../../lib/Tester.java Main.java
   481.9   * @run main Main
  481.10   */
  481.11  
   482.1 --- a/test/tools/javadoc/generics/supertypes/Main.java	Thu Jun 11 10:54:31 2009 -0700
   482.2 +++ b/test/tools/javadoc/generics/supertypes/Main.java	Thu Jun 11 21:35:12 2009 -0700
   482.3 @@ -26,7 +26,7 @@
   482.4   * @bug 4922918
   482.5   * @summary Check supertypes and superinterfaces of parameterized types.
   482.6   * @library ../../lib
   482.7 - * @compile -source 1.5 ../../lib/Tester.java Main.java
   482.8 + * @compile  ../../lib/Tester.java Main.java
   482.9   * @run main Main
  482.10   */
  482.11  
   483.1 --- a/test/tools/javadoc/generics/throwsGeneric/Main.java	Thu Jun 11 10:54:31 2009 -0700
   483.2 +++ b/test/tools/javadoc/generics/throwsGeneric/Main.java	Thu Jun 11 21:35:12 2009 -0700
   483.3 @@ -26,7 +26,7 @@
   483.4   * @bug 4421066
   483.5   * @summary Verify the reading of generic methods and constructors.
   483.6   * @library ../../lib
   483.7 - * @compile -source 1.5 ../../lib/Tester.java Main.java
   483.8 + * @compile  ../../lib/Tester.java Main.java
   483.9   * @run main Main
  483.10   */
  483.11  
   484.1 --- a/test/tools/javadoc/generics/tparamCycle/Main.java	Thu Jun 11 10:54:31 2009 -0700
   484.2 +++ b/test/tools/javadoc/generics/tparamCycle/Main.java	Thu Jun 11 21:35:12 2009 -0700
   484.3 @@ -26,7 +26,7 @@
   484.4   * @bug 4421066
   484.5   * @summary Check a type parameter whose bound cycles back on itself.
   484.6   * @library ../../lib
   484.7 - * @compile -source 1.5 ../../lib/Tester.java Main.java
   484.8 + * @compile  ../../lib/Tester.java Main.java
   484.9   * @run main Main
  484.10   */
  484.11  
   485.1 --- a/test/tools/javadoc/generics/tparamTagOnMethod/Main.java	Thu Jun 11 10:54:31 2009 -0700
   485.2 +++ b/test/tools/javadoc/generics/tparamTagOnMethod/Main.java	Thu Jun 11 21:35:12 2009 -0700
   485.3 @@ -26,7 +26,7 @@
   485.4   * @bug 4421066
   485.5   * @summary Verify the reading of type parameter tags on methods.
   485.6   * @library ../../lib
   485.7 - * @compile -source 1.5 ../../lib/Tester.java Main.java
   485.8 + * @compile  ../../lib/Tester.java Main.java
   485.9   * @run main Main
  485.10   */
  485.11  
   486.1 --- a/test/tools/javadoc/generics/tparamTagOnType/Main.java	Thu Jun 11 10:54:31 2009 -0700
   486.2 +++ b/test/tools/javadoc/generics/tparamTagOnType/Main.java	Thu Jun 11 21:35:12 2009 -0700
   486.3 @@ -26,7 +26,7 @@
   486.4   * @bug 4421066
   486.5   * @summary Verify the reading of a type parameter tag on an interface.
   486.6   * @library ../../lib
   486.7 - * @compile -source 1.5 ../../lib/Tester.java Main.java
   486.8 + * @compile  ../../lib/Tester.java Main.java
   486.9   * @run main Main
  486.10   */
  486.11  
   487.1 --- a/test/tools/javadoc/generics/wildcards/Main.java	Thu Jun 11 10:54:31 2009 -0700
   487.2 +++ b/test/tools/javadoc/generics/wildcards/Main.java	Thu Jun 11 21:35:12 2009 -0700
   487.3 @@ -26,7 +26,7 @@
   487.4   * @bug 4421066
   487.5   * @summary Verify the contents of the ClassDoc of a generic class.
   487.6   * @library ../../lib
   487.7 - * @compile -source 1.5 ../../lib/Tester.java Main.java
   487.8 + * @compile  ../../lib/Tester.java Main.java
   487.9   * @run main Main
  487.10   */
  487.11  
   488.1 --- a/test/tools/javadoc/lib/Tester.java	Thu Jun 11 10:54:31 2009 -0700
   488.2 +++ b/test/tools/javadoc/lib/Tester.java	Thu Jun 11 21:35:12 2009 -0700
   488.3 @@ -39,7 +39,6 @@
   488.4      protected final String TEST_CLASSES = System.getProperty("test.classes",
   488.5                                                               ".");
   488.6      private final String DEFAULT_ARGS[] = {
   488.7 -        "-source", "1.5",
   488.8          "-sourcepath", TEST_SRC,
   488.9      };
  488.10  
   489.1 --- a/test/tools/javadoc/varArgs/Main.java	Thu Jun 11 10:54:31 2009 -0700
   489.2 +++ b/test/tools/javadoc/varArgs/Main.java	Thu Jun 11 21:35:12 2009 -0700
   489.3 @@ -27,7 +27,7 @@
   489.4   * @summary Verify the contents of a ClassDoc containing a varArgs method.
   489.5   *          Verify that see/link tags can use "..." notation.
   489.6   * @library ../lib
   489.7 - * @compile -source 1.5 ../lib/Tester.java Main.java
   489.8 + * @compile  ../lib/Tester.java Main.java
   489.9   * @run main Main
  489.10   */
  489.11  
   490.1 --- a/test/tools/javap/ExtPath.java	Thu Jun 11 10:54:31 2009 -0700
   490.2 +++ b/test/tools/javap/ExtPath.java	Thu Jun 11 21:35:12 2009 -0700
   490.3 @@ -30,11 +30,12 @@
   490.4   * @run main/othervm ExtPath com.sun.crypto.provider.SunJCE
   490.5   */
   490.6  
   490.7 -import sun.tools.javap.Main;
   490.8 +import com.sun.tools.javap.Main;
   490.9  import java.io.*;
  490.10  
  490.11  public class ExtPath {
  490.12      public static void main(String[] args) {
  490.13 -        Main.entry(args);
  490.14 +        PrintWriter pw = new PrintWriter(System.out, true);
  490.15 +        Main.run(args, pw);
  490.16      }
  490.17  }
   491.1 --- a/test/tools/javap/ListTest.java	Thu Jun 11 10:54:31 2009 -0700
   491.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   491.3 @@ -1,152 +0,0 @@
   491.4 -/*
   491.5 - * Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
   491.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   491.7 - *
   491.8 - * This code is free software; you can redistribute it and/or modify it
   491.9 - * under the terms of the GNU General Public License version 2 only, as
  491.10 - * published by the Free Software Foundation.
  491.11 - *
  491.12 - * This code is distributed in the hope that it will be useful, but WITHOUT
  491.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  491.14 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  491.15 - * version 2 for more details (a copy is included in the LICENSE file that
  491.16 - * accompanied this code).
  491.17 - *
  491.18 - * You should have received a copy of the GNU General Public License version
  491.19 - * 2 along with this work; if not, write to the Free Software Foundation,
  491.20 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  491.21 - *
  491.22 - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  491.23 - * CA 95054 USA or visit www.sun.com if you need additional information or
  491.24 - * have any questions.
  491.25 - */
  491.26 -
  491.27 -import java.io.*;
  491.28 -import java.util.*;
  491.29 -import javax.tools.*;
  491.30 -
  491.31 -/*
  491.32 - * @test
  491.33 - * @bug 6439940
  491.34 - * @summary Cleanup javap implementation
  491.35 - * @run main/othervm ListTest
  491.36 - */
  491.37 -public class ListTest {
  491.38 -    public static void main(String[] args) throws Exception {
  491.39 -        new ListTest().run();
  491.40 -    }
  491.41 -
  491.42 -    ListTest() {
  491.43 -        String v = System.getProperty("view.cmd");
  491.44 -        //      v = "/opt/teamware/7.7/bin/filemerge -r";
  491.45 -        if (v != null) {
  491.46 -            viewResults = true;
  491.47 -            viewCmd = Arrays.asList(v.split(" +"));
  491.48 -        }
  491.49 -    }
  491.50 -
  491.51 -    void run() throws Exception {
  491.52 -        StandardLocation[] locs = new StandardLocation[] {
  491.53 -            StandardLocation.PLATFORM_CLASS_PATH,
  491.54 -            StandardLocation.CLASS_PATH,
  491.55 -        };
  491.56 -
  491.57 -        int count = 0;
  491.58 -        int pass = 0;
  491.59 -        for (StandardLocation loc: locs) {
  491.60 -            for (String testClassName: list(loc)) {
  491.61 -                count++;
  491.62 -                if (test(testClassName))
  491.63 -                    pass++;
  491.64 -            }
  491.65 -        }
  491.66 -
  491.67 -        if (pass < count)
  491.68 -            throw new Error(pass + "/" + count + " test cases passed");
  491.69 -    }
  491.70 -
  491.71 -    Iterable<String> list(StandardLocation loc) throws IOException {
  491.72 -        JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
  491.73 -        StandardJavaFileManager sfm = compiler.getStandardFileManager(null, null, null);
  491.74 -        Set<JavaFileObject.Kind> kinds = Collections.singleton(JavaFileObject.Kind.CLASS);
  491.75 -
  491.76 -        List<String> list = new ArrayList<String>();
  491.77 -        for (JavaFileObject fo: sfm.list(loc, testPackage, kinds, true)) {
  491.78 -            //System.err.println(com.sun.tools.javac.util.Old199.getPath(fo));
  491.79 -            list.add(sfm.inferBinaryName(loc, fo));
  491.80 -        }
  491.81 -        return list;
  491.82 -    }
  491.83 -
  491.84 -    boolean test(String testClassName) throws Exception {
  491.85 -        String[] args = new String[options.size() + 1];
  491.86 -        options.toArray(args);
  491.87 -        args[args.length - 1] = testClassName;
  491.88 -        byte[] oldOut = runOldJavap(args);
  491.89 -        byte[] newOut = runNewJavap(args);
  491.90 -        boolean ok = equal(oldOut, newOut);
  491.91 -        System.err.println((ok ? "pass" : "FAIL") + ": " + testClassName);
  491.92 -        if (!ok && viewResults)
  491.93 -            view(oldOut, newOut);
  491.94 -        return ok;
  491.95 -    }
  491.96 -
  491.97 -    byte[] runOldJavap(String[] args) {
  491.98 -        //System.err.println("OLD: " + Arrays.asList(args));
  491.99 -        PrintStream oldOut = System.out;
 491.100 -        ByteArrayOutputStream out = new ByteArrayOutputStream();
 491.101 -        System.setOut(new PrintStream(out));
 491.102 -        try {
 491.103 -            sun.tools.javap.Main.entry(args);
 491.104 -        } finally {
 491.105 -            System.setOut(oldOut);
 491.106 -        }
 491.107 -        return out.toByteArray();
 491.108 -    }
 491.109 -
 491.110 -    byte[] runNewJavap(String[] args) {
 491.111 -        String[] nArgs = new String[args.length + 2];
 491.112 -        nArgs[0] = "-XDcompat";
 491.113 -        nArgs[1] = "-XDignore.symbol.file";
 491.114 -        System.arraycopy(args, 0, nArgs, 2, args.length);
 491.115 -        //System.err.println("NEW: " + Arrays.asList(nArgs));
 491.116 -        ByteArrayOutputStream out = new ByteArrayOutputStream();
 491.117 -        com.sun.tools.javap.Main.run(nArgs,
 491.118 -                                     new PrintWriter(new OutputStreamWriter(out), true));
 491.119 -        return out.toByteArray();
 491.120 -    }
 491.121 -
 491.122 -    File write(byte[] text, String suffix) throws IOException {
 491.123 -        File f = new File("ListTest." + suffix);
 491.124 -        FileOutputStream out = new FileOutputStream(f);
 491.125 -        out.write(text);
 491.126 -        out.close();
 491.127 -        return f;
 491.128 -    }
 491.129 -
 491.130 -    boolean equal(byte[] a1, byte[] a2) {
 491.131 -        return Arrays.equals(a1, a2);
 491.132 -    }
 491.133 -
 491.134 -    void view(byte[] oldOut, byte[] newOut) throws Exception {
 491.135 -        File oldFile = write(oldOut, "old");
 491.136 -        File newFile = write(newOut, "new");
 491.137 -        List<String> cmd = new ArrayList<String>();
 491.138 -        cmd.addAll(viewCmd);
 491.139 -        cmd.add(oldFile.getPath());
 491.140 -        cmd.add(newFile.getPath());
 491.141 -        Process p = new ProcessBuilder(cmd).redirectErrorStream(true).start();
 491.142 -        p.getOutputStream().close();
 491.143 -        String line;
 491.144 -        BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
 491.145 -        while ((line = in.readLine()) != null)
 491.146 -            System.err.println(line);
 491.147 -        in.close();
 491.148 -        p.waitFor();
 491.149 -    }
 491.150 -
 491.151 -    String testPackage = "java.lang";
 491.152 -    List<String> options = Arrays.asList("-v");
 491.153 -    boolean viewResults;
 491.154 -    List<String> viewCmd;
 491.155 -}
   492.1 --- a/test/tools/javap/OptionTest.java	Thu Jun 11 10:54:31 2009 -0700
   492.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   492.3 @@ -1,143 +0,0 @@
   492.4 -/*
   492.5 - * Copyright 2007-2008 Sun Microsystems, Inc.  All Rights Reserved.
   492.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   492.7 - *
   492.8 - * This code is free software; you can redistribute it and/or modify it
   492.9 - * under the terms of the GNU General Public License version 2 only, as
  492.10 - * published by the Free Software Foundation.
  492.11 - *
  492.12 - * This code is distributed in the hope that it will be useful, but WITHOUT
  492.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  492.14 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  492.15 - * version 2 for more details (a copy is included in the LICENSE file that
  492.16 - * accompanied this code).
  492.17 - *
  492.18 - * You should have received a copy of the GNU General Public License version
  492.19 - * 2 along with this work; if not, write to the Free Software Foundation,
  492.20 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  492.21 - *
  492.22 - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  492.23 - * CA 95054 USA or visit www.sun.com if you need additional information or
  492.24 - * have any questions.
  492.25 - */
  492.26 -
  492.27 -import java.io.*;
  492.28 -import java.util.*;
  492.29 -
  492.30 -/*
  492.31 - * @test
  492.32 - * @bug 6439940
  492.33 - * @summary Cleanup javap implementation
  492.34 - * @run main/othervm OptionTest
  492.35 - */
  492.36 -public class OptionTest {
  492.37 -    public static void main(String[] args) throws Exception {
  492.38 -        new OptionTest().run();
  492.39 -    }
  492.40 -
  492.41 -    OptionTest() {
  492.42 -        String v = System.getProperty("view.cmd");
  492.43 -        if (v != null) {
  492.44 -            viewResults = true;
  492.45 -            viewCmd = Arrays.asList(v.split(" +"));
  492.46 -        }
  492.47 -    }
  492.48 -
  492.49 -
  492.50 -    void run() throws Exception {
  492.51 -        int count = 0;
  492.52 -        int pass = 0;
  492.53 -        // try combinations of options and compare old javap against new javap
  492.54 -        for (int i = 0; i < (1<<8); i++) {
  492.55 -            List<String> options = new ArrayList<String>();
  492.56 -            if ((i & 0x01) != 0)
  492.57 -                options.add("-c");
  492.58 -            if ((i & 0x02) != 0)
  492.59 -                options.add("-l");
  492.60 -            if ((i & 0x04) != 0)
  492.61 -                options.add("-public");
  492.62 -            if ((i & 0x08) != 0)
  492.63 -                options.add("-protected");
  492.64 -            if ((i & 0x10) != 0)
  492.65 -                options.add("-package");
  492.66 -            if ((i & 0x20) != 0)
  492.67 -                options.add("-private");
  492.68 -            if ((i & 0x40) != 0)
  492.69 -                options.add("-s");
  492.70 -            if ((i & 0x80) != 0)
  492.71 -                options.add("-verbose");
  492.72 -            count++;
  492.73 -            if (test(options))
  492.74 -                pass++;
  492.75 -        }
  492.76 -
  492.77 -        if (pass < count)
  492.78 -            throw new Error(pass + "/" + count + " test cases passed");
  492.79 -    }
  492.80 -
  492.81 -    boolean test(List<String> options) throws Exception {
  492.82 -        String[] args = new String[options.size() + 1];
  492.83 -        options.toArray(args);
  492.84 -        args[args.length - 1] = testClassName;
  492.85 -        String oldOut = runOldJavap(args);
  492.86 -        String newOut = runNewJavap(args);
  492.87 -        boolean ok = oldOut.equals(newOut);
  492.88 -        System.err.println((ok ? "pass" : "FAIL") + ": " + options);
  492.89 -        if (!ok && viewResults)
  492.90 -            view(oldOut, newOut);
  492.91 -        return ok;
  492.92 -    }
  492.93 -
  492.94 -    String runOldJavap(String[] args) {
  492.95 -        //System.err.println("OLD: " + Arrays.asList(args));
  492.96 -        PrintStream oldOut = System.out;
  492.97 -        ByteArrayOutputStream out = new ByteArrayOutputStream();
  492.98 -        System.setOut(new PrintStream(out));
  492.99 -        try {
 492.100 -            sun.tools.javap.Main.entry(args);
 492.101 -        } finally {
 492.102 -            System.setOut(oldOut);
 492.103 -        }
 492.104 -        return out.toString();
 492.105 -    }
 492.106 -
 492.107 -    String runNewJavap(String[] args) {
 492.108 -        String[] nArgs = new String[args.length + 2];
 492.109 -        nArgs[0] = "-XDcompat";
 492.110 -        nArgs[1] = "-XDignore.symbol.file";
 492.111 -        System.arraycopy(args, 0, nArgs, 2, args.length);
 492.112 -        //System.err.println("NEW: " + Arrays.asList(nArgs));
 492.113 -        StringWriter out = new StringWriter();
 492.114 -        com.sun.tools.javap.Main.run(nArgs, new PrintWriter(out, true));
 492.115 -        return out.toString();
 492.116 -    }
 492.117 -
 492.118 -    File write(String text, String suffix) throws IOException {
 492.119 -        File f = File.createTempFile("OptionTest", suffix);
 492.120 -        FileWriter out = new FileWriter(f);
 492.121 -        out.write(text);
 492.122 -        out.close();
 492.123 -        return f;
 492.124 -    }
 492.125 -
 492.126 -    void view(String oldOut, String newOut) throws Exception {
 492.127 -        File oldFile = write(oldOut, "old");
 492.128 -        File newFile = write(newOut, "new");
 492.129 -        List<String> cmd = new ArrayList<String>();
 492.130 -        cmd.addAll(viewCmd);
 492.131 -        cmd.add(oldFile.getPath());
 492.132 -        cmd.add(newFile.getPath());
 492.133 -        Process p = new ProcessBuilder(cmd).redirectErrorStream(true).start();
 492.134 -        p.getOutputStream().close();
 492.135 -        String line;
 492.136 -        BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
 492.137 -        while ((line = in.readLine()) != null)
 492.138 -            System.err.println(line);
 492.139 -        in.close();
 492.140 -        p.waitFor();
 492.141 -    }
 492.142 -
 492.143 -    String testClassName = "java.lang.SecurityManager";
 492.144 -    boolean viewResults;
 492.145 -    List<String> viewCmd;
 492.146 -}
   493.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   493.2 +++ b/test/tools/javap/T6824493.java	Thu Jun 11 21:35:12 2009 -0700
   493.3 @@ -0,0 +1,116 @@
   493.4 +/*
   493.5 + * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
   493.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   493.7 + *
   493.8 + * This code is free software; you can redistribute it and/or modify it
   493.9 + * under the terms of the GNU General Public License version 2 only, as
  493.10 + * published by the Free Software Foundation.
  493.11 + *
  493.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
  493.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  493.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  493.15 + * version 2 for more details (a copy is included in the LICENSE file that
  493.16 + * accompanied this code).
  493.17 + *
  493.18 + * You should have received a copy of the GNU General Public License version
  493.19 + * 2 along with this work; if not, write to the Free Software Foundation,
  493.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  493.21 + *
  493.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  493.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
  493.24 + * have any questions.
  493.25 + */
  493.26 +
  493.27 +import java.io.*;
  493.28 +import java.util.*;
  493.29 +
  493.30 +/*
  493.31 + * @test
  493.32 + * @bug 6824493
  493.33 + * @summary experimental support for additional info for instructions
  493.34 + * @compile -g T6824493.java
  493.35 + * @run main T6824493
  493.36 + */
  493.37 +public class T6824493 {
  493.38 +    public static void main(String... args) {
  493.39 +        new T6824493().run();
  493.40 +    }
  493.41 +
  493.42 +    void run() {
  493.43 +        // for each of the options, we run javap and check for some
  493.44 +        // marker strings in the output that generally indicate the
  493.45 +        // presence of the expected output, without being as specific
  493.46 +        // as a full golden file test.
  493.47 +        test("-XDdetails:source",
  493.48 +            "for (int i = 0; i < 10; i++) {",
  493.49 +            "System.out.println(s + i);");
  493.50 +
  493.51 +        test("-XDdetails:tryBlocks",
  493.52 +                "try[0]",
  493.53 +                "end try[0]",
  493.54 +                "catch[0]");
  493.55 +
  493.56 +        test("-XDdetails:stackMaps",
  493.57 +                "StackMap locals:  this java/lang/String int",
  493.58 +                "StackMap stack:  java/lang/Throwable");
  493.59 +
  493.60 +        test("-XDdetails:localVariables",
  493.61 +                "start local 3 // java.util.List list",
  493.62 +                "end local 3 // java.util.List list");
  493.63 +
  493.64 +        test("-XDdetails:localVariableTypes",
  493.65 +                "start generic local 3 // java.util.List<java.lang.String> list",
  493.66 +                "end generic local 3 // java.util.List<java.lang.String> list");
  493.67 +
  493.68 +        if (errors > 0)
  493.69 +            throw new Error(errors + " errors found");
  493.70 +    }
  493.71 +
  493.72 +    void test(String option, String... expect) {
  493.73 +        String[] args = {
  493.74 +            "-c",
  493.75 +            "-classpath",
  493.76 +            testSrc + File.pathSeparator + testClasses,
  493.77 +            option,
  493.78 +            "Test"
  493.79 +        };
  493.80 +        StringWriter sw = new StringWriter();
  493.81 +        PrintWriter pw = new PrintWriter(sw);
  493.82 +        int rc = com.sun.tools.javap.Main.run(args, pw);
  493.83 +        if (rc != 0) {
  493.84 +            error("unexpected return code from javap: " + rc);
  493.85 +            return;
  493.86 +        }
  493.87 +
  493.88 +        String out = sw.toString();
  493.89 +        System.out.println(out);
  493.90 +        for (String e: expect) {
  493.91 +            if (!out.contains(e))
  493.92 +                error("Not found: " + e);
  493.93 +        }
  493.94 +    }
  493.95 +
  493.96 +    void error(String msg) {
  493.97 +        System.err.println("Error: " + msg);
  493.98 +        errors++;
  493.99 +    }
 493.100 +
 493.101 +    private int errors;
 493.102 +    private String testSrc = System.getProperty("test.src", ".");
 493.103 +    private String testClasses = System.getProperty("test.classes", ".");
 493.104 +}
 493.105 +
 493.106 +class Test {
 493.107 +    void m(String s) {
 493.108 +        for (int i = 0; i < 10; i++) {
 493.109 +            try {
 493.110 +                List<String> list = null;
 493.111 +                System.out.println(s + i);
 493.112 +            } catch (NullPointerException e) {
 493.113 +                System.out.println("catch NPE");
 493.114 +            } finally {
 493.115 +                System.out.println("finally");
 493.116 +            }
 493.117 +        }
 493.118 +    }
 493.119 +}

mercurial