6929544: langtools source code uses statics qualified by instance variables
authorjjg
Thu, 25 Feb 2010 12:26:39 -0800
changeset 5004 6c2694dc2da0
parent 5003 fd0b30cdbe5c
child 5005 b9ecef751d2c
6929544: langtools source code uses statics qualified by instance variables Reviewed-by: darcy
langtools/make/build.properties
langtools/src/share/classes/com/sun/tools/apt/main/CommandLine.java
langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeMirrorImpl.java
langtools/src/share/classes/com/sun/tools/doclets/standard/Standard.java
langtools/src/share/classes/com/sun/tools/javac/Launcher.java
langtools/src/share/classes/com/sun/tools/javac/api/JavacTool.java
langtools/src/share/classes/com/sun/tools/javac/code/Types.java
langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java
langtools/src/share/classes/com/sun/tools/javac/jvm/Items.java
langtools/src/share/classes/com/sun/tools/javac/main/CommandLine.java
langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java
--- a/langtools/make/build.properties	Thu Feb 25 11:04:11 2010 -0800
+++ b/langtools/make/build.properties	Thu Feb 25 12:26:39 2010 -0800
@@ -68,7 +68,7 @@
 # set the following to -version to verify the versions of javac being used
 javac.version.opt =
 # in time, there should be no exceptions to -Xlint:all
-javac.lint.opts = -Xlint:all,-deprecation,-static -Werror
+javac.lint.opts = -Xlint:all,-deprecation -Werror
 
 # options for the <javadoc> task for javac
 javadoc.jls3.url=http://java.sun.com/docs/books/jls/
--- a/langtools/src/share/classes/com/sun/tools/apt/main/CommandLine.java	Thu Feb 25 11:04:11 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/apt/main/CommandLine.java	Thu Feb 25 12:26:39 2010 -0800
@@ -82,7 +82,7 @@
         st.commentChar('#');
         st.quoteChar('"');
         st.quoteChar('\'');
-        while (st.nextToken() != st.TT_EOF) {
+        while (st.nextToken() != StreamTokenizer.TT_EOF) {
             args.append(st.sval);
         }
         r.close();
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeMirrorImpl.java	Thu Feb 25 11:04:11 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeMirrorImpl.java	Thu Feb 25 12:26:39 2010 -0800
@@ -71,6 +71,6 @@
      * {@inheritDoc}
      */
     public int hashCode() {
-        return env.jctypes.hashCode(type);
+        return Types.hashCode(type);
     }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/standard/Standard.java	Thu Feb 25 11:04:11 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/standard/Standard.java	Thu Feb 25 12:26:39 2010 -0800
@@ -31,23 +31,21 @@
 
 public class Standard {
 
-    public static final HtmlDoclet htmlDoclet = new HtmlDoclet();
-
     public static int optionLength(String option) {
-        return htmlDoclet.optionLength(option);
+        return HtmlDoclet.optionLength(option);
     }
 
     public static boolean start(RootDoc root) {
-        return htmlDoclet.start(root);
+        return HtmlDoclet.start(root);
     }
 
     public static boolean validOptions(String[][] options,
                                    DocErrorReporter reporter) {
-        return htmlDoclet.validOptions(options, reporter);
+        return HtmlDoclet.validOptions(options, reporter);
     }
 
     public static LanguageVersion languageVersion() {
-        return htmlDoclet.languageVersion();
+        return HtmlDoclet.languageVersion();
     }
 
 }
--- a/langtools/src/share/classes/com/sun/tools/javac/Launcher.java	Thu Feb 25 11:04:11 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/Launcher.java	Thu Feb 25 12:26:39 2010 -0800
@@ -64,7 +64,7 @@
                 fileChooser.setSelectedFile(new File(fileName));
             }
         }
-        if (fileChooser.showOpenDialog(null) == fileChooser.APPROVE_OPTION) {
+        if (fileChooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
             String fileName = fileChooser.getSelectedFile().getPath();
             prefs.put("recent.file", fileName);
             javac.run(System.in, null, null, "-d", "/tmp", fileName);
--- a/langtools/src/share/classes/com/sun/tools/javac/api/JavacTool.java	Thu Feb 25 11:04:11 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/api/JavacTool.java	Thu Feb 25 12:26:39 2010 -0800
@@ -137,7 +137,7 @@
     }
 
     private static boolean match(OptionKind clientKind, OptionKind optionKind) {
-        return (clientKind == (optionKind == OptionKind.HIDDEN ? optionKind.EXTENDED : optionKind));
+        return (clientKind == (optionKind == OptionKind.HIDDEN ? OptionKind.EXTENDED : optionKind));
     }
 
     public JavacFileManager getStandardFileManager(
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Types.java	Thu Feb 25 11:04:11 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Types.java	Thu Feb 25 12:26:39 2010 -0800
@@ -2504,7 +2504,7 @@
             }
             @Override
             public int hashCode() {
-                return 127 * Types.this.hashCode(t1) + Types.this.hashCode(t2);
+                return 127 * Types.hashCode(t1) + Types.hashCode(t2);
             }
             @Override
             public boolean equals(Object obj) {
@@ -3375,7 +3375,7 @@
             this.t = t;
         }
         public int hashCode() {
-            return Types.this.hashCode(t);
+            return Types.hashCode(t);
         }
         public boolean equals(Object obj) {
             return (obj instanceof SingletonType) &&
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Thu Feb 25 11:04:11 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Thu Feb 25 12:26:39 2010 -0800
@@ -808,8 +808,8 @@
             code.resolve(secondJumps);
             CondItem second = genCond(tree.falsepart, CRT_FLOW_TARGET);
             CondItem result = items.makeCondItem(second.opcode,
-                                      code.mergeChains(trueJumps, second.trueJumps),
-                                      code.mergeChains(falseJumps, second.falseJumps));
+                                      Code.mergeChains(trueJumps, second.trueJumps),
+                                      Code.mergeChains(falseJumps, second.falseJumps));
             if (markBranches) result.tree = tree.falsepart;
             return result;
         } else {
@@ -1322,7 +1322,7 @@
                 if (useJsrLocally) {
                     if (tree.finalizer != null) {
                         Code.State jsrState = code.state.dup();
-                        jsrState.push(code.jsrReturnValue);
+                        jsrState.push(Code.jsrReturnValue);
                         tryEnv.info.cont =
                             new Chain(code.emitJump(jsr),
                                       tryEnv.info.cont,
@@ -1375,7 +1375,7 @@
                 genFinalizer(env);
                 if (hasFinalizer || l.tail.nonEmpty()) {
                     code.statBegin(TreeInfo.endPos(env.tree));
-                    exitChain = code.mergeChains(exitChain,
+                    exitChain = Code.mergeChains(exitChain,
                                                  code.branch(goto_));
                 }
                 endFinalizerGap(env);
@@ -1963,7 +1963,7 @@
                 result = items.
                     makeCondItem(rcond.opcode,
                                  rcond.trueJumps,
-                                 code.mergeChains(falseJumps,
+                                 Code.mergeChains(falseJumps,
                                                   rcond.falseJumps));
             } else {
                 result = lcond;
@@ -1976,7 +1976,7 @@
                 CondItem rcond = genCond(tree.rhs, CRT_FLOW_TARGET);
                 result = items.
                     makeCondItem(rcond.opcode,
-                                 code.mergeChains(trueJumps, rcond.trueJumps),
+                                 Code.mergeChains(trueJumps, rcond.trueJumps),
                                  rcond.falseJumps);
             } else {
                 result = lcond;
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Items.java	Thu Feb 25 11:04:11 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Items.java	Thu Feb 25 12:26:39 2010 -0800
@@ -792,25 +792,25 @@
         }
 
         Chain jumpTrue() {
-            if (tree == null) return code.mergeChains(trueJumps, code.branch(opcode));
+            if (tree == null) return Code.mergeChains(trueJumps, code.branch(opcode));
             // we should proceed further in -Xjcov mode only
             int startpc = code.curPc();
-            Chain c = code.mergeChains(trueJumps, code.branch(opcode));
+            Chain c = Code.mergeChains(trueJumps, code.branch(opcode));
             code.crt.put(tree, CRTable.CRT_BRANCH_TRUE, startpc, code.curPc());
             return c;
         }
 
         Chain jumpFalse() {
-            if (tree == null) return code.mergeChains(falseJumps, code.branch(code.negate(opcode)));
+            if (tree == null) return Code.mergeChains(falseJumps, code.branch(Code.negate(opcode)));
             // we should proceed further in -Xjcov mode only
             int startpc = code.curPc();
-            Chain c = code.mergeChains(falseJumps, code.branch(code.negate(opcode)));
+            Chain c = Code.mergeChains(falseJumps, code.branch(Code.negate(opcode)));
             code.crt.put(tree, CRTable.CRT_BRANCH_FALSE, startpc, code.curPc());
             return c;
         }
 
         CondItem negate() {
-            CondItem c = new CondItem(code.negate(opcode), falseJumps, trueJumps);
+            CondItem c = new CondItem(Code.negate(opcode), falseJumps, trueJumps);
             c.tree = tree;
             return c;
         }
--- a/langtools/src/share/classes/com/sun/tools/javac/main/CommandLine.java	Thu Feb 25 11:04:11 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/main/CommandLine.java	Thu Feb 25 12:26:39 2010 -0800
@@ -82,7 +82,7 @@
         st.commentChar('#');
         st.quoteChar('"');
         st.quoteChar('\'');
-        while (st.nextToken() != st.TT_EOF) {
+        while (st.nextToken() != StreamTokenizer.TT_EOF) {
             args.append(st.sval);
         }
         r.close();
--- a/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Thu Feb 25 11:04:11 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Thu Feb 25 12:26:39 2010 -0800
@@ -1105,7 +1105,7 @@
             return env;
 
         if (verboseCompilePolicy)
-            log.printLines(log.noticeWriter, "[attribute " + env.enclClass.sym + "]");
+            Log.printLines(log.noticeWriter, "[attribute " + env.enclClass.sym + "]");
         if (verbose)
             printVerbose("checking.attribution", env.enclClass.sym);