title: Annotation not working
body: <p>I'm working on an annotation which aims to it mandatory for a class to be immutable. Here the code of the processor:</p>
  
  <pre><code>@SupportedAnnotationTypes("archipel.immutability.IsImmutable")
  @SupportedSourceVersion(SourceVersion.RELEASE_6)
  public class IsImmutableProcessor extends AbstractProcessor {
  
      @Override
      public boolean process(Set&lt;? extends TypeElement&gt; annotations,
              RoundEnvironment roundEnv) {
          for (TypeElement type : annotations) {
              processMustBeImmutable(roundEnv, type);
          }
          return true;
      }
  
      private void processMustBeImmutable(RoundEnvironment env, TypeElement type) {
          for (Element element : env.getElementsAnnotatedWith(type)) {
              processClass(element);
          }
      }
  
      private void processClass(Element element) {
          boolean isFinal=false;
  
          for(Modifier modifier : element.getModifiers()) {
              if (modifier.equals(Modifier.FINAL)) {
                  isFinal=true;
                  break;
              }
          }
  
          if (!isFinal) {
              processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, "Class "+element+" is not immutable because it is not final");
          } else {
              for (Element subElement : element.getEnclosedElements()) {
                  if (subElement.getKind()==ElementKind.FIELD) {
                      isFinal=false;
  
                      for(Modifier modifier : subElement.getModifiers()) {
                          if (modifier.equals(Modifier.FINAL)) {
                              isFinal=true;
                              break;
                          }
                      }
                      if (!isFinal) {
                          processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, "Field "+element+" is not immutable because it is not final");
                      } else {
                          Element superElement = subElement.getEnclosingElement();
                          // TODO
                      }
                  }
              }
          }
      }
  
  }
  </code></pre>
  
  <p>The annotation itself is trivial, of course:</p>
  
  <pre><code>@Inherited
  @Target(ElementType.TYPE)
  @Retention(RetentionPolicy.SOURCE)
  public @interface IsImmutable {
  }
  </code></pre>
  
  <p>And I compile it with a Ant script:</p>
  
  <pre><code>&lt;project name="immutability" basedir="." default="main"&gt;
  
      &lt;property name="lib.dir" value="lib"/&gt;
  
      &lt;property name="src.dir" value="src"/&gt;
  
      &lt;property name="build.dir" value="build"/&gt;
      &lt;property name="classes.dir" value="${build.dir}/classes"/&gt;
      &lt;property name="meta.dir" value="${build.dir}/META-INF"/&gt;
      &lt;property name="jar.dir" value="${build.dir}/jar"/&gt;
  
      &lt;property name="processor-package"
          value="archipel.immutability" /&gt;
  
      &lt;property name="processor" value="${processor-package}.IsImmutableProcessor"/&gt;
  
      &lt;path id="classpath"&gt;
          &lt;fileset dir="${lib.dir}" includes="**/*.jar"/&gt;
          &lt;fileset dir="${classes.dir}"/&gt;
      &lt;/path&gt;
  
      &lt;target name="clean"&gt;
      &lt;delete dir="${build.dir}"/&gt;
      &lt;/target&gt;
  
      &lt;target name="compile" description="Compiles the code."&gt;
          &lt;mkdir dir="${classes.dir}"/&gt;
          &lt;javac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="classpath" /&gt;
      &lt;/target&gt;
  
      &lt;target name="jar" depends="compile"&gt;
          &lt;mkdir dir="${jar.dir}"/&gt;
          &lt;jar destfile="${jar.dir}/${ant.project.name}.jar"&gt;
              &lt;fileset dir="${classes.dir}"/&gt;
              &lt;service type="javax.annotation.processing.Processor" provider="archipel.immutability.IsImmutableProcessor"/&gt;
          &lt;/jar&gt;
      &lt;/target&gt;
  
      &lt;target name="main" depends="clean,jar"/&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>Problem is, something must be missing, because when I try to use the resulting annotation, provided by the resulting jar file, like the following, nothing happens:</p>
  
  <pre><code>@IsImmutable
  public class Immut {
  
      private int toto;
  
      public int getToto() {
          return toto;
      }
  
      public void setToto(int toto) {
          this.toto = toto;
      }
  
      public final static void main(String args[]) {
          Immut truc = new Immut();
          truc.setToto(5);
          truc.setToto(6);
      }
  
  }
  </code></pre>
  
  <p>Obviousy, this class is not final, and the class should signal an error in Eclipse. But it's not.</p>
  
  <p>Any idea?</p>
  
  <p><strong>Edit</strong>: The jar file I built with my build.xml seems correct: It contains the class files, and also a <code>META-INF/services/javax.annotation.processing.Processor</code> file, which contains <code>archipel.immutability.IsImmutableProcessor</code>. I import this jar file in my test project, and when I use the annotation in my Immut class (which is only a rough test), nothing happens.</p>