-
Notifications
You must be signed in to change notification settings - Fork 369
Added check to accept version 61, throw error for higher #521
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
base: java-17
Are you sure you want to change the base?
Added check to accept version 61, throw error for higher #521
Conversation
Hello @cyrille-artho, |
Hi Mahmoud, |
im thinking of creating a |
Yes, that is what I mean. It may be difficult to compile one file with two versions of |
Together with a suitable test, try to make this PR against |
Great! I'm currently working on this. I will commit the changes for you to review once I finish. |
Hello @cyrille-artho , |
i just need to verify if my approach is correct. i created two classes please check and let me know if i have to do the same on the master branch |
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 your work. Please look at/change two things:
- Your PR may not be up to date with all changes; a lot of unit tests currently fail instead of the expect three unit tests that reflect features that indeed don't work yet on
java-17
. - Can we remove
src/tests/gov/nasa/jpf/jvm/resources/TestClassJava17.class
and instead use the version that is compiled as part of the build process? I understand that keeping the version built with Java 21 is the more pragmatic choice (rather than additional build rules for one file with a different version of Java), but this branch uses Java 17, so the source file should be built as expected.
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.
Another item to address regarding the tests.
public void testUnsupportedVersionJava21() throws IOException { | ||
byte[] classData = loadClassFile(JAVA21_CLASS); | ||
|
||
ClassFile classFile = new ClassFile(classData); |
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 enable this test and ensure it throws an exception. The test looks good; what was the reason for commenting it out? Perhaps JPF loads the version of the class file that was compiled by the build process rather than the one in src/tests
, which would explain that this test does not throw an exception and thus fails?
In that case, try to find a way to make your manually uploaded class file take precedence in the class loader.
Hello @cyrille-artho, thanks for response, you're correct about removing after debugging again i tried to removed so i think the problem is with the Class loading itself and im not sure why it can't read the compiled files can you please help me with this? |
I don't have time to look into this right now, but this sounds like it's very likely a classpath issue. Note that JPF's classpath might differ from the host JVM's classpath. You can try |
got it! I will investigate this, and maybe I can find the error thanks! |
…clude them in the test classpath
Hello @cyrille-artho, |
Hi, |
yes, i forgot to add the .class now i think they will pass. |
regarding the other failing tests i will investigate and see why they fail |
No description provided.