Skip to content

Add initial scaffolding for Java 17 classfiles#600

Closed
HritikRaj2 wants to merge 1 commit into
javapathfinder:masterfrom
HritikRaj2:java-17-prep
Closed

Add initial scaffolding for Java 17 classfiles#600
HritikRaj2 wants to merge 1 commit into
javapathfinder:masterfrom
HritikRaj2:java-17-prep

Conversation

@HritikRaj2
Copy link
Copy Markdown
Contributor

**Fixes #599 **

Description

This draft PR implements the initial scaffolding outlined in the linked issue to unblock JPF from reading Java 17 binaries.

Changes Made

  • ClassFile.java: Bumped MAX_SUPPORTED_VERSION to 61 and registered Record and PermittedSubclasses attributes.
  • java.lang.Record.java: Added a base MJI model stub so the engine does not crash during class resolution when encountering a Java Record.
  • FileVersionTest.java: Updated testUnsupportedVersionJava17 to testSupportedVersionJava17, verifying that the engine now successfully accepts the version 61 classfile.

Testing

Ran ./gradlew test and all tests pass, including the newly updated FileVersionTest.

@HritikRaj2
Copy link
Copy Markdown
Contributor Author

Hi @cyrille-artho , whenever you have a moment, take a quick look at this pr .

@Mahmoud-Khawaja
Copy link
Copy Markdown
Contributor

Hi Hitrik,
It seems thats a re-implementation of work that is already done there. please check java-17 branch - parseRecordAttribute() is fully implemented also a RecordComponentInfo() and all call backs were wired into jvmclassinfo. and FYI we no longer need MJI model stub for the record at all. we are already handling records through proper bytecode parsing ( parseRecordAttribute,RecordComponentInfo). you may look at #520

@HritikRaj2
Copy link
Copy Markdown
Contributor Author

Hi Hitrik, It seems thats a re-implementation of work that is already done there. please check java-17 branch - parseRecordAttribute() is fully implemented also a RecordComponentInfo() and all call backs were wired into jvmclassinfo. and FYI we no longer need MJI model stub for the record at all. we are already handling records through proper bytecode parsing ( parseRecordAttribute,RecordComponentInfo). you may look at #520

Hi @Mahmoud-Khawaja, thanks for pointing this out! I was working strictly off the master branch and completely missed the awesome work already merged into the java-17 branch via #520.

That makes total sense about the MJI stub not being needed now that the bytecode parsing and RecordComponentInfo are already wired up. I’ll go ahead and close this PR so I don't clutter the repo.

I'm going to pull the java-17 branch locally to explore the current state. It looks like the next big hurdles will be tackling PermittedSubclasses for Sealed Classes, or figuring out the invokedynamic / ObjectMethods.bootstrap routing for those implicit record methods you mentioned.

Really appreciate the heads-up and the guidance!

@HritikRaj2 HritikRaj2 closed this Mar 2, 2026
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.

Feature: Initial scaffolding to support Java 17 classfiles

2 participants