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

chore(jdt): bump jdt version and fix testcase accordingly #3739

Merged
merged 1 commit into from
Jan 13, 2021

Conversation

MartinWitt
Copy link
Collaborator

@MartinWitt MartinWitt commented Dec 24, 2020

fixes #3731
The fix was already as a todo there. JDT allows only for the latest java version preview features. Updating to version 15 and disabling preview features works for now. As soon as we implement java 15 preview features, we need to reenable them.
As we discussed somewhere, some testhelpers could be super useful.

class JDTVersions {
/**
* Returns the latest jdt supported java version.
*/
String getLatestSupportedJavaVersion()

/**
* Checks if a jdt version supports preview features
*/
boolean String isPreviewSupported(String/int version)
}

This could remove a lot of hard coded versions from the test code. In many cases a latest version is what we want, but we simply write the latest current version. The supported jdt versions has some kind of api see https://github.com/eclipse/eclipse.jdt.core/blob/master/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java#L3144

Location

I have no clue where testhelpers are placed inside the test folder. Any hints?
Currently SpoonTestHelpers is in spoon/test/ but maybe a clear folder inside /test for testhelpers is way more obvious to use?

@MartinWitt MartinWitt changed the title WIP: chore(jdt) : fix testcase and bump jdt version chore(jdt) : fix testcase and bump jdt version Jan 13, 2021
@slarse
Copy link
Collaborator

slarse commented Jan 13, 2021

Would it be possible to wait with merging this until after the next beta release this coming weekend? Sorald needs a critical fix to the Sniper printer that went in this week (#3744), but we are currently bound to using JDT 3.23.0 until our primary dependency is updated to use 3.24.0, which is probably not going to happen until next month's release.

@monperrus monperrus changed the title chore(jdt) : fix testcase and bump jdt version chore(jdt): bump jdt version and fix testcase accordingly Jan 13, 2021
@monperrus monperrus merged commit 51f1dc6 into INRIA:master Jan 13, 2021
@monperrus
Copy link
Collaborator

Done! Thanks @MartinWitt for the test case adjustment.

@monperrus
Copy link
Collaborator

Sorry, I misunderstood your post, I read it "would it be possible to merge this"? Do we have a counter measure?

@slarse
Copy link
Collaborator

slarse commented Jan 13, 2021

It might work anyway, as we exclude the JDT dependency from Spoon due to a signature mismatch. I'll try out the snapshot once it goes live and get back to you :)

@slarse
Copy link
Collaborator

slarse commented Jan 13, 2021

@monperrus Tested with the snapshot (and knock on wood) it all appears to work fine! As there were no changes in Spoon's production code to accommodate for the new JDT version, I don't expect there to be any issues.

This is something that very likely will happen again, so it's good to know that our current workarounds are effective at dealing with a slight JDT version mismatch between Spoon and Sonar (obviously, API mismatches will lead to disaster).

@monperrus
Copy link
Collaborator

Good news!

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