You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by db...@apache.org on 2010/08/05 19:59:09 UTC

svn commit: r982715 - /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java

Author: dblevins
Date: Thu Aug  5 17:59:09 2010
New Revision: 982715

URL: http://svn.apache.org/viewvc?rev=982715&view=rev
Log:
Have the option to not be so strict with callback interception signatures.  We may want another way to do this.

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java?rev=982715&r1=982714&r2=982715&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java Thu Aug  5 17:59:09 2010
@@ -179,6 +179,12 @@ public final class WebBeansUtil
 {
     private static final WebBeansLogger logger = WebBeansLogger.getLogger(WebBeansUtil.class);
 
+    /**
+     * Enforcing that interceptor callbacks should not be
+     * able to throw checked exceptions is configurable
+     */
+    public static boolean ENFORCE_CHECKED_EXCEPTION = true;
+
     // No instantiate
     private WebBeansUtil()
     {
@@ -910,7 +916,7 @@ public final class WebBeansUtil
                             + " must return void type");
                 }
 
-                if (ClassUtil.isMethodHasCheckedException(method))
+                if (ENFORCE_CHECKED_EXCEPTION && ClassUtil.isMethodHasCheckedException(method))
                 {
                     throw new WebBeansConfigurationException("@" + commonAnnotation.getSimpleName()
                             + " annotated method : " + method.getName() + " in class : " + clazz.getName()
@@ -996,7 +1002,7 @@ public final class WebBeansUtil
                             + " must return void type");
                 }
 
-                if (ClassUtil.isMethodHasCheckedException(method))
+                if (ENFORCE_CHECKED_EXCEPTION && ClassUtil.isMethodHasCheckedException(method))
                 {
                     throw new WebBeansConfigurationException("@" + commonAnnotation.getSimpleName()
                             + " annotated method : " + method.getName() + " in class : " + clazz.getName()



Re: svn commit: r982715 - /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java

Posted by Mark Struberg <st...@yahoo.de>.
hi david, how do you set this property ?
I really hate public flags ;)

Isn't ther an option to use our classic OpenWebBeansConfiguration?

LieGrue,
strub



----- Original Message ----
> From: "dblevins@apache.org" <db...@apache.org>
> To: commits@openwebbeans.apache.org
> Sent: Thu, August 5, 2010 7:59:09 PM
> Subject: svn commit: r982715 - 
>/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
>
> 
> Author: dblevins
> Date: Thu Aug  5 17:59:09 2010
> New Revision:  982715
> 
> URL:  http://svn.apache.org/viewvc?rev=982715&view=rev
> Log:
> Have the option to  not be so strict with callback interception signatures.  We 
>may want  another way to do this.
> 
> Modified:
>      
>openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
>
> 
> Modified: 
>openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
>
> URL: :  
>http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java?rev=982715&r1=982714&r2=982715&view=diff
>
> ==============================================================================
> --- 
>openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
> a (original)
> +++  
>openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
>  Thu Aug  5 17:59:09 2010
> @@ -179,6 +179,12 @@ public final class  WebBeansUtil
>  {
>      private static final WebBeansLogger logger  = 
>WebBeansLogger.getLogger(WebBeansUtil.class);
> 
> +     /**
> +     * Enforcing that interceptor callbacks should not  be
> +     * able to throw checked exceptions is  configurable
> +     */
> +    public static boolean  ENFORCE_CHECKED_EXCEPTION = true;
> +
>      // No  instantiate
>      private WebBeansUtil()
>      {
> @@  -910,7 +916,7 @@ public final class WebBeansUtil
>                               + " must  return void type");
>                   }
> 
> -                if  (ClassUtil.isMethodHasCheckedException(method))
> +                 if (ENFORCE_CHECKED_EXCEPTION &&  
>ClassUtil.isMethodHasCheckedException(method))
>                   {
>                       throw new WebBeansConfigurationException("@" +  
>commonAnnotation.getSimpleName()
>                               + " annotated method :  " + method.getName() + " 
>in class : " + clazz.getName()
> @@ -996,7 +1002,7 @@  public final class WebBeansUtil
>                               + " must return void  type");
>                  }
> 
> -                if  (ClassUtil.isMethodHasCheckedException(method))
> +                 if (ENFORCE_CHECKED_EXCEPTION &&  
>ClassUtil.isMethodHasCheckedException(method))
>                   {
>                       throw new WebBeansConfigurationException("@" +  
>commonAnnotation.getSimpleName()
>                               + " annotated method :  " + method.getName() + " 
>in class : " + clazz.getName()
> 
> 
>