Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-1368

Cannot find a specialized producer on JDK 1.7, it works on JDK 1.6

    Details

    • Steps to Reproduce:
      Hide
      1. In the directory of attached 'reproducer.zip'
        $ JAVA_HOME=/path/to/jdk1.6home mvn clean test -Dmaven.compiler.target=1.6 -Dmaven.compiler.sorce=1.6
        (Test passed)
        $ JAVA_HOME=/path/to/jdk1.7home mvn clean test -Dmaven.compiler.target=1.7 -Dmaven.compiler.sorce=1.7
        (Error in Weld bootstrap process)
      Show
      In the directory of attached 'reproducer.zip' $ JAVA_HOME=/path/to/jdk1.6home mvn clean test -Dmaven.compiler.target=1.6 -Dmaven.compiler.sorce=1.6 (Test passed) $ JAVA_HOME=/path/to/jdk1.7home mvn clean test -Dmaven.compiler.target=1.7 -Dmaven.compiler.sorce=1.7 (Error in Weld bootstrap process)

      Description

      Suppose there is a specialized producer method (with @Produces and @Specializes annotations) that overrides its superclass's producer method. If you add a method to the superclass, Weld fails to find the overridden producer method on JDK 1.7. The same program works on JDK 1.6.

      Here is the stack trace from a test case.
      -------------------------------------------------------------------------------
      Test set: com.example.test.SpecializedProducerTest
      -------------------------------------------------------------------------------
      Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.845 sec <<< FAILURE!
      com.example.test.SpecializedProducerTest Time elapsed: 0 sec <<< ERROR!
      org.jboss.weld.exceptions.IllegalStateException: WELD-000078 Specialized producer method does not override a method on the direct superclass: Producer Method [TestBean3] with qualifiers [@Any @Default] declared as [[method] @Produces @Specializes public com.example.test.SpecializedProducer$TestProducer3.testBean()]
      at org.jboss.weld.bean.ProducerMethod.specialize(ProducerMethod.java:252)
      at org.jboss.weld.bean.AbstractBean.initialize(AbstractBean.java:125)
      at org.jboss.weld.bean.AbstractReceiverBean.initialize(AbstractReceiverBean.java:50)
      at org.jboss.weld.bean.AbstractProducerBean.initialize(AbstractProducerBean.java:182)
      at org.jboss.weld.bean.ProducerMethod.initialize(ProducerMethod.java:115)
      at org.jboss.weld.bootstrap.AbstractBeanDeployer.deploy(AbstractBeanDeployer.java:116)
      at org.jboss.weld.bootstrap.BeanDeployment.deployBeans(BeanDeployment.java:217)
      at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:357)
      at org.jboss.arquillian.container.weld.se.embedded_1_1.WeldSEContainer.deploy(WeldSEContainer.java:136)
      at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:161)
      at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:128)
      at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.executeOperation(ContainerDeployController.java:271)
      at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deploy(ContainerDeployController.java:127)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      ...

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                swd847 Stuart Douglas
                Reporter:
                osamu.nagano Osamu Nagano
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: