265 |
265 |
266 public static boolean isExplicitLambda(JCLambda lambda) { |
266 public static boolean isExplicitLambda(JCLambda lambda) { |
267 return lambda.params.isEmpty() || |
267 return lambda.params.isEmpty() || |
268 lambda.params.head.vartype != null; |
268 lambda.params.head.vartype != null; |
269 } |
269 } |
|
270 |
|
271 /** Return true if the tree corresponds to an expression statement */ |
|
272 public static boolean isExpressionStatement(JCExpression tree) { |
|
273 switch(tree.getTag()) { |
|
274 case PREINC: case PREDEC: |
|
275 case POSTINC: case POSTDEC: |
|
276 case ASSIGN: |
|
277 case BITOR_ASG: case BITXOR_ASG: case BITAND_ASG: |
|
278 case SL_ASG: case SR_ASG: case USR_ASG: |
|
279 case PLUS_ASG: case MINUS_ASG: |
|
280 case MUL_ASG: case DIV_ASG: case MOD_ASG: |
|
281 case APPLY: case NEWCLASS: |
|
282 case ERRONEOUS: |
|
283 return true; |
|
284 default: |
|
285 return false; |
|
286 } |
|
287 } |
|
288 |
270 /** |
289 /** |
271 * Return true if the AST corresponds to a static select of the kind A.B |
290 * Return true if the AST corresponds to a static select of the kind A.B |
272 */ |
291 */ |
273 public static boolean isStaticSelector(JCTree base, Names names) { |
292 public static boolean isStaticSelector(JCTree base, Names names) { |
274 if (base == null) |
293 if (base == null) |