Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

@Pref not processed on project->clean #450

@KoljaTM

Description

@KoljaTM

I am using a @SharedPref, that I am referencing as a @PREF in other classes. It gets generated correctly on incremental builds, i.e. when I save the enclosing file. But on project->clean it is missing.
I have debugged a bit and found (I hope) the most likely culprit for my problem. When the annotations are processed, in the "clean-case", the @SharedPrefs class doesn't exist yet. This case is guarded against by this statement:
com.googlecode.androidannotations.helper.ValidatorHelper.isSharedPreference(Element, AnnotationElements, IsValid):Line 637

        if (type instanceof ErrorType) {

However this doesn't seem to work correctly (at least not in my eclipse version). Adding

        if (type instanceof ErrorType || type.getKind() == TypeKind.ERROR) {

and the same in com.googlecode.androidannotations.processing.PrefProcessor.process(Element, JCodeModel, EBeanHolder)
however did work. I would think that checking the Kind that is explicitly returned would be better than checking a class, but I don't know the details here very well.
Will you investigate this further on your own or do you want me to create a pull request?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions