Skip to content

[java] Fix ImmutableField with conditionally assignment in ctors#3855

Merged
adangel merged 2 commits into
pmd:masterfrom
adangel:issue-3850
Mar 27, 2022
Merged

[java] Fix ImmutableField with conditionally assignment in ctors#3855
adangel merged 2 commits into
pmd:masterfrom
adangel:issue-3850

Conversation

@adangel

@adangel adangel commented Mar 17, 2022

Copy link
Copy Markdown
Member

Describe the PR

Fix ImmutableField with conditionally assignment in ctors

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.44.0 milestone Mar 17, 2022
@ghost

ghost commented Mar 17, 2022

Copy link
Copy Markdown
1 Message
📖 This changeset changes 0 violations,
introduces 1154 new violations, 0 new errors and 0 new configuration errors,
removes 460 violations, 0 errors and 3 configuration errors.
Full report
This changeset changes 0 violations,
introduces 1154 new violations, 0 new errors and 0 new configuration errors,
removes 460 violations, 0 errors and 3 configuration errors.
Full report

Generated by 🚫 Danger

@adangel adangel merged commit 55c089d into pmd:master Mar 27, 2022
@adangel adangel deleted the issue-3850 branch March 27, 2022 14:43
@C-Otto

C-Otto commented Mar 27, 2022

Copy link
Copy Markdown

This causes false positives with fields that are initialized via reflection, for example for @Autowired fields in Spring integration tests:

@DataJpaTest
class SomeRepositoryIT {
    @Autowired
    private SomeRepository repository;

    ...
}

Do you want me to file an issue for this? Tested with 6.44.0.

@adangel

adangel commented Mar 28, 2022

Copy link
Copy Markdown
Member Author

@C-Otto Thanks for testing. Yes, please create a new issue - 6.44.0 is done - whatever is broken needs to be fixed with a next version.

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] ImmutableField - false negative when field assigned in constructor conditionally

2 participants