pushtorefresh / storio

Reactive API for SQLiteDatabase and ContentResolver.
Apache License 2.0
2.55k stars 182 forks source link

AnnotationProcessor fail with AutoValue #797

Closed Sar777 closed 7 years ago

Sar777 commented 7 years ago

Hi, I am using AutoValue and have this result:

@AutoValue
@StorIOSQLiteType(table = CharactersTable.TABLE)
public abstract class LocalCharacter {

    @NonNull
    @StorIOSQLiteColumn(name = CharactersTable.COLUMN_GUID, key = true)
    public abstract Long guid();

    @NonNull
    @StorIOSQLiteColumn(name = CharactersTable.COLUMN_NAME)
    public abstract String name();

    @NonNull
    @StorIOSQLiteColumn(name = CharactersTable.COLUMN_RACE)
    public abstract Integer race();

    @NonNull
    @StorIOSQLiteColumn(name = CharactersTable.COLUMN_CLASS)
    public abstract Integer clazz();

    @NonNull
    @StorIOSQLiteColumn(name = CharactersTable.COLUMN_GENDER)
    public abstract Integer gender();

    @NonNull
    @StorIOSQLiteColumn(name = CharactersTable.COLUMN_MONEY)
    public abstract Long money();

    @NonNull
    @StorIOSQLiteColumn(name = CharactersTable.COLUMN_TOTAL_KILLS)
    public abstract Integer totalKills();

    @NonNull
    @StorIOSQLiteColumn(name = CharactersTable.COLUMN_TODAY_KILLS)
    public abstract Integer todayKills();

    @NonNull
    @StorIOSQLiteColumn(name = CharactersTable.COLUMN_YESTERDAY_KILLS)
    public abstract Integer yesterdayKills();

    @StorIOSQLiteCreator
    static LocalCharacter create(@NonNull Long guid, @NonNull String name, @NonNull Integer race, @NonNull Integer clazz, @NonNull Integer gender, @NonNull Long money, @NonNull Integer totalKills, @NonNull Integer todayKills, @NonNull Integer yesterdaykills) {
        return new AutoValue_LocalCharacter(guid, name, race, clazz, gender, money, totalKills, todayKills, yesterdaykills);
    }
}

Error: Error:Problem occurred with StorIOProcessor: -1

AutoValue: 1.4.1 StorIO: 1.13.0

Sorry my bad english. Thx.

geralt-encore commented 7 years ago

Thanks for reporting! I'll look into it as soon as I can.

Sar777 commented 7 years ago

@geralt-encore thx.

geralt-encore commented 7 years ago

@Sar777 yesterdayKills column doesn't match creators parameter yesterdaykills. There is PR with a meaningful error message instead of cryptic Error:Problem occurred with StorIOProcessor: -1.

Sar777 commented 7 years ago

@geralt-encore shit.. Nice catch. thx.