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

changeset 1348
573ceb23beeb
parent 1347
1408af4cd8b0
child 1352
d4b3cb1ece84
equal deleted inserted replaced
1347:1408af4cd8b0 1348:573ceb23beeb
260 default: 260 default:
261 return false; 261 return false;
262 } 262 }
263 } 263 }
264 264
265 public static boolean isExplicitLambda(JCLambda lambda) {
266 return lambda.params.isEmpty() ||
267 lambda.params.head.vartype != null;
268 }
265 /** 269 /**
266 * Return true if the AST corresponds to a static select of the kind A.B 270 * Return true if the AST corresponds to a static select of the kind A.B
267 */ 271 */
268 public static boolean isStaticSelector(JCTree base, Names names) { 272 public static boolean isStaticSelector(JCTree base, Names names) {
269 if (base == null) 273 if (base == null)
398 } 402 }
399 case VARDEF: { 403 case VARDEF: {
400 JCVariableDecl node = (JCVariableDecl)tree; 404 JCVariableDecl node = (JCVariableDecl)tree;
401 if (node.mods.pos != Position.NOPOS) { 405 if (node.mods.pos != Position.NOPOS) {
402 return node.mods.pos; 406 return node.mods.pos;
407 } else if (node.vartype == null) {
408 //if there's no type (partially typed lambda parameter)
409 //simply return node position
410 return node.pos;
403 } else { 411 } else {
404 return getStartPos(node.vartype); 412 return getStartPos(node.vartype);
405 } 413 }
406 } 414 }
407 case ERRONEOUS: { 415 case ERRONEOUS: {

mercurial