-
Notifications
You must be signed in to change notification settings - Fork 239
Closed as not planned
Labels
bugSomething isn't workingSomething isn't working
Description
Steps to reproduce
From a fresh installation and clean workspace:
- Window -> Preferences -> Java -> Installed JREs
- Add Java 21 (or at least 19 I would suppose)
- Window -> Preferences -> Java -> Compiler
- Compiler Compliance level => 17
- "Use '--release' option" checked
- Create a new Java Project
- Create a new Class
package foo;
import java.util.Locale;
class Main {
public static void main(String[] args) {
Locale l = new Locale("en", "US");
System.out.println(l.getCountry());
l = Locale.of("en", "US");
System.out.println(l.getCountry());
}
}
I tried
-
Right click on new project -> Properties -> Java Compiler
- "Enable project specific settings" checked
- "Use '--release option' UNchecked
- Apply and close
- Outcome in the Problems View is as I expect:
The constructor Locale(String, String) is deprecated since version 19
-
Right click on new project -> Properties -> Java Compiler
- "Enable project specific settings" checked
- "Use '--release option' checked
- Apply and close
- Outcome in the Problems View is as I expect:
The method of(String, String) is undefined for the type Locale
-
Right click on new project -> Properties -> Java Compiler
- "Enable project specific settings" UNchecked
- Apply and close
- Outcome in the Problems View is not as expected:
The constructor Locale(String, String) is deprecated since version 19
I expected: The method of(String, String) is undefined for the type Locale as the '--release' option is checked in the workspace settings.
Tested under this environment:
- OS & version: Windows 10
- Eclipse IDE/Platform version (as shown in Help > About): 2024-06 (4.32.0)
- Java 21.0.3+9 used for the JDK
Community
- I understand reporting an issue to this OSS project does not mandate anyone to fix it. Other contributors may consider the issue, or not, at their own convenience. The most efficient way to get it fixed is that I fix it myself and contribute it back as a good quality patch to the project.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working