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

Fixed FindDeadLocalStores to handle LOOKUPSWITCH and TABLESWITCH #2937

Merged
merged 5 commits into from Apr 21, 2024

Conversation

gtoison
Copy link
Contributor

@gtoison gtoison commented Apr 10, 2024

A Java switch might be compiled into a LOOKUPSWITCH or TABLESWITCH. The corresponding BCEL classes both extends Select so we can use that class for the test.

LOOKUPSWITCH and TABLESWITCH both extend Select, use the base class to
detect the start of a switch in FindDeadLocalStores
Updated the line numbers of expected bugs
@gtoison gtoison changed the title Added more tests for #2782 false positives Fixed FindDeadLocalStores to handle LOOKUPSWITCH and TABLESWITCH Apr 20, 2024
@gtoison gtoison marked this pull request as ready for review April 21, 2024 06:35
@hazendaz hazendaz added this to the Spotbugs 4.8.5 milestone Apr 21, 2024
@hazendaz hazendaz merged commit a197132 into spotbugs:master Apr 21, 2024
12 of 15 checks passed
@hazendaz hazendaz self-assigned this Apr 21, 2024
gtoison added a commit to gtoison/spotbugs that referenced this pull request May 6, 2024
When looking for a switch the instruction might be LOOKUPSWITCH or
TABLESWITCH. Look for Select which is the base class for both.
See spotbugs#2782
See spotbugs#2937
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 this pull request may close these issues.

None yet

3 participants