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) { |