title: injecting an enum as a dependency fails with IllegalArgumentException, probably due to proxying
body: <p>I have a Spring bean which expects among one of it's constructor parameters an enum. The enum is created inside the context with</p>
  
  <pre><code>@Bean
  public MyEnum stage() {
      return MyEnum.VALUE1; /// actually here is some logic implemented to determin what enum value should get returned.
  }
  </code></pre>
  
  <p>When I start up the ApplicatioContext I get the following exception</p>
  
  <pre><code>org.springframework.beans.BeanInstantiationException: Failed to instantiate [MyBean]: Illegal arguments for constructor; nested exception is java.lang.IllegalArgumentException: argument type mismatch
  // .... more stuff
  Caused by: java.lang.IllegalArgumentException: argument type mismatch
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
  at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)
  ... 47 more
  </code></pre>
  
  <p>I assume this is because Spring wraps the enum in a proxy, which I need to enable AOP. But I don't need a proxy around the enum. </p>
  
  <p><strong>Questions</strong>: </p>
  
  <ol>
  <li><p>Am I correct that the proxying of the enum is causing this problem?</p></li>
  <li><p>How can I avoid this problem? One approach would be to disable proxying for the enum, but how would I do that?</p></li>
  </ol>