--- a/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java Tue Oct 23 13:58:56 2012 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java Thu Oct 25 11:09:36 2012 -0700
@@ -42,7 +42,9 @@
import static com.sun.tools.javac.code.Flags.*;
import static com.sun.tools.javac.code.Flags.ANNOTATION;
import static com.sun.tools.javac.code.Kinds.*;
-import static com.sun.tools.javac.code.TypeTags.*;
+import static com.sun.tools.javac.code.TypeTag.CLASS;
+import static com.sun.tools.javac.code.TypeTag.ERROR;
+import static com.sun.tools.javac.code.TypeTag.TYPEVAR;
import static com.sun.tools.javac.tree.JCTree.Tag.*;
import com.sun.tools.javac.util.JCDiagnostic.DiagnosticFlag;
import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
@@ -370,7 +372,7 @@
ListBuffer<Type> thrownbuf = new ListBuffer<Type>();
for (List<JCExpression> l = thrown; l.nonEmpty(); l = l.tail) {
Type exc = attr.attribType(l.head, env);
- if (exc.tag != TYPEVAR)
+ if (!exc.hasTag(TYPEVAR))
exc = chk.checkClassType(l.head.pos(), exc);
thrownbuf.append(exc);
}
@@ -921,7 +923,7 @@
}
for (JCExpression iface : interfaceTrees) {
Type i = attr.attribBase(iface, baseEnv, false, true, true);
- if (i.tag == CLASS) {
+ if (i.hasTag(CLASS)) {
interfaces.append(i);
if (all_interfaces != null) all_interfaces.append(i);
chk.checkNotRepeated(iface.pos(), types.erasure(i), interfaceSet);
@@ -1006,7 +1008,7 @@
new VarSymbol(FINAL | HASINIT, names._this, c.type, c);
thisSym.pos = Position.FIRSTPOS;
env.info.scope.enter(thisSym);
- if (ct.supertype_field.tag == CLASS) {
+ if (ct.supertype_field.hasTag(CLASS)) {
VarSymbol superSym =
new VarSymbol(FINAL | HASINIT, names._super,
ct.supertype_field, c);
@@ -1094,7 +1096,7 @@
}
Type modelMissingTypes(Type t, final JCExpression tree, final boolean interfaceExpected) {
- if (t.tag != ERROR)
+ if (!t.hasTag(ERROR))
return t;
return new ErrorType(((ErrorType) t).getOriginalType(), t.tsym) {
@@ -1139,7 +1141,7 @@
@Override
public void visitIdent(JCIdent tree) {
- if (tree.type.tag != ERROR) {
+ if (!tree.type.hasTag(ERROR)) {
result = tree.type;
} else {
result = synthesizeClass(tree.name, syms.unnamedPackage).type;
@@ -1148,7 +1150,7 @@
@Override
public void visitSelect(JCFieldAccess tree) {
- if (tree.type.tag != ERROR) {
+ if (!tree.type.hasTag(ERROR)) {
result = tree.type;
} else {
Type selectedType;
@@ -1166,7 +1168,7 @@
@Override
public void visitTypeApply(JCTypeApply tree) {
- if (tree.type.tag != ERROR) {
+ if (!tree.type.hasTag(ERROR)) {
result = tree.type;
} else {
ClassType clazzType = (ClassType) visit(tree.clazz);