title: No enum const class in Enum
body: <pre><code>public enum ProcessorFactory {
      A("ap") {
          Processor create() throws Exception {
              return new AProcessor();
          }
      },
  
      B("bp"){
          Processor create() throws Exception {
              return new BProcessor();
          }
      };
  
      abstract Processor create() throws Exception;
  
      public static Processor getProcessor(String product) throws Exception {
          ProcessorFactory factory = valueOf(product);
          return factory.create();
      }
  
      private String product;
  
      private ProcessorFactory(String product) {
          this.product = product;
      }
   }
  </code></pre>
  
  <p>Now when I try to call </p>
  
  <pre><code>ProcessorFactory.getProcessor("ap");
  </code></pre>
  
  <p>It throws above exception. Any ideas?</p>