Skip to content

Commit

Permalink
Merge pull request #68 from theresa-m/parseannotation_0.43
Browse files Browse the repository at this point in the history
0.43.0: Append cp to annotation data to fix redefinition inconsistencies
  • Loading branch information
tajila authored Nov 20, 2023
2 parents f15a875 + ba88429 commit e02c837
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
12 changes: 8 additions & 4 deletions src/java.base/share/classes/java/lang/reflect/Executable.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
* questions.
*/

/*
* ===========================================================================
* (c) Copyright IBM Corp. 2023, 2023 All Rights Reserved
* ===========================================================================
*/

package java.lang.reflect;

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

Expand Down Expand Up @@ -633,8 +638,7 @@ private Map<Class<? extends Annotation>, Annotation> declaredAnnotations() {
} else {
declAnnos = AnnotationParser.parseAnnotations(
getAnnotationBytes(),
SharedSecrets.getJavaLangAccess().
getConstantPool(getDeclaringClass()),
com.ibm.oti.vm.VM.getConstantPoolFromAnnotationBytes(getDeclaringClass(), getAnnotationBytes()),
getDeclaringClass()
);
}
Expand Down
9 changes: 7 additions & 2 deletions src/java.base/share/classes/java/lang/reflect/Field.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
* questions.
*/

/*
* ===========================================================================
* (c) Copyright IBM Corp. 2023, 2023 All Rights Reserved
* ===========================================================================
*/

package java.lang.reflect;

import jdk.internal.access.SharedSecrets;
Expand Down Expand Up @@ -1280,8 +1286,7 @@ private Map<Class<? extends Annotation>, Annotation> declaredAnnotations() {
} else {
declAnnos = AnnotationParser.parseAnnotations(
annotations,
SharedSecrets.getJavaLangAccess()
.getConstantPool(getDeclaringClass()),
com.ibm.oti.vm.VM.getConstantPoolFromAnnotationBytes(getDeclaringClass(), annotations),
getDeclaringClass());
}
declaredAnnotations = declAnnos;
Expand Down
9 changes: 7 additions & 2 deletions src/java.base/share/classes/java/lang/reflect/Method.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
* questions.
*/

/*
* ===========================================================================
* (c) Copyright IBM Corp. 2023, 2023 All Rights Reserved
* ===========================================================================
*/

package java.lang.reflect;

import jdk.internal.access.SharedSecrets;
Expand Down Expand Up @@ -771,8 +777,7 @@ public Object getDefaultValue() {
getReturnType());
Object result = AnnotationParser.parseMemberValue(
memberType, ByteBuffer.wrap(annotationDefault),
SharedSecrets.getJavaLangAccess().
getConstantPool(getDeclaringClass()),
com.ibm.oti.vm.VM.getConstantPoolFromAnnotationBytes(getDeclaringClass(), annotationDefault),
getDeclaringClass());
if (result instanceof ExceptionProxy) {
if (result instanceof TypeNotPresentExceptionProxy proxy) {
Expand Down

0 comments on commit e02c837

Please sign in to comment.