-
Enhancement
-
Resolution: Fixed
-
P4
-
6
-
b78
-
x86
-
windows_xp
FULL PRODUCT VERSION :
java version "1.6.0-rc"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-rc-b70)
Java HotSpot(TM) Client VM (build 1.6.0-rc-b70, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
The static methods datetFilter, regexFilter and numberFilter have a wrong return type (RowFilter<Object,Object>).
The real return type should be RowFilter<anytype,anytype>, one way to acheive this is to let the compiler infers the correct type.
regexFilter() should be typed as:
public static <M,I> RowFilter<M,I> regexFilter(String regex,int... indices) {
...
}
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
try to compile the test case
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
should compile.
ACTUAL -
see the error message
ERROR MESSAGES/STACK TRACES THAT OCCUR :
BugRowFilter.java:12: incompatible types
found : javax.swing.RowFilter<java.lang.Object,java.lang.Object>
required: javax.swing.RowFilter<javax.swing.table.TableModel,java.lang.Integer>
RowFilter.regexFilter("a.*");
^
Note: BugRowFilter.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.swing.RowFilter;
import javax.swing.table.TableModel;
public class BugRowFilter {
public static void main(String[] args) {
RowFilter<TableModel,Integer> rowFilter=
RowFilter.regexFilter("a.*");
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
add some casts :
RowFilter<TableModel,Integer> rowFilter=(RowFilter<TableModel,Integer>)
(RowFilter<?,?>)RowFilter.regexFilter("a.*");
java version "1.6.0-rc"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-rc-b70)
Java HotSpot(TM) Client VM (build 1.6.0-rc-b70, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
The static methods datetFilter, regexFilter and numberFilter have a wrong return type (RowFilter<Object,Object>).
The real return type should be RowFilter<anytype,anytype>, one way to acheive this is to let the compiler infers the correct type.
regexFilter() should be typed as:
public static <M,I> RowFilter<M,I> regexFilter(String regex,int... indices) {
...
}
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
try to compile the test case
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
should compile.
ACTUAL -
see the error message
ERROR MESSAGES/STACK TRACES THAT OCCUR :
BugRowFilter.java:12: incompatible types
found : javax.swing.RowFilter<java.lang.Object,java.lang.Object>
required: javax.swing.RowFilter<javax.swing.table.TableModel,java.lang.Integer>
RowFilter.regexFilter("a.*");
^
Note: BugRowFilter.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.swing.RowFilter;
import javax.swing.table.TableModel;
public class BugRowFilter {
public static void main(String[] args) {
RowFilter<TableModel,Integer> rowFilter=
RowFilter.regexFilter("a.*");
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
add some casts :
RowFilter<TableModel,Integer> rowFilter=(RowFilter<TableModel,Integer>)
(RowFilter<?,?>)RowFilter.regexFilter("a.*");
- duplicates
-
JDK-6386234 DefaultRowSorter get/setComparator() are not correctly typed
-
- Closed
-