Skip to content

Commit

Permalink
modified equals in TableFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan-nikitko committed Feb 22, 2023
1 parent 9e75b60 commit 4bc82cd
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
import java.util.regex.Pattern;

Expand Down Expand Up @@ -138,8 +139,15 @@ public boolean equals(Object o) {

TableFilter that = (TableFilter) o;

return excludes.equals(that.excludes)
&& includes.equals(that.includes);
Set<IncludeTableFilter> includeSet = new TreeSet<>(includes);
Set<IncludeTableFilter> thatIncludeSet = new TreeSet<>(that.includes);
Set<Pattern> excludeSet = new TreeSet<>(PatternFilter.PATTERN_COMPARATOR);
Set<Pattern> thatExcludeSet = new TreeSet<>(PatternFilter.PATTERN_COMPARATOR);
excludeSet.addAll(excludes);
thatExcludeSet.addAll(that.excludes);

return includeSet.equals(thatIncludeSet)
&& excludeSet.equals(thatExcludeSet);

}

Expand Down

0 comments on commit 4bc82cd

Please sign in to comment.