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

implement reportMissingClass(ClassDescriptor) next to reportMissingClass(ClassNotFoundException) #2234

Merged
merged 2 commits into from Oct 26, 2022

Conversation

kdnakt
Copy link
Contributor

@kdnakt kdnakt commented Oct 23, 2022

Fixed #219


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

  • Added an entry into CHANGELOG.md if you have changed SpotBugs code

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.

Classname in spotbugs has two formats: DottedClassName and SlashedClassName. Please use DottedClassNmae to keep new methods consistent with existing methods.

@@ -92,6 +92,16 @@ public void reportMissingClass(ClassNotFoundException ex) {
super.reportMissingClass(ex);
}

@Override
public void reportMissingClass(ClassDescriptor classDescriptor) {
String missing = classDescriptor.getClassName();
Copy link
Member

Choose a reason for hiding this comment

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

ClassDescriptor#getClassName() returns not DottedClassName but SlashedClassName, so better to use ClassDescriptor#getDottedClassName() to make this method consistent with reportMissingClass(ClassNotFoundException).

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 the review! I fixed my code.

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.

LGTM, thanks for your contribution!

@KengoTODA KengoTODA merged commit d572c2b into spotbugs:master Oct 26, 2022
@hazendaz hazendaz added this to the SpotBugs 4.8.0 milestone Dec 18, 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.

Missing classes not in report if using IErrorLogger.reportMissingClass(ClassDescriptor)
4 participants