openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rsandt...@apache.org
Subject svn commit: r1829357 - in /openwebbeans/branches/owb_1.7.x/webbeans-impl/src: main/java/org/apache/webbeans/config/BeansDeployer.java test/java/org/apache/webbeans/test/unittests/definition/NonStaticInnerClassTest.java
Date Tue, 17 Apr 2018 10:57:00 GMT
Author: rsandtner
Date: Tue Apr 17 10:57:00 2018
New Revision: 1829357

URL: http://svn.apache.org/viewvc?rev=1829357&view=rev
Log:
OWB-1240 move constructor check after managedBean check

Modified:
    openwebbeans/branches/owb_1.7.x/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
    openwebbeans/branches/owb_1.7.x/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/definition/NonStaticInnerClassTest.java

Modified: openwebbeans/branches/owb_1.7.x/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
URL: http://svn.apache.org/viewvc/openwebbeans/branches/owb_1.7.x/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java?rev=1829357&r1=1829356&r2=1829357&view=diff
==============================================================================
--- openwebbeans/branches/owb_1.7.x/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
(original)
+++ openwebbeans/branches/owb_1.7.x/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
Tue Apr 17 10:57:00 2018
@@ -1295,29 +1295,30 @@ public class BeansDeployer
         final Class<?> beanClass = type.getJavaClass();
         final WebBeansUtil webBeansUtil = webBeansContext.getWebBeansUtil();
 
-        // done separately to be able to swallow the logging when not relevant and avoid
to pollute logs
         try
         {
-            if (!webBeansUtil.isConstructorOk(type))
-            {
-                return false;
-            }
+            webBeansUtil.checkManagedBean(beanClass);
         }
-        catch (final TypeNotPresentException cnfe)
+        catch (final DefinitionException e)
         {
+            logger.log(Level.FINE, "skipped deployment of: " + beanClass.getName() + " reason:
" + e.getMessage());
+            logger.log(Level.FINER, "skipped deployment of: " + beanClass.getName() + " details:
", e);
             return false;
         }
 
+        // done separately to be able to swallow the logging when not relevant and avoid
to pollute logs
         try
         {
-            webBeansUtil.checkManagedBean(beanClass);
+            if (!webBeansUtil.isConstructorOk(type))
+            {
+                return false;
+            }
         }
-        catch (final DefinitionException e)
+        catch (final TypeNotPresentException cnfe)
         {
-            logger.log(Level.FINE, "skipped deployment of: " + beanClass.getName() + " reason:
" + e.getMessage());
-            logger.log(Level.FINER, "skipped deployment of: " + beanClass.getName() + " details:
", e);
             return false;
         }
+
         //we are not allowed to catch possible exceptions thrown by the following method
         webBeansUtil.checkManagedBeanCondition(beanClass);
         return true;

Modified: openwebbeans/branches/owb_1.7.x/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/definition/NonStaticInnerClassTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/branches/owb_1.7.x/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/definition/NonStaticInnerClassTest.java?rev=1829357&r1=1829356&r2=1829357&view=diff
==============================================================================
--- openwebbeans/branches/owb_1.7.x/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/definition/NonStaticInnerClassTest.java
(original)
+++ openwebbeans/branches/owb_1.7.x/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/definition/NonStaticInnerClassTest.java
Tue Apr 17 10:57:00 2018
@@ -19,7 +19,6 @@
 package org.apache.webbeans.test.unittests.definition;
 
 import org.apache.webbeans.test.AbstractUnitTest;
-import org.junit.Ignore;
 import org.junit.Test;
 
 import java.lang.annotation.ElementType;
@@ -27,14 +26,16 @@ import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
+import static org.junit.Assert.assertNull;
+
 public class NonStaticInnerClassTest extends AbstractUnitTest
 {
 
     @Test
-    @Ignore
     public void testNonStaticInnerClassShouldBeIgnored()
     {
         startContainer(InnerClass.class);
+        assertNull(getBean(InnerClass.class));
     }
 
 



Mime
View raw message