src/share/classes/com/sun/tools/javac/tree/TreeInfo.java
Print this page
*** 233,242 ****
--- 233,243 ----
/** Return true if a tree represents a diamond new expr. */
public static boolean isDiamond(JCTree tree) {
switch(tree.getTag()) {
case TYPEAPPLY: return ((JCTypeApply)tree).getTypeArguments().isEmpty();
case NEWCLASS: return isDiamond(((JCNewClass)tree).clazz);
+ case ANNOTATED_TYPE: return isDiamond(((JCAnnotatedType)tree).underlyingType);
default: return false;
}
}
public static boolean isEnumInit(JCTree tree) {
*** 333,342 ****
--- 334,345 ----
return isStaticSym(base) &&
isStaticSelector(((JCFieldAccess)base).selected, names);
case TYPEAPPLY:
case TYPEARRAY:
return true;
+ case ANNOTATED_TYPE:
+ return isStaticSelector(((JCAnnotatedType)base).underlyingType, names);
default:
return false;
}
}
//where