--- a/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java Tue Feb 12 19:25:09 2013 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java Tue Feb 12 17:15:29 2013 -0800
@@ -126,7 +126,8 @@
// Tree position.
public int pos = -1;
- // For typecasts, type tests, new (and locals, as start_pc).
+ // For type casts, type tests, new, locals (as start_pc),
+ // and method and constructor reference type arguments.
public boolean isValidOffset = false;
public int offset = -1;
@@ -156,12 +157,13 @@
sb.append(type);
switch (type) {
- // type cast
- case CAST:
// instanceof
case INSTANCEOF:
// new expression
case NEW:
+ // constructor/method reference receiver
+ case CONSTRUCTOR_REFERENCE:
+ case METHOD_REFERENCE:
sb.append(", offset = ");
sb.append(offset);
break;
@@ -223,9 +225,12 @@
sb.append(", param_index = ");
sb.append(parameter_index);
break;
+ // type cast
+ case CAST:
// method/constructor/reference type argument
case CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT:
case METHOD_INVOCATION_TYPE_ARGUMENT:
+ case CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT:
case METHOD_REFERENCE_TYPE_ARGUMENT:
sb.append(", offset = ");
sb.append(offset);
@@ -236,12 +241,6 @@
case METHOD_RETURN:
case FIELD:
break;
- // lambda formal parameter
- case LAMBDA_FORMAL_PARAMETER:
- // TODO: also needs an offset?
- sb.append(", param_index = ");
- sb.append(parameter_index);
- break;
case UNKNOWN:
sb.append(", position UNKNOWN!");
break;