eclipse-jdt / eclipse.jdt.core

Eclipse Public License 2.0
164 stars 130 forks source link

Create warning when parsing targets too new Java versions #3020

Closed mickaelistria closed 3 weeks ago

mickaelistria commented 1 month ago

Fixes https://github.com/eclipse-jdt/eclipse.jdt.core/issues/3018

What it does

Create a warning when options specify a new Java source version

How to test

Author checklist

mickaelistria commented 1 month ago

@jjohnstn @iloveeclipse What do you think?

jukzi commented 1 month ago

How to test

  • Create a basic Java Project and a basic Java file in it
  • Verify there is no error
  • Edit the .settings/org.eclipse.jdt.core.prefs, set the value of org.eclipse.jdt.core.compiler.compliance to 24 (basically last version support by ECJ + 1).
  • Reopen the file, edit => a warning is now shown "Java language version '24' is not supported, using version '23' instead"

If the PR would contain a JUnit that demonstrates the desired behavior i would be confident to merge.

mickaelistria commented 1 month ago

If the PR would contain a JUnit that demonstrates the desired behavior i would be confident to merge.

Ack. I'll be back at it shortly.

mickaelistria commented 3 weeks ago

I added a test case.

jjohnstn commented 3 weeks ago

LGTM. With the initial review's issue being addressed plus a test case added as requested by @jukzi, I am merging.