eclipse-jdt / eclipse-jdt/eclipse.jdt.core

workspace '--release' setting ignored by Problems View

Open
#2,737 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
237
Forks
195
Avg merge
1d 12h
Merged PRs (30d)
47

Description

Moved from here: https://github.com/eclipse-platform/eclipse.platform.ui/issues/2117

## Steps to reproduce

From a fresh installation and clean workspace:

1. Window -> Preferences -> Java -> Installed JREs
* Add Java 21 (or at least 19 I would suppose)
2. Window -> Preferences -> Java -> Compiler
* Compiler Compliance level => 17
* "Use '--release' option" checked
3. Create a new Java Project
4. 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

1. 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`

2. 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`

3. 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.