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

[core] Fix lazy init for allSuppressors in DefaultRuleViolationFactory #4057

Merged

Conversation

adangel
Copy link
Member

@adangel adangel commented Jul 22, 2022

Describe the PR

I've decided not to use AtomicReference as suggested but instead use a simpler approach with volatile. Both solution wouldn't avoid creating the HashSet more than once (for that we would need to synchronize completely), but that shouldn't hurt, since the result should always be the same (always the same suppressors in the Set).

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 7.0.0 milestone Jul 22, 2022
@pmd-test
Copy link

2 Messages
📖 Compared to pmd/7.0.x:
This changeset changes 10 violations,
introduces 4 new violations, 0 new errors and 0 new configuration errors,
removes 4 violations, 0 errors and 0 configuration errors.
Full report
📖 Compared to master:
This changeset changes 0 violations,
introduces 699659 new violations, 22 new errors and 0 new configuration errors,
removes 826993 violations, 39 errors and 6 configuration errors.
Full report

Generated by 🚫 Danger

@oowekyala oowekyala self-assigned this Jul 26, 2022
@oowekyala
Copy link
Member

Let's merge this. Notably, #4050 deletes this logic, but I think the problem is not there in the new implementation (ref https://github.com/pmd/pmd/pull/4050/files#diff-2d8622e9c0e2553c0669b29d50f28d891fb80e348ec02fc078919dfc001dfb7aR162).

@oowekyala oowekyala merged commit 131cb3a into pmd:pmd/7.0.x Jul 26, 2022
@adangel adangel mentioned this pull request Jan 23, 2023
55 tasks
@adangel adangel deleted the pmd7-issue-4035-lazy-init-suppressors branch January 26, 2023 08:04
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