apache / apache/netbeans

Find usages not working

Open
#4,285 12 comments 0 reactions 0 assignees View on GitHub
Java kind:bug
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Apache NetBeans version

Apache NetBeans 14

### What happened

I have recently installed netbeans 14 (long time user of 8.1) and found the 'find usages' feature is not working in the following situation. Code (simplified) is like this:
```java
public class MyJPanel extends JPanel
{
protected static MyJPanel create()
{
return new MyJPanel();
}
private MyJPanel()
{
}
}
```

If I select find usages of the method create, netbeans reports zero usages; however I can manually navigate to the file that calls this create method.
~~Is this because the method is static? Find usages seems to work for some other methods that I've checked (non-static). I don't know if it's just this scenario where it's broken or other places too, so I'm nervous about trusting the accuracy of the find usages feature.~~
Update: I have discovered find usages not working also for some constructors (plain java objects, not static, not swing related).

### How to reproduce

As per problem description. This feature used to work ok under netbeans 8.1.

### Did this work correctly in an earlier version?

Apache NetBeans 12.3 or earlier

### Operating System

Win 10 Pro

### JDK

jdk1.8.0_111 32-bit (required as minimum supported version for our system)

### Apache NetBeans packaging

Apache NetBeans provided installer

### Anything else

Happens all the time.

### Are you willing to submit a pull request?

No

### Code of Conduct

Yes

Contributor guide

Open the contributing guide

Research direction

Start with the Java find-usages behavior described for Apache NetBeans 14, using the supplied static-method and constructor examples and comparing against NetBeans 12.3 or earlier. Done means find usages locates the manually confirmed callers for both methods and constructors; no source files or tests are named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
developer-experience
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.