Skip to content

Commit

Permalink
Fix extensions annotation and constantpool inconsistencies
Browse files Browse the repository at this point in the history
Missing cases from eclipse-openj9/openj9#14063

Signed-off-by: Theresa Mammarella <Theresa.T.Mammarella@ibm.com>
  • Loading branch information
theresa-m committed Nov 10, 2023
1 parent 6be59e3 commit 6c8473b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
11 changes: 7 additions & 4 deletions jdk/src/share/classes/java/lang/reflect/Executable.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* ===========================================================================
* (c) Copyright IBM Corp. 2023, 2023 All Rights Reserved
* ===========================================================================
*/

package java.lang.reflect;

Expand Down Expand Up @@ -79,8 +84,7 @@ boolean equalParamTypes(Class<?>[] params1, Class<?>[] params2) {
Annotation[][] parseParameterAnnotations(byte[] parameterAnnotations) {
return AnnotationParser.parseParameterAnnotations(
parameterAnnotations,
sun.misc.SharedSecrets.getJavaLangAccess().
getConstantPool(getDeclaringClass()),
com.ibm.oti.vm.VM.getConstantPoolFromAnnotationBytes(parameterAnnotations),
getDeclaringClass());
}

Expand Down Expand Up @@ -601,8 +605,7 @@ private Map<Class<? extends Annotation>, Annotation> declaredAnnotations() {
} else {
declAnnos = AnnotationParser.parseAnnotations(
getAnnotationBytes(),
sun.misc.SharedSecrets.getJavaLangAccess().
getConstantPool(getDeclaringClass()),
com.ibm.oti.vm.VM.getConstantPoolFromAnnotationBytes(getAnnotationBytes()),
getDeclaringClass()
);
}
Expand Down
8 changes: 6 additions & 2 deletions jdk/src/share/classes/java/lang/reflect/Field.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* ===========================================================================
* (c) Copyright IBM Corp. 2023, 2023 All Rights Reserved
* ===========================================================================
*/

package java.lang.reflect;

Expand Down Expand Up @@ -1152,8 +1157,7 @@ private Map<Class<? extends Annotation>, Annotation> declaredAnnotations() {
} else {
declAnnos = AnnotationParser.parseAnnotations(
annotations,
sun.misc.SharedSecrets.getJavaLangAccess()
.getConstantPool(getDeclaringClass()),
com.ibm.oti.vm.VM.getConstantPoolFromAnnotationBytes(annotations),
getDeclaringClass());
}
declaredAnnotations = declAnnos;
Expand Down
8 changes: 6 additions & 2 deletions jdk/src/share/classes/java/lang/reflect/Method.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* ===========================================================================
* (c) Copyright IBM Corp. 2023, 2023 All Rights Reserved
* ===========================================================================
*/

package java.lang.reflect;

Expand Down Expand Up @@ -605,8 +610,7 @@ public Object getDefaultValue() {
getReturnType());
Object result = AnnotationParser.parseMemberValue(
memberType, ByteBuffer.wrap(annotationDefault),
sun.misc.SharedSecrets.getJavaLangAccess().
getConstantPool(getDeclaringClass()),
com.ibm.oti.vm.VM.getConstantPoolFromAnnotationBytes(annotationDefault),
getDeclaringClass());
if (result instanceof sun.reflect.annotation.ExceptionProxy)
throw new AnnotationFormatError("Invalid default: " + this);
Expand Down

0 comments on commit 6c8473b

Please sign in to comment.