Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8265591: Remove vestiages of intermediate JSR 175 annotation format #3597

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter
Filter file types
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.

Always

Just for now

@@ -237,13 +237,8 @@ private static Annotation parseAnnotation2(ByteBuffer buf,
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 @@ private static Object parseClassValue(ByteBuffer buf,
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 @@ private static Object parseEnumValue(Class<? extends Enum> enumType, ByteBuffer
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 @@ void attachAnnotationDefault(final Symbol sym) {
}

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) {