-
Notifications
You must be signed in to change notification settings - Fork 139
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
Autocompletion suggest methods that are outside of the desired compliance level (and then fails to compile) #3596
Comments
i think that its not a bug, you are supposed to used a jdk17. Also it may not be solvable otherwise as the since-version annotation does not provide a comparable value. |
nevertheless the behavior feels inconsistent between ui and core. |
Ah, good tip. I was using JRE for JavaSE-17, which showed up as JavaSE-17 in the package explorer but it seems to resolve to something with Java 21 (or maybe even 23). Once I specifically selected temurin-jdk-17.0.13+11 [perfect match] in the preferences, the problem vanished. Nevertheless the behavior is odd IMO. What does the Compiler Compliance Level do if not these kind of stuff? |
i guess it selects java language features of the parser |
... in English please? 😅 |
for example the use of "var" or for-each-loop, try-with-resource, pattern matching in case statements. That are java language features that do not require a jdk |
The problem
I get autocompletion proposals that are outside the compliance level specified in the project, e.g.
The method
java.util.concurrent.Executors.newThreadPerTaskExecutor(ThreadFactory)
is available starting with Java 21 but the compliance level is set to 17.To reproduce
Option Nr. 1
Executors.newT
and open autocompletionOption Nr. 2
Executors.newT
and open autocompletionThe text was updated successfully, but these errors were encountered: