src/share/classes/com/sun/tools/javac/tree/TreeInfo.java

changeset 1563
bc456436c613
parent 1521
71f35e4b93a5
child 1697
950e8ac120f0
equal deleted inserted replaced
1562:2154ed9ff6c8 1563:bc456436c613
233 /** Return true if a tree represents a diamond new expr. */ 233 /** Return true if a tree represents a diamond new expr. */
234 public static boolean isDiamond(JCTree tree) { 234 public static boolean isDiamond(JCTree tree) {
235 switch(tree.getTag()) { 235 switch(tree.getTag()) {
236 case TYPEAPPLY: return ((JCTypeApply)tree).getTypeArguments().isEmpty(); 236 case TYPEAPPLY: return ((JCTypeApply)tree).getTypeArguments().isEmpty();
237 case NEWCLASS: return isDiamond(((JCNewClass)tree).clazz); 237 case NEWCLASS: return isDiamond(((JCNewClass)tree).clazz);
238 case ANNOTATED_TYPE: return isDiamond(((JCAnnotatedType)tree).underlyingType);
238 default: return false; 239 default: return false;
239 } 240 }
240 } 241 }
241 242
242 public static boolean isEnumInit(JCTree tree) { 243 public static boolean isEnumInit(JCTree tree) {
333 return isStaticSym(base) && 334 return isStaticSym(base) &&
334 isStaticSelector(((JCFieldAccess)base).selected, names); 335 isStaticSelector(((JCFieldAccess)base).selected, names);
335 case TYPEAPPLY: 336 case TYPEAPPLY:
336 case TYPEARRAY: 337 case TYPEARRAY:
337 return true; 338 return true;
339 case ANNOTATED_TYPE:
340 return isStaticSelector(((JCAnnotatedType)base).underlyingType, names);
338 default: 341 default:
339 return false; 342 return false;
340 } 343 }
341 } 344 }
342 //where 345 //where

mercurial