6929544: langtools source code uses statics qualified by instance variables

Reviewed-by: darcy
This commit is contained in:
Jonathan Gibbons 2010-02-25 12:26:39 -08:00
parent 0f2c1bcc27
commit 54cd0cc441
11 changed files with 24 additions and 26 deletions

@ -68,7 +68,7 @@ javac.no.jdk.warnings = -XDignore.symbol.file=true
# 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/

@ -82,7 +82,7 @@ public class CommandLine {
st.commentChar('#');
st.quoteChar('"');
st.quoteChar('\'');
while (st.nextToken() != st.TT_EOF) {
while (st.nextToken() != StreamTokenizer.TT_EOF) {
args.append(st.sval);
}
r.close();

@ -71,6 +71,6 @@ public abstract class TypeMirrorImpl implements TypeMirror {
* {@inheritDoc}
*/
public int hashCode() {
return env.jctypes.hashCode(type);
return Types.hashCode(type);
}
}

@ -31,23 +31,21 @@ import com.sun.tools.doclets.formats.html.*;
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();
}
}

@ -64,7 +64,7 @@ class Launcher {
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);

@ -137,7 +137,7 @@ public final class JavacTool implements JavaCompiler {
}
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(

@ -2504,7 +2504,7 @@ public class Types {
}
@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 @@ public class Types {
this.t = t;
}
public int hashCode() {
return Types.this.hashCode(t);
return Types.hashCode(t);
}
public boolean equals(Object obj) {
return (obj instanceof SingletonType) &&

@ -808,8 +808,8 @@ public class Gen extends JCTree.Visitor {
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 @@ public class Gen extends JCTree.Visitor {
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 @@ public class Gen extends JCTree.Visitor {
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 @@ public class Gen extends JCTree.Visitor {
result = items.
makeCondItem(rcond.opcode,
rcond.trueJumps,
code.mergeChains(falseJumps,
Code.mergeChains(falseJumps,
rcond.falseJumps));
} else {
result = lcond;
@ -1976,7 +1976,7 @@ public class Gen extends JCTree.Visitor {
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;

@ -792,25 +792,25 @@ public class Items {
}
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;
}

@ -82,7 +82,7 @@ public class CommandLine {
st.commentChar('#');
st.quoteChar('"');
st.quoteChar('\'');
while (st.nextToken() != st.TT_EOF) {
while (st.nextToken() != StreamTokenizer.TT_EOF) {
args.append(st.sval);
}
r.close();

@ -1105,7 +1105,7 @@ public class JavaCompiler implements ClassReader.SourceCompleter {
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);