Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UWF_NULL_FIELD doesn't report line number #1368

Closed
lolgab opened this issue Nov 10, 2020 · 1 comment · Fixed by #1424
Closed

UWF_NULL_FIELD doesn't report line number #1368

lolgab opened this issue Nov 10, 2020 · 1 comment · Fixed by #1424

Comments

@lolgab
Copy link

lolgab commented Nov 10, 2020

Hi :)
Thank you for this wonderful tool :)
We noticed at @codacy that the rule UWF_NULL_FIELD doesn't report any line number.
We're using Spotbugs API to get results line numbers using bugInstance.getPrimarySourceLineAnnotation.getStartLine
For this rule it reports -1

@welcome
Copy link

welcome bot commented Nov 10, 2020

Thanks for opening your first issue here! 😃
Please check our contributing guideline. Especially when you report a problem, make sure you share a Minimal, Complete, and Verifiable example to reproduce it in this issue.

@lolgab lolgab changed the title UWF_NULL_FIELD doesn't report UWF_NULL_FIELD doesn't report line number Nov 10, 2020
KengoTODA added a commit that referenced this issue Feb 11, 2021
* test: reproduce the reported issue by JUnit

* fix: report line number with UWF_NULL_FIELD bug instance

close #1368

* build: ignore problems detected by SpotBugs in spotbugs-tests project

* fix: do not clear data.fieldAccess when field is read

The data is still necessary for `UWF_NULL_FIELD` bug pattern.
This change increases memory footprint, then make sure the data
is cleared when the detector finishes computation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant