Uploaded image for project: 'CAL10N'
  1. CAL10N
  2. CAL-40

Compile-time verifier extracts non Enum constants and block compilation

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • None
    • None
    • None
    • Oracle JDK 6 and OpenJDK 7

    Description

      THIS AFFECTS VERSION 0.8.1 WHICH IS NOT IN JIRA!!!

      I have an enum which contains these fields public static final String FLAG_KEY and private final Type type. The AnnotationProcessor extracts not only the enum constants but also these fields.

      The output is:

      /MyEnum.java:[9,8] Key [FLAG_KEY] present in enum type 
      

      .

      The problem is this method:

       @Override
        public List<String> extractKeysInEnum() {
          List<String> keyList = new ArrayList<String>();
          for (VariableElement ve : ElementFilter.fieldsIn(typeElementForEnum.getEnclosedElements())) {
            keyList.add(ve.getSimpleName().toString());
          }
          return keyList;
        }
      

      getEnclosedElements returns these elements and breaks the build.

      Attachments

        Activity

          People

            ceki Ceki Gülcü
            michael-o Michael Osipov
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: