You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by st...@apache.org on 2012/07/18 19:10:59 UTC

svn commit: r1363021 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans: annotation/AnnotationManager.java container/BeanManagerImpl.java util/Asserts.java

Author: struberg
Date: Wed Jul 18 17:10:59 2012
New Revision: 1363021

URL: http://svn.apache.org/viewvc?rev=1363021&view=rev
Log:
OWB-666 remove Target==Type check for InterceptorBinding Stereotypes

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/AnnotationManager.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/Asserts.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/AnnotationManager.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/AnnotationManager.java?rev=1363021&r1=1363020&r2=1363021&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/AnnotationManager.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/AnnotationManager.java Wed Jul 18 17:10:59 2012
@@ -47,8 +47,6 @@ import javax.interceptor.InterceptorBind
 
 import java.io.Serializable;
 import java.lang.annotation.Annotation;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Target;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 import java.lang.reflect.Type;
@@ -472,16 +470,6 @@ public final class AnnotationManager
      * defined by the specification.
      * @param clazz stereotype class
      */
-    public void checkStereoTypeClass(Class<? extends Annotation> clazz)
-    {
-        checkStereoTypeClass(clazz, clazz.getDeclaredAnnotations());
-    }
-
-    /**
-     * Validates that given class obeys stereotype model
-     * defined by the specification.
-     * @param clazz stereotype class
-     */
     public void checkStereoTypeClass(Class<? extends Annotation> clazz, Annotation...annotations)
     {
         Asserts.nullCheckForClass(clazz);
@@ -512,18 +500,6 @@ public final class AnnotationManager
                             "annotation with value");
                 }
             }
-            else if (isInterceptorBindingAnnotation(annotType))
-            {
-                Target target = clazz.getAnnotation(Target.class);
-                ElementType[] type = target.value();
-
-                if (type.length != 1 && !type[0].equals(ElementType.TYPE))
-                {
-                    throw new WebBeansConfigurationException("Stereotype with @InterceptorBinding must be " +
-                            "defined as @Target{TYPE}");
-                }
-
-            }
         }
     }
 

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java?rev=1363021&r1=1363020&r2=1363021&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java Wed Jul 18 17:10:59 2012
@@ -160,10 +160,12 @@ public class BeanManagerImpl implements 
     private List<Class<?>> additionalInterceptorClasses = new ArrayList<Class<?>>();
 
     /**Additional interceptor binding types we got via Extensions */
-    private Map<Class<? extends Annotation>, Set<Annotation>> additionalInterceptorBindingTypes = new HashMap<Class<? extends Annotation>, Set<Annotation>>();
+    private Map<Class<? extends Annotation>, Set<Annotation>> additionalInterceptorBindingTypes
+            = new HashMap<Class<? extends Annotation>, Set<Annotation>>();
 
     /**
-     * This list contains additional qualifiers which got set via the {@link javax.enterprise.inject.spi.BeforeBeanDiscovery#addQualifier(Class)}
+     * This list contains additional qualifiers which got set via the
+     * {@link javax.enterprise.inject.spi.BeforeBeanDiscovery#addQualifier(Class)}
      * event function.
      */
     private List<Class<? extends Annotation>> additionalQualifiers = new ArrayList<Class<? extends Annotation>>();
@@ -310,7 +312,9 @@ public class BeanManagerImpl implements 
         {
             if (!singleContext.isActive())
             {
-                throw new ContextNotActiveException("WebBeans context with scope type annotation @" + scopeType.getSimpleName() + " does not exist within current thread");
+                throw new ContextNotActiveException("WebBeans context with scope type annotation @"
+                                                    + scopeType.getSimpleName()
+                                                    + " does not exist within current thread");
             }
             return singleContext;
         }
@@ -328,7 +332,8 @@ public class BeanManagerImpl implements 
                 {
                     if (found != null)
                     {
-                        throw new IllegalStateException("More than one active context exists with scope type annotation @" + scopeType.getSimpleName());
+                        throw new IllegalStateException("More than one active context exists with scope type annotation @"
+                                                        + scopeType.getSimpleName());
                     }
                     
                     found = otherContext;
@@ -338,7 +343,8 @@ public class BeanManagerImpl implements 
         
         if (found == null)
         {
-            throw new ContextNotActiveException("WebBeans context with scope type annotation @" + scopeType.getSimpleName() + " does not exist within current thread");
+            throw new ContextNotActiveException("WebBeans context with scope type annotation @"
+                                                + scopeType.getSimpleName() + " does not exist within current thread");
         }
         
         return found;

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/Asserts.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/Asserts.java?rev=1363021&r1=1363020&r2=1363021&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/Asserts.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/Asserts.java Wed Jul 18 17:10:59 2012
@@ -19,7 +19,6 @@
 package org.apache.webbeans.util;
 
 import java.lang.reflect.Method;
-import org.w3c.dom.Element;
 
 /**
  * Simple utility classes with some assertions methods.
@@ -105,14 +104,4 @@ public final class Asserts
         Asserts.assertNotNull(method, "method argument can not be null");
     }
 
-    /**
-     * Null check for element parameter.
-     * 
-     * @param element parameter
-     */
-    public static void nullCheckForDomElement(Element element)
-    {
-        Asserts.assertNotNull(element, "element argument can not be null");
-    }
-
 }