This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
The following code compiles without problems (Java 8) but Netbeans indicates an error for line 2: 1: final javax.swing.table.TableRowSorter<? extends javax.swing.table.TableModel> sorter = null; 2: sorter.setRowFilter(javax.swing.RowFilter.andFilter(null)); The error is "incompatible types: RowFilter<CAP#1,Integer> cannot be converted to RowFilter<? super CAP#1,? super Integer>" Please ignore the fact that you would get NullPointerExceptions at runtime, the code is just to demonstrate the error and not supposed to be executed.
Please note that NetBeans process files using its bundled javac, which may differ in minor details from the platform. I cannot reproduce the defect in 8.2 release or dev trunk; it's possible that the defect was fixed in JDK/NB already.
Steps to reproduce: 1. Create new maven project for JDK 1.8 2. Create single class file: ---------------------------- package netbeans.bug; import static org.hamcrest.MatcherAssert.assertThat; import org.hamcrest.Description; import org.hamcrest.Matcher; import org.hamcrest.Matchers; public class Proof { public static void main(final String[] args) { assertThat(new Value("hello bug"), Matchers.both(okWithMatcherOne()).and(okWithMatcherTwo())); System.out.println("Bug detected."); } private static Matcher<? super Value> okWithMatcherOne() { return new MatcherOne(); } private static Matcher<? super Value> okWithMatcherTwo() { return new MatcherTwo(); } public static class MatcherOne implements Matcher<Value> { @Override public boolean matches(final Object item) { return true; } @Override public void describeMismatch(final Object item, final Description mismatchDescription) { throw new UnsupportedOperationException("Not implemented yet."); } @Override public void _dont_implement_Matcher___instead_extend_BaseMatcher_() { throw new UnsupportedOperationException("Not implemented yet."); } @Override public void describeTo(final Description description) { throw new UnsupportedOperationException("Not implemented yet."); } } public static class MatcherTwo implements Matcher<Value> { @Override public boolean matches(final Object item) { return true; } @Override public void describeMismatch(final Object item, final Description mismatchDescription) { throw new UnsupportedOperationException("Not implemented yet."); } @Override public void _dont_implement_Matcher___instead_extend_BaseMatcher_() { throw new UnsupportedOperationException("Not implemented yet."); } @Override public void describeTo(final Description description) { throw new UnsupportedOperationException("Not implemented yet."); } } public static class Value { final String data; Value(final String data) { this.data = data; } } } ----------------------- 3. Download all required libs from Maven repo. 4. Clean and Build the project. 5. Run the file. Result: [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building POCs 1.0.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- exec-maven-plugin:1.2.1:exec (default-cli) @ POCs --- Bug detected. [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.550s [INFO] Finished at: Mon Jun 19 17:12:27 BST 2017 [INFO] Final Memory: 11M/619M [INFO] ------------------------------------------------------------------------
Don't know how to attach screenshot, but in above class the string "okWithMatcherTwo()" is highlighted as error: "incompatible types: Matcher<CAP#1> can not be converted to Matcher<? super CAP#2>"
Windows 7, JDK 1.8.0_131