False collection warnings
- Dominant language
- Java
- Stars
- 3.1k
- Forks
- 935
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 17
Description
### Apache NetBeans version
Apache NetBeans 17
### What happened
There are many cases in which Netbeans won't recognize, that a collection has been accessed, one of them are functional operators. But it also gives this warning for class variables when they have been passed to the outside as method result, also when wrapped in a unmodifiable collection.

### How to reproduce
` var allDirs = new ArrayList();
allDirs.add(new File("directoryname"));
allDirs.forEach(oneDir -> System.out.println(oneDir.getName()));
`
### Did this work correctly in an earlier version?
No / Don't know
### Operating System
Windows 10
### JDK
17
### Apache NetBeans packaging
Apache NetBeans provided installer
### Anything else
All the time.
It's nothing serious, just annoying.
### Are you willing to submit a pull request?
No
Contributor guide
Research direction
Start by reproducing the warning in Apache NetBeans 17 with the provided ArrayList and forEach example on Windows 10/JDK 17. Investigate the collection-access analysis behind this inspection, including cases where a class variable is returned or wrapped in an unmodifiable collection. Done means valid collection accesses no longer produce false warnings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100