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

Autocompletion suggest methods that are outside of the desired compliance level (and then fails to compile)

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

Description

## The problem
I get autocompletion proposals that are **outside** the compliance level specified in the project, _e.g._

![Image](https://github.com/user-attachments/assets/f52b72ae-d1f7-4872-9fa3-f65c97f2acba)

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
- Use JDK 17
- Write `Executors.newT` and open autocompletion

### Option Nr. 2
- Use JDK > 17 (I used **21**)
- Set the _Compiler compliance Level_ to 17 via project properties
- Write `Executors.newT` and open autocompletion

![Image](https://github.com/user-attachments/assets/a2dd48c7-1aca-4def-91a0-9b2391ebfb1f)

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.