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

Append cp to method and field annotation data to fix redefinition inconsistencies #18437

Merged
merged 1 commit into from
Nov 17, 2023

Conversation

theresa-m
Copy link
Contributor

@theresa-m theresa-m commented Nov 9, 2023

@@ -110,6 +110,11 @@ public AnnotationType getAnnotationType(java.lang.Class<?> arg0) {
/** Return the constant pool for a class. */
public native ConstantPool getConstantPool(java.lang.Class<?> arg0);

/** Return the constant pool for a class. Use this version to resolve errors from constant pool redefinition. */
public ConstantPool getConstantPoolInternal(Object internalConstantPool) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't add public APIs to java/lang classes as they are not part of the spec. Instead, you can add a helper to com.ibm.oti.vm.VM

@theresa-m theresa-m force-pushed the parseannotations branch 2 times, most recently from 7e8b5f3 to ffeafec Compare November 9, 2023 21:48
@theresa-m theresa-m force-pushed the parseannotations branch 2 times, most recently from b778943 to 7d2ec65 Compare November 10, 2023 15:17
runtime/jcl/common/reflecthelp.c Outdated Show resolved Hide resolved
runtime/jcl/common/reflecthelp.c Outdated Show resolved Hide resolved
@hangshao0
Copy link
Contributor

Append cp to method annotation data ...

The title needs to be updated to include field as well.

@theresa-m theresa-m force-pushed the parseannotations branch 2 times, most recently from 260dd72 to de294e2 Compare November 10, 2023 16:24
@theresa-m theresa-m changed the title Append cp to method annotation data to fix redefinition inconsistencies Append cp to method and field annotation data to fix redefinition inconsistencies Nov 14, 2023
@hangshao0
Copy link
Contributor

The line ending check failed.

@theresa-m
Copy link
Contributor Author

This is ready for another review.

Copy link
Contributor

@tajila tajila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment

@@ -191,7 +185,7 @@ getFieldTypeAnnotationsAsByteArray(JNIEnv *env, jobject jlrField)
J9JNIFieldID *fieldID = vmThread->javaVM->reflectFunctions.idFromFieldObject(vmThread, NULL, fieldObject);
U_32 *annotationData = getFieldTypeAnnotationsDataFromROMField(fieldID->field);
if ( NULL != annotationData ) {
j9object_t annotationsByteArray = getAnnotationDataAsByteArray(vmThread, annotationData);
j9object_t annotationsByteArray = getAnnotationDataAsByteArray(vmThread, annotationData, NULL);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: tabbing looks off here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was changed because of a line ending check failure https://openj9-jenkins.osuosl.org/job/PullRequest-LineEndingsCheck-OpenJ9/11431/console

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, you can fix the whole function so it doesnt look off

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@tajila tajila merged commit 6d4bb37 into eclipse-openj9:master Nov 17, 2023
2 checks passed
@tajila
Copy link
Contributor

tajila commented Nov 20, 2023

@theresa-m You'll need to triple deliver to 0.42 and 0.43

@theresa-m theresa-m deleted the parseannotations branch December 6, 2023 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants