Generics compilation error
-
11-11-2019 - |
Question
Error appears in android project using ormlite I get compilation error on this code:
public class DatabaseModel {
private Dao<Object, Integer> mDao = null;
private DatabaseHelper mHelper;
private Class<?> mClass;
public DatabaseModel(DatabaseHelper h, Class<?> c) {
mHelper = h;
mClass = c;
try {
mDao = mHelper.getDao(mClass);
} catch (SQLException e) {
Debug.e("Can't get dao", e.getStackTrace());
throw new RuntimeException(e);
}
}
on line 25 mDao = mHelper.getDao(mClass);
Error: type parameters of <D>D cannot be determined; no unique maximal
instance exists for type variable D with upper bounds
com.j256.ormlite.dao.Dao<java.lang.Object,java.lang.Integer>,
com.j256.ormlite.dao.Dao<capture#296 of ?,?>
But when i tries to build project using eclipse it works fine
The error looks similar to this SO question.
I don't know whether this bug of Idea or javac.
My configuration: IntelliJ IDEA 11.0.2 Build #IC-111.277 Built on 1 Февраль 2012 г. JDK: 1.6.0_29 VM: Java HotSpot(TM) 64-Bit Server VM Vendor: Apple Inc.
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow