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

Some private fields aren't marked as not used when they should

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

Description

It the following class is defined:

```java
public class Test {
@javax.ejb.EJB
private Object ejb;

@javax.inject.Inject
private Object inject;

@javax.ws.rs.core.Context
private Object context;
}
```

And the compiler is set to show a warning if a private member isn't used, the field `ejb` and `context` aren't marked but `inject` is.

¿Is there some kind of exception for `javax.inject.Inject`?

I think all of these fields should be marked as not used, they aren't being used internally on the class, like what happens with the `inject` field.

![Screenshot from 2023-05-11 11-57-48](https://github.com/eclipse-jdt/eclipse.jdt.core/assets/1652983/98d8370d-3bc7-4ffe-9d4c-61be96fdf713)

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.