openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1681984 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans: logger/WebBeansLoggerFacade.java portable/AbstractAnnotated.java
Date Wed, 27 May 2015 11:29:36 GMT
Author: struberg
Date: Wed May 27 11:29:36 2015
New Revision: 1681984

URL: http://svn.apache.org/r1681984
Log:
OWB-989 don't throw NPEs

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/logger/WebBeansLoggerFacade.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AbstractAnnotated.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/logger/WebBeansLoggerFacade.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/logger/WebBeansLoggerFacade.java?rev=1681984&r1=1681983&r2=1681984&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/logger/WebBeansLoggerFacade.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/logger/WebBeansLoggerFacade.java
Wed May 27 11:29:36 2015
@@ -127,7 +127,7 @@ public final class WebBeansLoggerFacade
 
         if (WB_BUNDLE == null)
         {
-            throw new NullPointerException("ResourceBundle can not be null");
+            throw new IllegalStateException("ResourceBundle can not be null");
         }
         try
         {

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AbstractAnnotated.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AbstractAnnotated.java?rev=1681984&r1=1681983&r2=1681984&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AbstractAnnotated.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AbstractAnnotated.java
Wed May 27 11:29:36 2015
@@ -28,6 +28,7 @@ import java.util.Set;
 import javax.enterprise.inject.spi.Annotated;
 
 import org.apache.webbeans.config.WebBeansContext;
+import org.apache.webbeans.util.Asserts;
 import org.apache.webbeans.util.GenericsUtil;
 
 /**
@@ -56,14 +57,9 @@ abstract class AbstractAnnotated impleme
      */
     protected AbstractAnnotated(WebBeansContext webBeansContext, Type baseType)
     {
-        if (webBeansContext == null)
-        {
-            throw new NullPointerException("no WebBeansContext");
-        }
-        if (baseType == null)
-        {
-            throw new NullPointerException("no base type");
-        }
+        Asserts.assertNotNull(webBeansContext, Asserts.PARAM_NAME_WEBBEANSCONTEXT);
+        Asserts.assertNotNull(baseType, "base type");
+        
         this.baseType = baseType;
         this.webBeansContext = webBeansContext;
     }



Mime
View raw message