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

[java] Fix #3712: InsufficientStringBufferDeclaration setLength false positive #3745

Merged
merged 1 commit into from Jan 20, 2022

Conversation

gredler
Copy link
Contributor

@gredler gredler commented Jan 20, 2022

Describe the PR

Fix bug #3712 where StringBuilder.setLength(int) is incorrectly flagged when the initial constructor capacity cannot be determined.

Related issues

Ready?

  • Added unit tests for fixed bug/feature
  • Passing all unit tests
  • Complete build ./mvnw clean verify passes (checked automatically by github actions)
  • Added (in-code) documentation (if needed)

@adangel adangel added this to the 6.42.0 milestone Jan 20, 2022
@adangel adangel self-assigned this Jan 20, 2022
@pmd-test
Copy link

1 Message
📖 This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 3 configuration errors.
Full report

Generated by 🚫 Danger

Copy link
Member

@adangel adangel left a comment

Choose a reason for hiding this comment

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

Thanks, looks good!

@adangel adangel changed the title Fix #3712: InsufficientStringBufferDeclaration setLength false positive [java] Fix #3712: InsufficientStringBufferDeclaration setLength false positive Jan 20, 2022
adangel added a commit to adangel/pmd that referenced this pull request Jan 20, 2022
@adangel adangel merged commit f37a99d into pmd:master Jan 20, 2022
adangel added a commit to adangel/pmd that referenced this pull request Jan 20, 2022
[java] Fix pmd#3712: InsufficientStringBufferDeclaration setLength false
positive pmd#3745

* pr-3745:
  [doc] Update release notes (pmd#3712, pmd#3745)
  Fix pmd#3712: InsufficientStringBufferDeclaration false positive with
StringBuilder.setLength(0)
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.

[java] InsufficientStringBufferDeclaration false positive with StringBuilder.setLength(0)
3 participants