8265591: Remove vestiages of intermediate JSR 175 annotation format
Reviewed-by: jfranck
This commit is contained in:
parent
33a86b9e40
commit
8758b554a0
src
java.base/share/classes/sun/reflect/annotation
jdk.compiler/share/classes/com/sun/tools/javac/jvm
@ -237,13 +237,8 @@ public class AnnotationParser {
|
||||
Class<? extends Annotation> annotationClass = null;
|
||||
String sig = "[unknown]";
|
||||
try {
|
||||
try {
|
||||
sig = constPool.getUTF8At(typeIndex);
|
||||
annotationClass = (Class<? extends Annotation>)parseSig(sig, container);
|
||||
} catch (IllegalArgumentException ex) {
|
||||
// support obsolete early jsr175 format class files
|
||||
annotationClass = (Class<? extends Annotation>)constPool.getClassAt(typeIndex);
|
||||
}
|
||||
sig = constPool.getUTF8At(typeIndex);
|
||||
annotationClass = (Class<? extends Annotation>)parseSig(sig, container);
|
||||
} catch (NoClassDefFoundError e) {
|
||||
if (exceptionOnMissingAnnotationClass)
|
||||
// note: at this point sig is "[unknown]" or VM-style
|
||||
@ -420,17 +415,11 @@ public class AnnotationParser {
|
||||
Class<?> container) {
|
||||
int classIndex = buf.getShort() & 0xFFFF;
|
||||
try {
|
||||
try {
|
||||
String sig = constPool.getUTF8At(classIndex);
|
||||
return parseSig(sig, container);
|
||||
} catch (IllegalArgumentException ex) {
|
||||
// support obsolete early jsr175 format class files
|
||||
return constPool.getClassAt(classIndex);
|
||||
}
|
||||
String sig = constPool.getUTF8At(classIndex);
|
||||
return parseSig(sig, container);
|
||||
} catch (NoClassDefFoundError e) {
|
||||
return new TypeNotPresentExceptionProxy("[unknown]", e);
|
||||
}
|
||||
catch (TypeNotPresentException e) {
|
||||
} catch (TypeNotPresentException e) {
|
||||
return new TypeNotPresentExceptionProxy(e.typeName(), e.getCause());
|
||||
}
|
||||
}
|
||||
@ -476,11 +465,6 @@ public class AnnotationParser {
|
||||
if (!enumType.isEnum()) {
|
||||
return new AnnotationTypeMismatchExceptionProxy(
|
||||
typeName + "." + constName);
|
||||
} else if (!typeName.endsWith(";")) {
|
||||
// support now-obsolete early jsr175-format class files.
|
||||
if (!enumType.getName().equals(typeName))
|
||||
return new AnnotationTypeMismatchExceptionProxy(
|
||||
typeName + "." + constName);
|
||||
} else if (enumType != parseSig(typeName, container)) {
|
||||
return new AnnotationTypeMismatchExceptionProxy(
|
||||
typeName + "." + constName);
|
||||
|
@ -1515,9 +1515,6 @@ public class ClassReader {
|
||||
}
|
||||
|
||||
Type readTypeOrClassSymbol(int i) {
|
||||
// support preliminary jsr175-format class files
|
||||
if (poolReader.hasTag(i, CONSTANT_Class))
|
||||
return poolReader.getClass(i).type;
|
||||
return readTypeToProxy(i);
|
||||
}
|
||||
Type readTypeToProxy(int i) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user