Compilation error with Jack compiler and generics

125 Views Asked by At

I'm using an ORM for android called Squeaky and it generates code to avoid using reflection. The generated code worked ok when I wasn't using the new jack compiler but with it I get these errors:

ERROR: C:\...\app\build\generated\source\apt\prod\debug\...\domain\model\WeatherForecast$Configuration.java:24.20: The type WeatherForecast$Configuration must implement the inherited abstract method GeneratedTableMapper.fillRow(WeatherForecast, Cursor, ModelDao, Dao.ForeignRefresh[], TransientCache)

ERROR: C:\...\app\build\generated\source\apt\prod\debug\...\domain\model\WeatherForecast$Configuration.java:43.15: The method fillRow(WeatherForecast, Cursor, ModelDao, Dao.ForeignRefresh[], TransientCache) of type WeatherForecast$Configuration must override or implement a supertype method

Is this actually a bug in the generated code or could it a bug with the compiler?

Here is the generated class method with the problem

public final class WeatherForecast$Configuration implements GeneratedTableMapper<WeatherForecast> {
  public static final WeatherForecast$Configuration instance = new WeatherForecast$Configuration();

  FieldsEnum[] fields;

  ForeignCollectionInfo[] foreignConfigs;

  public WeatherForecast$Configuration() {
    this.fields = getFields();
    this.foreignConfigs = getForeignConfigs();
  }

  @Override
  public WeatherForecast createObject(Cursor results) throws SQLException {
    WeatherForecast data = new WeatherForecast();
    return data;
  }

  @Override
  public void fillRow(WeatherForecast data, Cursor results, ModelDao<WeatherForecast> modelDao, Dao.ForeignRefresh[] foreignRefreshMap, TransientCache objectCache) throws SQLException {
    if(!results.isNull(0))data.setStationId(results.getInt(0));
    if(!results.isNull(1))data.setTemperature(results.getFloat(1));
    if(!results.isNull(2))data.setHumidity(results.getInt(2));
    if(!results.isNull(3))data.setForecastCode(results.getInt(3));
    if(!results.isNull(4))data.setStartTime(results.getLong(4));
    if(!results.isNull(5))data.setEndTime(results.getLong(5));
    data.setIcon(results.getString(6));
  }

...
}

And the 2 interfaces that are inherited/being used:

GeneratedTableMapper.java

public interface GeneratedTableMapper<T> {
    T createObject(Cursor results) throws SQLException;

    void fillRow(T data, Cursor results, ModelDao<T> modelDao, Dao.ForeignRefresh[] foreignRefreshMap, TransientCache objectCache) throws SQLException;

    void assignId(T data, Object val);

    Object extractId(T data);

    void bindVals(SQLiteStatement stmt, T data) throws SQLException;

    void bindCreateVals(SQLiteStatement stmt, T data) throws SQLException;

    String objectToString(T data) throws SQLException;

    boolean objectsEqual(T d1, T d2) throws SQLException;

    TableInfo<T> getTableConfig() throws SQLException;

    void fillForeignCollection(T data, ModelDao<T> modelDao, String fieldName) throws SQLException;

    //Foreign

}

Dao.java

public interface Dao<T> {
    class ForeignRefresh {
        public final String field;
        public final ForeignRefresh[] refreshFields;

        public ForeignRefresh(String field) {
            this(field, null);
        }

        public ForeignRefresh(String field, ForeignRefresh[] refreshFields) {
            this.field = field;
            this.refreshFields = refreshFields;
        }
    }

    interface QueryModifiers<T> {
        QueryModifiers<T> orderBy(String s);

        QueryModifiers<T> limit(Integer i);

        QueryModifiers<T> offset(Integer i);

        QueryModifiers<T> foreignRefreshMap(ForeignRefresh[] foreignRefreshMap);

        List<T> list() throws SQLException;
    }

    T queryForId(Object id) throws SQLException;

...

    void refresh(T data) throws SQLException;

    void refresh(T data, ForeignRefresh[] foreignRefreshMap) throws SQLException;
...
}
0

There are 0 best solutions below