src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java

Print this page

        

*** 990,1005 **** } void writePosition(TypeAnnotationPosition p) { databuf.appendByte(p.type.targetTypeValue()); // TargetType tag is a byte switch (p.type) { - // type cast - case CAST: // instanceof case INSTANCEOF: // new expression case NEW: databuf.appendChar(p.offset); break; // local variable case LOCAL_VARIABLE: // resource variable --- 990,1006 ---- } void writePosition(TypeAnnotationPosition p) { databuf.appendByte(p.type.targetTypeValue()); // TargetType tag is a byte switch (p.type) { // instanceof case INSTANCEOF: // new expression case NEW: + // constructor/method reference receiver + case CONSTRUCTOR_REFERENCE: + case METHOD_REFERENCE: databuf.appendChar(p.offset); break; // local variable case LOCAL_VARIABLE: // resource variable
*** 1040,1064 **** break; // method parameter case METHOD_FORMAL_PARAMETER: databuf.appendByte(p.parameter_index); break; // method/constructor/reference type argument case CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT: case METHOD_INVOCATION_TYPE_ARGUMENT: case METHOD_REFERENCE_TYPE_ARGUMENT: databuf.appendChar(p.offset); databuf.appendByte(p.type_index); break; // We don't need to worry about these case METHOD_RETURN: case FIELD: break; - // lambda formal parameter - case LAMBDA_FORMAL_PARAMETER: - databuf.appendByte(p.parameter_index); - break; case UNKNOWN: throw new AssertionError("jvm.ClassWriter: UNKNOWN target type should never occur!"); default: throw new AssertionError("jvm.ClassWriter: Unknown target type for position: " + p); } --- 1041,1064 ---- break; // method parameter case METHOD_FORMAL_PARAMETER: databuf.appendByte(p.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: databuf.appendChar(p.offset); databuf.appendByte(p.type_index); break; // We don't need to worry about these case METHOD_RETURN: case FIELD: break; case UNKNOWN: throw new AssertionError("jvm.ClassWriter: UNKNOWN target type should never occur!"); default: throw new AssertionError("jvm.ClassWriter: Unknown target type for position: " + p); }