Skip to content

Commit

Permalink
Fix Issue spotbugs#184
Browse files Browse the repository at this point in the history
The logic conditionals were entangled in an invalid way that produced
nonsense debug log messages. Simplified the logic and reduced the logic
branches to make the operation direct and thus fix the problem.
  • Loading branch information
Alex-Vol-Amz committed Jan 2, 2023
1 parent a6bf248 commit b801d2a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Currently the versioning policy of this project follows [Semantic Versioning v2.

### Fixed
- Fixed missing classes not in report if using IErrorLogger.reportMissingClass(ClassDescriptor) ([#219](https://github.com/spotbugs/spotbugs/issues/219))
- Fixed AbstractBugReporter emits wrong non-sensical debug output during filtering ([#184](https://github.com/spotbugs/spotbugs/issues/184))

#### Security
- Disable access to external entities when processing XML ([#2217](https://github.com/spotbugs/spotbugs/pull/2217))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,13 @@ public final void reportBug(@Nonnull BugInstance bugInstance) {
}
int priority = bugInstance.getPriority();
int bugRank = bugInstance.getBugRank();
if (priority <= priorityThreshold && bugRank <= rankThreshold) {
doReportBug(bugInstance);
if (priority > priorityThreshold) {
LOG.debug("AbstractBugReporter: Filtering due to priorityThreshold {} > {}", priority,
priorityThreshold);
} else if (bugRank > rankThreshold) {
LOG.debug("AbstractBugReporter: Filtering due to rankThreshold {} > {}", bugRank, rankThreshold);
} else {
if (priority <= priorityThreshold) {
LOG.debug("AbstractBugReporter: Filtering due to priorityThreshold {} > {}", priority,
priorityThreshold);
} else {
LOG.debug("AbstractBugReporter: Filtering due to rankThreshold {} > {}", bugRank, rankThreshold);
}
doReportBug(bugInstance);
}
}

Expand Down

0 comments on commit b801d2a

Please sign in to comment.