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

Add failing test case for class generated by Groovy compiler #2146

Merged

Conversation

tmoschou
Copy link
Contributor

This PR adds a failing test case for Groovy class that is causing Spotbugs to throw edu.umd.cs.findbugs.ba.CFGBuilderException. It does not fix the issue. Refer to #2145

  • Groovy compilation support is added to spotbugsTestCases/build.gradle
  • AbstractIntegrationTest has been cleaned up / refactored to additionally search for .class files generated by the Groovy compiler. At the same time simplifies some fall-back search path logic (e.g. presumably left over code for nonexistent java9/ directory) and switches use of java.io.File over to the java.nio.file package instead.

Make sure these boxes are checked before submitting your PR -- thank you!

  • Added an entry into CHANGELOG.md if you have changed SpotBugs code
    NOTE: No fix in this PR

This modifies spotbugsTestCases/build.gradle to add Groovy support and
cleans up / refactors the AbstractIntegrationTest to read .class files generated
by the Groovy compiler. At the same time simplifies some logic and switches use
of java.io.File over to the java.nio.file package instead.
ThrawnCA
ThrawnCA previously approved these changes Aug 22, 2022
Signed-off-by: Kengo TODA <skypencil@gmail.com>
Signed-off-by: Kengo TODA <skypencil@gmail.com>
Signed-off-by: Kengo TODA <skypencil@gmail.com>
@KengoTODA KengoTODA force-pushed the bug/2145-groovy-class-test-case-error branch from de39725 to d48728d Compare August 28, 2022 09:20
KengoTODA
KengoTODA previously approved these changes Aug 28, 2022
Copy link
Member

@KengoTODA KengoTODA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR!
I confirmed that the bug comes from 771f26f which assumes the size of field is always 1. I will wait for review from other teammates to merge this fix and your test case. I had misunderstanding about the intention of existing code, I will reconsider my fix.

Signed-off-by: Kengo TODA <skypencil@gmail.com>
Signed-off-by: Kengo TODA <skypencil@gmail.com>
Copy link
Member

@KengoTODA KengoTODA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a new fix that treats dup_x1 and dup_x2 in a better way.

@KengoTODA
Copy link
Member

I believe this PR can close #2145. This PR also close #1386.

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.

CFGBuilderException when assigning double or long in groovy constructor
3 participants