1

I have the following non-generic method for getting a JListFixture using FEST:

public static JListFixture getJListFixtureNonGeneric(final FrameFixture frame) {
    return frame.list(new GenericTypeMatcher<MyClass>(MyClass.class) {
        @Override
        protected boolean isMatching(MyClass component) {
            return true;
        }
    });
}

I have the following generic method for getting a JListFixture using FEST:

public static <T extends Component> JListFixture getJListFixture(final FrameFixture frame, final Class<T> t) {
    return frame.list(new GenericTypeMatcher<T>(t) {
        @Override
        protected boolean isMatching(T component) {
            return true;
        }
    });
}

In Netbeans 7.3, the non-generic method compiles without error. The generic method however does not. The editor window does not show any compilation errors (No red lines at any line numbers). However, if I try to compile it by right-clicking on the project and clicking 'Test', I get the following error:

An exception has occurred in the compiler (1.7.0_21). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.

java.lang.AssertionError: Missing type variable in where clause T
    at com.sun.tools.javac.util.RichDiagnosticFormatter.unique(RichDiagnosticFormatter.java:234)
    at com.sun.tools.javac.util.RichDiagnosticFormatter.access$100(RichDiagnosticFormatter.java:67)
    at com.sun.tools.javac.util.RichDiagnosticFormatter$RichPrinter.visitTypeVar(RichDiagnosticFormatter.java:384)
    at com.sun.tools.javac.util.RichDiagnosticFormatter$RichPrinter.visitTypeVar(RichDiagnosticFormatter.java:326)
...
C:\myProject\nbproject\build-impl.xml:1248: The following error occurred while executing this line:
C:\myProject\nbproject\build-impl.xml:268: Compile failed; see the compiler error output for details.

Line 1248 in the stacktrace corresponds to the j2seproject3 element below:

<target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
    <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.test.dir}"/>
    <copy todir="${build.test.classes.dir}">
        <fileset dir="${test.test.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
    </copy>
</target>

Line 268 in the stacktrace points to the following below:

<javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">

...

Has anyone encountered this or know what to do to make it work? Is this, in fact a true bug?

Paul Bellora
  • 54,340
  • 18
  • 130
  • 181
user973479
  • 1,629
  • 5
  • 26
  • 48

0 Answers0