openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1813058 - in /openwebbeans/trunk: webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java webbeans-tck/testng-dev.xml
Date Mon, 23 Oct 2017 18:34:51 GMT
Author: struberg
Date: Mon Oct 23 18:34:51 2017
New Revision: 1813058

URL: http://svn.apache.org/viewvc?rev=1813058&view=rev
Log:
OWB-1218 improve toString of producers

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java
    openwebbeans/trunk/webbeans-tck/testng-dev.xml

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java?rev=1813058&r1=1813057&r2=1813058&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
Mon Oct 23 18:34:51 2017
@@ -391,11 +391,22 @@ public abstract class AbstractOwbBean<T>
         }
         
         builder.append("]");
+
+        addToStringInfo(builder);
         
         return builder.toString();
     }
 
     /**
+     * This method can be used to add additional info about the Bean
+     * @param builder
+     */
+    protected void addToStringInfo(StringBuilder builder)
+    {
+        // by default we do nothing
+    }
+
+    /**
      * The Logger should really only be used to log errors!
      */
     protected synchronized Logger getLogger()

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java?rev=1813058&r1=1813057&r2=1813058&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java
Mon Oct 23 18:34:51 2017
@@ -53,8 +53,8 @@ public class AbstractProducerBean<T> ext
     {
         super(ownerComponent.webBeansContext, webBeansType, beanAttributes, ownerComponent.getBeanClass(),
!returnType.isPrimitive());
         this.returnType = returnType;
-        producer = producerFactory.createProducer(this);
         this.ownerComponent = ownerComponent;
+        producer = producerFactory.createProducer(this);
     }
 
     @Override
@@ -112,4 +112,15 @@ public class AbstractProducerBean<T> ext
 
         return true;
     }
+
+    /**
+     * For producer beans we add the info about the owner component
+     */
+    @Override
+    protected void addToStringInfo(StringBuilder builder)
+    {
+        Class<?> returnType = ownerComponent.getBeanClass();
+        builder.append(", OwnerBean Class: ")
+            .append(returnType != null ? returnType.getName() : "null");
+    }
 }

Modified: openwebbeans/trunk/webbeans-tck/testng-dev.xml
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-tck/testng-dev.xml?rev=1813058&r1=1813057&r2=1813058&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-tck/testng-dev.xml (original)
+++ openwebbeans/trunk/webbeans-tck/testng-dev.xml Mon Oct 23 18:34:51 2017
@@ -18,7 +18,7 @@
 <suite name="JSR-346-TCK" verbose="2" configfailurepolicy="continue">
   <test name="JSR-346 TCK">
     <classes>
-          <class name="org.jboss.cdi.tck.tests.event.observer.async.handlingExceptions.MultipleExceptionsInObserversNotificationTest"
/>
+          <class name="org.jboss.cdi.tck.tests.event.broken.raw.RawEventDisposerInjectionTest"
/>
       <!--
 
       <class name="org.jboss.cdi.tck.tests.event.parameterized.ParameterizedEventTest"
/>



Mime
View raw message