1
votes

I tried to compile a still developing project that I got it from sourceforge. this is its address:. https://sourceforge.net/p/groove/code/5475/tree/groove/trunk/ I know that this project is well proved and it doesn't have any error but when I want to compile it, I encounter to this compile error:

error: incompatible types: Class&ltCAP#1> cannot be converted to Class&ltList&ltT>>
            this.valueType = (Class&ltList&ltT>>) new ArrayList().getClass();
where T is a type-variable:
    T extends Object declared in class SplitParser
where CAP#1 is a fresh type-variable:
    CAP#1 extends ArrayList from capture of ? extends ArrayList

The error is at this file, line 370: https://sourceforge.net/p/groove/code/5475/tree/groove/trunk/src/groove/util/parse/Parser.java Can anyone help me about this error? I compile this program using java 8, can this be the cause of error?

EDIT: Interestingly project was compiled in Eclipse without error, but still has error in Netbeans with same version of java. Can anyone knows why?

1
Can you provide the source code you are trying to compile? - Alexander Egger
@alexander.egger Code belongs to "Groove" project on sourceforge: sourceforge.net/p/groove/code/HEAD/tree/groove/trunk/src/groove/… Line 370 - m.farokhian
It's silly code, because it could just write ArrayList.class, and avoid the raw type and the unnecessary object creation. But moreover, ArrayList.class isn't a Class<List>, because it's a Class<ArrayList>. - Andy Turner
Hard to tell without code! - jokster
@AndyTurner there is no difference, still not working. isn't Class<Arraylist>, also a Class<List>? - m.farokhian

1 Answers

0
votes

Finally I found problem. It simply about not including some needed libraries in project! I was trying to open project with Netbeans but apparently project is well configured for opening in Eclipse . So used libraries automatically imported in eclipse bot not in Netbeans. in Netbeans, it is necessary to import all used library, manually.