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 #4487: A false-positive about UnnecessaryConstructor and @Inject and @Autowired #4494

Merged
merged 4 commits into from
Apr 23, 2023

Conversation

LynnBroe
Copy link
Contributor

@LynnBroe LynnBroe commented Apr 21, 2023

Describe the PR

This PR excludes com.google.inject.Inject and org.springframework.beans.factory.annotation.Autowired which cause FP.

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)

@pmd-test
Copy link

pmd-test commented Apr 21, 2023

1 Message
📖 Compared to master:
This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 2 violations, 13 errors and 0 configuration errors.
Full report
Compared to master:
This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 2 violations, 13 errors and 0 configuration errors.
Full report
Compared to master:
This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 13 errors and 0 configuration errors.
Full report

Generated by 🚫 Danger

@jsotuyod jsotuyod changed the title Fix #4487 [java]A false-positive about UnnecessaryConstructor and @Inject [java] Fix #4487: A false-positive about UnnecessaryConstructor and @Inject Apr 21, 2023
Comment on lines 38 to 39
return Arrays.asList("javax.inject.Inject",
"com.google.inject.Inject");
Copy link
Member

Choose a reason for hiding this comment

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

we should probably also include Spring's @Autowired here…

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for comment. I will add Spring's @Autowired later

@jsotuyod jsotuyod changed the title [java] Fix #4487: A false-positive about UnnecessaryConstructor and @Inject [java] Fix #4487: A false-positive about UnnecessaryConstructor and @Inject and @Autowired Apr 23, 2023
jsotuyod added a commit that referenced this pull request Apr 23, 2023
@jsotuyod jsotuyod merged commit 7034d40 into pmd:master Apr 23, 2023
@jsotuyod
Copy link
Member

Thanks!

@adangel adangel added this to the 7.0.0 milestone Apr 24, 2023
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] UnnecessaryConstructor: false-positive with @Inject and @Autowired
4 participants