[webbeans-commits] Webbeans SVN: r3698 - in ri/branches/kabir-builder: impl/src/main/java/org/jboss/webbeans/bootstrap and 2 other directories.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Thu Sep 17 12:23:55 EDT 2009


Author: kabir.khan at jboss.com
Date: 2009-09-17 12:23:54 -0400 (Thu, 17 Sep 2009)
New Revision: 3698

Added:
   ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/builder/sorter/EmployeeProducer.java
   ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/builder/sorter/SpecializedEmployeeProducer.java
Modified:
   ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethod.java
   ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java
   ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/builder/sorter/Sorter.java
Log:
@Specialized on producer methods need to be taken into account, as well @Specialized on class itself which was already done. TCK back at 100%, time to clean up the code

Modified: ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethod.java
===================================================================
--- ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethod.java	2009-09-17 15:02:18 UTC (rev 3697)
+++ ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethod.java	2009-09-17 16:23:54 UTC (rev 3698)
@@ -271,7 +271,6 @@
    @Override
    protected void specialize(BeanDeployerEnvironment environment)
    {
-      System.out.println("======> " + this);
       WBMethod<?, ?> superClassMethod = getDeclaringBean().getAnnotatedItem().getWBSuperclass().getWBMethod(getAnnotatedItem().getAnnotatedMethod());
       if (environment.getProducerMethod(superClassMethod) == null)
       {

Modified: ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java
===================================================================
--- ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java	2009-09-17 15:02:18 UTC (rev 3697)
+++ ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java	2009-09-17 16:23:54 UTC (rev 3698)
@@ -122,26 +122,6 @@
 
    public AbstractBeanDeployer createBeans()
    {
-//      for (WBClass<?> clazz : classes)
-//      {
-//         boolean managedBeanOrDecorator = !getEnvironment().getEjbDescriptors().contains(clazz.getJavaClass()) && isTypeManagedBeanOrDecorator(clazz);
-//         if (managedBeanOrDecorator && clazz.isAnnotationPresent(Decorator.class))
-//         {
-//            createDecorator(clazz);
-//         }
-//         else if (managedBeanOrDecorator && clazz.isAnnotationPresent(Interceptor.class))
-//         {
-//            //createInterceptor(clazz);
-//         }
-//         else if (managedBeanOrDecorator && !clazz.isAbstract())
-//         {
-//            createSimpleBean(clazz);
-//         }
-//      }
-//      for (InternalEjbDescriptor<?> ejbDescriptor : getEnvironment().getEjbDescriptors())
-//      {
-//         createEnterpriseBean(ejbDescriptor);
-//      }
       return this;
    }
 

Modified: ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/builder/sorter/Sorter.java
===================================================================
--- ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/builder/sorter/Sorter.java	2009-09-17 15:02:18 UTC (rev 3697)
+++ ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/builder/sorter/Sorter.java	2009-09-17 16:23:54 UTC (rev 3698)
@@ -30,6 +30,7 @@
 
 import javax.decorator.Decorator;
 import javax.inject.Inject;
+import javax.interceptor.Interceptor;
 
 import org.jboss.webbeans.BeanManagerImpl;
 import org.jboss.webbeans.ejb.EJBApiAbstraction;
@@ -103,6 +104,10 @@
             {
                decoratorItems.add(new DecoratorDeploymentItem(Collections.unmodifiableSet(unsortedItems), clazz));
             }
+            else if (clazz.isAnnotationPresent(Interceptor.class))
+            {
+               //Don't add as a bean
+            }
             else if (!clazz.isAbstract())
             {
                unsortedItems.add(new SimpleDeploymentItem(Collections.unmodifiableSet(unsortedItems), clazz));

Added: ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/builder/sorter/EmployeeProducer.java
===================================================================
--- ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/builder/sorter/EmployeeProducer.java	                        (rev 0)
+++ ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/builder/sorter/EmployeeProducer.java	2009-09-17 16:23:54 UTC (rev 3698)
@@ -0,0 +1,38 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.webbeans.test.unit.builder.sorter;
+
+import javax.enterprise.inject.Produces;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class EmployeeProducer
+{
+   @Produces
+   public Employee getEmployee()
+   {
+      return null;
+   }
+}

Added: ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/builder/sorter/SpecializedEmployeeProducer.java
===================================================================
--- ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/builder/sorter/SpecializedEmployeeProducer.java	                        (rev 0)
+++ ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/builder/sorter/SpecializedEmployeeProducer.java	2009-09-17 16:23:54 UTC (rev 3698)
@@ -0,0 +1,39 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.webbeans.test.unit.builder.sorter;
+
+import javax.enterprise.inject.Produces;
+import javax.enterprise.inject.Specializes;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class SpecializedEmployeeProducer extends EmployeeProducer
+{
+   @Produces @Override @Specializes
+   public Employee getEmployee()
+   {
+      return null;
+   }
+}




More information about the weld-commits mailing list