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

Java 21 support #479

Open
wetneb opened this issue Jan 27, 2024 · 3 comments
Open

Java 21 support #479

wetneb opened this issue Jan 27, 2024 · 3 comments

Comments

@wetneb
Copy link
Contributor

wetneb commented Jan 27, 2024

Running mvn clean test with Java 21, I get various module-related errors, such as this one:

[ERROR] mergeTreeShouldEqualReParsedPrettyPrent_whenBothRevisionsAreModified{TestSources, Path}[14]  Time elapsed: 0.023 s  <<< ERROR!
java.lang.ClassCastException: class spoon.reflect.factory.ModuleFactory$CtUnnamedModule cannot be cast to class spoon.reflect.declaration.CtType (spoon.reflect.factory.ModuleFactory$CtUnnamedModule and spoon.reflect.declaration.CtType are in unnamed module of loader 'app')
	at se.kth.spork.cli.CliTest.runTestMerge(CliTest.java:139)
	at se.kth.spork.cli.CliTest.mergeTreeShouldEqualReParsedPrettyPrent_whenBothRevisionsAreModified(CliTest.java:91)

There might be some command line options to add to open the required modules.

@monperrus
Copy link
Collaborator

thanks for the report, would you be able to PR?

@slarse
Copy link
Collaborator

slarse commented Jan 28, 2024

Spork is only known to run really well with Java 11, and on Java 11 code. There's syntax in later versions of Java that Spork does not support merging. As long as that syntax isn't used in the source code it should in theory be possible to use Spork on later versions of Java, though, but then Spoon needs to be updated.

Spork is about 2 years out of date with Spoon versions and there are many breaking changes in later versions of gumtree/gumtree-spoon (which would also need to be updated to update spoon itself). Due to the nature of Spork, it relies uncomfortably much on implementation details of libraries (Spoon and gumtree-spoon) that themselves rely on implementation details of the JVM, so updating to later versions is quite a bit of work and requires quite a bit of tuning.

I'd be happy to see updates to the core dependencies but my time for such is unfortunately too limited to start up right now.

@wetneb
Copy link
Contributor Author

wetneb commented Jan 28, 2024

Good to know that it's a significant task!
The error message mentions modules but after a bit of googling it seems that it's not actually related to the JPMS indeed.

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

No branches or pull requests

3 participants