-
Notifications
You must be signed in to change notification settings - Fork 340
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
fixing issue Orphan NativePeer method with Java 11.0.20.1 #421 #431
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the update. Please try to minimize the changes; if it is not possible to add a unit test to check against warnings of JPF, then there is no need to add imports for the junit
test packages.
int objRef = env.getStaticReferenceField("jdk.internal.misc.Unsafe", "theUnsafe"); | ||
return objRef; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please try to avoid introducing extra formatting changes, as this may make it more difficult to merge your patch in other branches later.
@@ -60,7 +62,7 @@ public void registerNatives____V(MJIEnv env, int clsObjRef) {} | |||
public int addressSize0____I (MJIEnv env, int objRef) { | |||
return 0; | |||
} | |||
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to remove this change as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please revert the second change that swaps the two methods, so we have a patch that only has the first (functional) change?
@@ -26,8 +26,10 @@ | |||
import gov.nasa.jpf.vm.NativePeer; | |||
import gov.nasa.jpf.vm.SystemState; | |||
import gov.nasa.jpf.vm.ThreadInfo; | |||
import junit.Test; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these two imports needed? You do not (yet) add a new test in this patch.
@cyrille-artho Hi, I had incorporated all the suggested changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the update. This version is a step forward but still has some changes that do not seem to relate directly to the incorrectly named native peer.
Can you please try to make a minimal patch that does not change any other lines? There are several changes (I've highlighted some of them) that add or remove spaces or empty lines. There is also one change that removes an @MJI method. While the tests still all pass, there may be functionality that the unit tests do not cover but rely on that @MJI method.
|
||
@MJI | ||
public long objectFieldOffset__Ljava_lang_reflect_Field_2__J (MJIEnv env, int unsafeRef, int fieldRef) { | ||
public long objectFieldOffset__Ljava_lang_reflect_Field_2__J(MJIEnv env, int unsafeRef, int fieldRef) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the space before the "(" back so we do not have extra changes in the patch; this is important to make future merges to other branches easier.
@cyrille-artho Thanks for the valuable feedback! I've incorporated the suggested changes, keeping modifications minimal. Retained necessary methods, removed extra spaces, and ensured consistent spacing.
Please review the changes. |
Thanks for adding the code back. Please try to add it back in the same way it was before, as there are still two changes that merely reformat code, which is best avoided (an empty line at the beginning and reordered/reformatted methods at the end). |
@cyrille-artho I had made the changes please review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
Please try to isolate the first change. If you are not familiar with "diff" and "patch", you can try to apply the first change again manually on a new branch and make a new PR.
Thank you for your perseverance!
@@ -60,7 +62,7 @@ public void registerNatives____V(MJIEnv env, int clsObjRef) {} | |||
public int addressSize0____I (MJIEnv env, int objRef) { | |||
return 0; | |||
} | |||
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please revert the second change that swaps the two methods, so we have a patch that only has the first (functional) change?
Subsumed by PR #492 |
fix #421