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

Use ToolFactory.createScanner() with source compliance set if possible #203

Closed
iloveeclipse opened this issue Aug 5, 2022 · 0 comments · Fixed by #205
Closed

Use ToolFactory.createScanner() with source compliance set if possible #203

iloveeclipse opened this issue Aug 5, 2022 · 0 comments · Fixed by #205
Assignees
Milestone

Comments

@iloveeclipse
Copy link
Member

Follow up on the issue surprised me a lot in spotbugs/spotbugs#2134

There is a possibility that JDT bails out scanning fully valid code only because the IScanner was created with wrong (too old, default) source level.

I've checked how much code still uses org.eclipse.jdt.core.ToolFactory.createScanner(boolean, boolean, boolean, boolean) and see ~20 references in JDT UI that probably should use proper source compliance set.

I will try to change that and see if some test fails.

@iloveeclipse iloveeclipse self-assigned this Aug 5, 2022
iloveeclipse added a commit to iloveeclipse/eclipse.jdt.ui that referenced this issue Aug 5, 2022
To avoid InvalidInputException if the source code contains elements not
covered by Java 1.3 JLS, specify proper source/target arguments while
creating scanner.

Fixes eclipse-jdt#203
iloveeclipse added a commit that referenced this issue Aug 6, 2022
To avoid InvalidInputException if the source code contains elements not
covered by Java 1.3 JLS, specify proper source/target arguments while
creating scanner.

Fixes #203
@iloveeclipse iloveeclipse added this to the 4.25 M3 milestone Aug 6, 2022
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 a pull request may close this issue.

1 participant