--- old/src/share/classes/javax/swing/RowFilter.java 2014-07-02 23:35:13.000000000 -0700 +++ new/src/share/classes/javax/swing/RowFilter.java 2014-07-02 23:35:12.000000000 -0700 @@ -173,8 +173,7 @@ */ public static RowFilter regexFilter(String regex, int... indices) { - return (RowFilter)new RegexFilter(Pattern.compile(regex), - indices); + return new RegexFilter(Pattern.compile(regex), indices); } /** @@ -201,7 +200,7 @@ */ public static RowFilter dateFilter(ComparisonType type, Date date, int... indices) { - return (RowFilter)new DateFilter(type, date.getTime(), indices); + return new DateFilter(type, date.getTime(), indices); } /** @@ -224,7 +223,7 @@ */ public static RowFilter numberFilter(ComparisonType type, Number number, int... indices) { - return (RowFilter)new NumberFilter(type, number, indices); + return new NumberFilter(type, number, indices); } /** @@ -397,7 +396,7 @@ } - private static abstract class GeneralFilter extends RowFilter { + private static abstract class GeneralFilter extends RowFilter { private int[] columns; GeneralFilter(int[] columns) { @@ -405,7 +404,8 @@ this.columns = columns; } - public boolean include(Entry value){ + @Override + public boolean include(Entry value){ int count = value.getValueCount(); if (columns.length > 0) { for (int i = columns.length - 1; i >= 0; i--) { @@ -416,8 +416,7 @@ } } } - } - else { + } else { while (--count >= 0) { if (include(value, count)) { return true; @@ -428,11 +427,11 @@ } protected abstract boolean include( - Entry value, int index); + Entry value, int index); } - private static class RegexFilter extends GeneralFilter { + private static class RegexFilter extends GeneralFilter { private Matcher matcher; RegexFilter(Pattern regex, int[] columns) { @@ -443,15 +442,16 @@ matcher = regex.matcher(""); } + @Override protected boolean include( - Entry value, int index) { + Entry value, int index) { matcher.reset(value.getStringValue(index)); return matcher.find(); } } - private static class DateFilter extends GeneralFilter { + private static class DateFilter extends GeneralFilter { private long date; private ComparisonType type; @@ -464,8 +464,9 @@ this.date = date; } + @Override protected boolean include( - Entry value, int index) { + Entry value, int index) { Object v = value.getValue(index); if (v instanceof Date) { @@ -487,10 +488,7 @@ } } - - - - private static class NumberFilter extends GeneralFilter { + private static class NumberFilter extends GeneralFilter { private boolean isComparable; private Number number; private ComparisonType type; @@ -506,15 +504,16 @@ isComparable = (number instanceof Comparable); } + @Override @SuppressWarnings("unchecked") protected boolean include( - Entry value, int index) { + Entry value, int index) { Object v = value.getValue(index); if (v instanceof Number) { boolean compared = true; int compareResult; - Class vClass = v.getClass(); + Class vClass = v.getClass(); if (number.getClass() == vClass && isComparable) { compareResult = ((Comparable)number).compareTo(v); }