objectionary / objectionary/lints
`excluded` names in `LtUnlintNonExistingDefect` are always empty in production
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 14
- Forks
- 39
- Avg merge
- 22h 54m
- Merged PRs (30d)
- 90
Description
LtUnlintNonExistingDefect carries an excluded collection (src/main/java/org/eolang/lints/LtUnlintNonExistingDefect.java:34) and passes it to DefectMissing at line 74, where it is consulted at DefectMissing.java:50, :64 and :82. The only production callers, PkMono.java:53 and MonoLints.java:40, both use the one-argument constructor, which sets excluded to new ListOf<>() at line 42. Outside of tests every !this.excluded.contains(name) is always true, and the two-argument constructor is reached only from LtUnlintNonExistingDefectTest and DefectMissingTest.
The list existed to skip WPA lint names (PkMono passed new ListOf<>(new WpaLintNames()) since f5aef525). 235cda2d removed WPA and switched PkMono to the one-argument constructor but kept the parameter. Since then, returnsFalseWhenRangeReferencesExcludedAbsentLint in DefectMissingTest.java:104 locks down behavior no caller can trigger, and the real exclusion path, WithoutLints in MonoWithout.java:28, has a dead twin next to it.
Dropping the excluded attribute from both classes together with the two-argument constructor, and moving the tests to the one-argument form, leaves production behavior unchanged.
@yegor256
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/main/java/org/eolang/lints/LtUnlintNonExistingDefect.java and DefectMissing.java, then inspect the production callers in PkMono.java and MonoLints.java. Run LtUnlintNonExistingDefectTest and DefectMissingTest, including the excluded-name case, and confirm the one-argument construction and existing production behavior remain covered without the unused exclusion path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 84/100