src/share/classes/com/sun/tools/javac/code/Kinds.java

changeset 1352
d4b3cb1ece84
parent 1085
ed338593b0b6
child 1357
c75be5bc5283
     1.1 --- a/src/share/classes/com/sun/tools/javac/code/Kinds.java	Fri Oct 05 14:21:09 2012 -0700
     1.2 +++ b/src/share/classes/com/sun/tools/javac/code/Kinds.java	Sat Oct 06 10:35:38 2012 +0100
     1.3 @@ -28,6 +28,7 @@
     1.4  import java.util.EnumSet;
     1.5  import java.util.Locale;
     1.6  
     1.7 +import com.sun.source.tree.MemberReferenceTree;
     1.8  import com.sun.tools.javac.api.Formattable;
     1.9  import com.sun.tools.javac.api.Messages;
    1.10  
    1.11 @@ -85,11 +86,12 @@
    1.12      public static final int AMBIGUOUS    = ERRONEOUS+1; // ambiguous reference
    1.13      public static final int HIDDEN       = ERRONEOUS+2; // hidden method or field
    1.14      public static final int STATICERR    = ERRONEOUS+3; // nonstatic member from static context
    1.15 -    public static final int ABSENT_VAR   = ERRONEOUS+4; // missing variable
    1.16 -    public static final int WRONG_MTHS   = ERRONEOUS+5; // methods with wrong arguments
    1.17 -    public static final int WRONG_MTH    = ERRONEOUS+6; // one method with wrong arguments
    1.18 -    public static final int ABSENT_MTH   = ERRONEOUS+7; // missing method
    1.19 -    public static final int ABSENT_TYP   = ERRONEOUS+8; // missing type
    1.20 +    public static final int MISSING_ENCL = ERRONEOUS+4; // missing enclosing class
    1.21 +    public static final int ABSENT_VAR   = ERRONEOUS+5; // missing variable
    1.22 +    public static final int WRONG_MTHS   = ERRONEOUS+6; // methods with wrong arguments
    1.23 +    public static final int WRONG_MTH    = ERRONEOUS+7; // one method with wrong arguments
    1.24 +    public static final int ABSENT_MTH   = ERRONEOUS+8; // missing method
    1.25 +    public static final int ABSENT_TYP   = ERRONEOUS+9; // missing type
    1.26  
    1.27      public enum KindName implements Formattable {
    1.28          ANNOTATION("kindname.annotation"),
    1.29 @@ -140,6 +142,14 @@
    1.30          }
    1.31      }
    1.32  
    1.33 +    public static KindName kindName(MemberReferenceTree.ReferenceMode mode) {
    1.34 +        switch (mode) {
    1.35 +            case INVOKE: return KindName.METHOD;
    1.36 +            case NEW: return KindName.CONSTRUCTOR;
    1.37 +            default : throw new AssertionError("Unexpected mode: "+ mode);
    1.38 +        }
    1.39 +    }
    1.40 +
    1.41      /** A KindName representing a given symbol
    1.42       */
    1.43      public static KindName kindName(Symbol sym) {

mercurial