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

Create warning when parsing targets too new Java versions #3020

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

mickaelistria
Copy link
Contributor

Fixes #3018

What it does

Create a warning when options specify a new Java source version

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"

Author checklist

@mickaelistria
Copy link
Contributor Author

@jjohnstn @iloveeclipse What do you think?

@mickaelistria mickaelistria force-pushed the warn-too-new-java branch 2 times, most recently from 2817d12 to 6d8b5fd Compare October 8, 2024 11:00
@jukzi
Copy link
Contributor

jukzi commented Oct 9, 2024

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
Copy link
Contributor Author

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
Copy link
Contributor Author

I added a test case.

@jjohnstn
Copy link
Contributor

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

@jjohnstn jjohnstn merged commit 1eb248b into eclipse-jdt:master Oct 15, 2024
10 checks passed
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.

Using ECJ parser targetting newer -source version should emit a warning
4 participants