Skip to content

Commit

Permalink
Further refine problems to be sorted by column when de-dupping
Browse files Browse the repository at this point in the history
  • Loading branch information
jshiell committed Jan 11, 2020
1 parent e62d22e commit af130be
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/main/java/org/infernus/idea/checkstyle/checker/Problem.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,15 @@ private ProblemHighlightType problemHighlightType() {
public int compareTo(@NotNull final Problem other) {
int lineComparison = Integer.compare(this.line, other.line);
if (lineComparison == 0) {
int severityComparison = -this.severityLevel.compareTo(other.severityLevel);
if (severityComparison == 0) {
return Objects.compare(this.message, other.message);
int columnComparison = Integer.compare(this.column, other.column);
if (columnComparison == 0) {
int severityComparison = -this.severityLevel.compareTo(other.severityLevel);
if (severityComparison == 0) {
return Objects.compare(this.message, other.message);
}
return severityComparison;
}
return severityComparison;
return columnComparison;
}
return lineComparison;
}
Expand Down

0 comments on commit af130be

Please sign in to comment.