openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1438446 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans: component/ container/ inject/impl/ intercept/ proxy/ util/
Date Fri, 25 Jan 2013 10:57:41 GMT
Author: struberg
Date: Fri Jan 25 10:57:40 2013
New Revision: 1438446

URL: http://svn.apache.org/viewvc?rev=1438446&view=rev
Log:
OWB-344 sonar cleanup 

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/impl/InjectionPointFactory.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorResolutionService.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/NormalScopeProxyFactory.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java

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=1438446&r1=1438445&r2=1438446&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
Fri Jan 25 10:57:40 2013
@@ -242,7 +242,7 @@ public abstract class AbstractOwbBean<T>
     {
         if (isPassivationCapable != null)
         {
-            return isPassivationCapable.booleanValue();
+            return isPassivationCapable;
         }
         if(Serializable.class.isAssignableFrom(getReturnType()))
         {

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=1438446&r1=1438445&r2=1438446&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
Fri Jan 25 10:57:40 2013
@@ -833,9 +833,8 @@ public class BeanManagerImpl implements 
             return true;
         }
         
-        for(int i = 0, size = additionalScopes.size(); i < size; i++)
+        for(ExternalScope ext : additionalScopes)
         {
-            ExternalScope ext = additionalScopes.get(i);
             if(ext.getScope().equals(annotationType))
             {
                 return true;
@@ -851,12 +850,11 @@ public class BeanManagerImpl implements 
 
         if (isNormal != null)
         {
-            return isNormal.booleanValue();
+            return isNormal;
         }
 
-        for(int i = 0, size = additionalScopes.size(); i < size; i++)
+        for(ExternalScope extScope : additionalScopes)
         {
-            ExternalScope extScope = additionalScopes.get(i);
             if (extScope.getScope().equals(scopeType))
             {
                 isScopeTypeNormalCache.put(scopeType, extScope.isNormal());
@@ -872,9 +870,8 @@ public class BeanManagerImpl implements 
     
     public boolean isPassivatingScope(Class<? extends Annotation> annotationType)
     {
-        for(int i = 0, size = additionalScopes.size(); i < size; i++)
+        for(ExternalScope extScope : additionalScopes)
         {
-            ExternalScope extScope = additionalScopes.get(i);
             if (extScope.getScope().equals(annotationType))
             {
                 return extScope.isPassivating();

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/impl/InjectionPointFactory.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/impl/InjectionPointFactory.java?rev=1438446&r1=1438445&r2=1438446&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/impl/InjectionPointFactory.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/impl/InjectionPointFactory.java
Fri Jan 25 10:57:40 2013
@@ -152,7 +152,8 @@ public class InjectionPointFactory
             //@Observes is not injection point type for method parameters
             if (parameter.getAnnotation(Observes.class) == null)
             {
-                Annotation[] qualifierAnnots = webBeansContext.getAnnotationManager().getQualifierAnnotations(parameter.getAnnotations().toArray(new
Annotation[0]));
+                Set<Annotation> anns = parameter.getAnnotations();
+                Annotation[] qualifierAnnots = webBeansContext.getAnnotationManager().getQualifierAnnotations(anns.toArray(new
Annotation[anns.size()]));
                 InjectionPoint point = new InjectionPointImpl(owner, parameter.getBaseType(),
Arrays.asList(qualifierAnnots), parameter);
                 lists.add(point);
             }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorResolutionService.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorResolutionService.java?rev=1438446&r1=1438445&r2=1438446&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorResolutionService.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorResolutionService.java
Fri Jan 25 10:57:40 2013
@@ -220,7 +220,7 @@ public class InterceptorResolutionServic
                     getProperty(OpenWebBeansConfiguration.INTERCEPTOR_FORCE_NO_CHECKED_EXCEPTIONS,
"true"));
         }
 
-        return enforceCheckedException.booleanValue();
+        return enforceCheckedException;
     }
 
 

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/NormalScopeProxyFactory.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/NormalScopeProxyFactory.java?rev=1438446&r1=1438445&r2=1438446&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/NormalScopeProxyFactory.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/NormalScopeProxyFactory.java
Fri Jan 25 10:57:40 2013
@@ -148,10 +148,8 @@ public class NormalScopeProxyFactory ext
         }
         catch (IllegalAccessException e)
         {
-            e.printStackTrace();  //To change body of catch statement use File | Settings
| File Templates.
+            throw new WebBeansConfigurationException("Configured InterceptorHandler " + className
+" creation exception", e);
         }
-
-        return null;
     }
 
     public synchronized <T> Class<T> createProxyClass(Bean<T> bean, ClassLoader
classLoader, Class<T> classToProxy)

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java?rev=1438446&r1=1438445&r2=1438446&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java
Fri Jan 25 10:57:40 2013
@@ -325,9 +325,8 @@ public final class AnnotationUtil
         List<Method> bindingCdiAnnotationMethods
                 = getBindingCdiAnnotationMethods(qualifier1AnnotationType);
 
-        for (int i = 0, size = bindingCdiAnnotationMethods.size(); i < size; i++)
+        for (Method method : bindingCdiAnnotationMethods)
         {
-            Method method = bindingCdiAnnotationMethods.get(i);
             Object value1 = callMethod(annotation1, method);
             Object value2 = callMethod(annotation2, method);
 
@@ -355,7 +354,7 @@ public final class AnnotationUtil
             return false;
         }
 
-        if (value1 == null && value2 == null)
+        if (value1 == null)
         {
             return true;
         }



Mime
View raw message