src/share/classes/com/sun/tools/javac/comp/Resolve.java

changeset 1127
ca49d50318dc
parent 1114
05814303a056
child 1186
51fb17abfc32
     1.1 --- a/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Sat Nov 05 00:02:33 2011 -0700
     1.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Tue Nov 08 11:51:05 2011 -0800
     1.3 @@ -49,9 +49,12 @@
     1.4  import javax.lang.model.element.ElementVisitor;
     1.5  
     1.6  import static com.sun.tools.javac.code.Flags.*;
     1.7 +import static com.sun.tools.javac.code.Flags.BLOCK;
     1.8  import static com.sun.tools.javac.code.Kinds.*;
     1.9 +import static com.sun.tools.javac.code.Kinds.ERRONEOUS;
    1.10  import static com.sun.tools.javac.code.TypeTags.*;
    1.11  import static com.sun.tools.javac.comp.Resolve.MethodResolutionPhase.*;
    1.12 +import static com.sun.tools.javac.tree.JCTree.Tag.*;
    1.13  
    1.14  /** Helper class for name resolution, used mostly by the attribution phase.
    1.15   *
    1.16 @@ -1269,7 +1272,7 @@
    1.17                  staticOnly = true;
    1.18          }
    1.19  
    1.20 -        if (env.tree.getTag() != JCTree.IMPORT) {
    1.21 +        if (!env.tree.hasTag(IMPORT)) {
    1.22              sym = findGlobalType(env, env.toplevel.namedImportScope, name);
    1.23              if (sym.exists()) return sym;
    1.24              else if (sym.kind < bestSoFar.kind) bestSoFar = sym;
    1.25 @@ -1796,7 +1799,7 @@
    1.26       *  @param env       The environment current at the operation.
    1.27       *  @param argtypes  The types of the operands.
    1.28       */
    1.29 -    Symbol resolveOperator(DiagnosticPosition pos, int optag,
    1.30 +    Symbol resolveOperator(DiagnosticPosition pos, JCTree.Tag optag,
    1.31                             Env<AttrContext> env, List<Type> argtypes) {
    1.32          startResolution();
    1.33          Name name = treeinfo.operatorName(optag);
    1.34 @@ -1815,7 +1818,7 @@
    1.35       *  @param env       The environment current at the operation.
    1.36       *  @param arg       The type of the operand.
    1.37       */
    1.38 -    Symbol resolveUnaryOperator(DiagnosticPosition pos, int optag, Env<AttrContext> env, Type arg) {
    1.39 +    Symbol resolveUnaryOperator(DiagnosticPosition pos, JCTree.Tag optag, Env<AttrContext> env, Type arg) {
    1.40          return resolveOperator(pos, optag, env, List.of(arg));
    1.41      }
    1.42  
    1.43 @@ -1827,7 +1830,7 @@
    1.44       *  @param right     The types of the right operand.
    1.45       */
    1.46      Symbol resolveBinaryOperator(DiagnosticPosition pos,
    1.47 -                                 int optag,
    1.48 +                                 JCTree.Tag optag,
    1.49                                   Env<AttrContext> env,
    1.50                                   Type left,
    1.51                                   Type right) {

mercurial