mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8265591: Remove vestiages of intermediate JSR 175 annotation format
Reviewed-by: jfranck
This commit is contained in:
parent
33a86b9e40
commit
8758b554a0
2 changed files with 5 additions and 24 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue