openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1307021 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans: annotation/ config/ container/ corespi/scanner/ decorator/ portable/ util/
Date Thu, 29 Mar 2012 17:59:56 GMT
Author: struberg
Date: Thu Mar 29 17:59:55 2012
New Revision: 1307021

URL: http://svn.apache.org/viewvc?rev=1307021&view=rev
Log:
OWB-657 cleanup; improve code flow

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/AnnotationManager.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeanTypeSetResolver.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/SerializableBeanVault.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AnnotationDB.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorResolverRules.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AbstractAnnotated.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.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=1307021&r1=1307020&r2=1307021&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
Thu Mar 29 17:59:55 2012
@@ -71,7 +71,7 @@ public final class AnnotationManager
     static
     {
         ONLY_DEFAULT_ANNOTATION[0] = new DefaultLiteral();
-    };
+    }
 
     // No instantiate
 
@@ -119,10 +119,6 @@ public final class AnnotationManager
             {
                 return true;
             }
-            else
-            {
-                continue;
-            }
         }
 
         return false;
@@ -379,10 +375,6 @@ public final class AnnotationManager
             {
                 return true;
             }
-            else
-            {
-                continue;
-            }
         }
 
         return false;
@@ -739,10 +731,6 @@ public final class AnnotationManager
                                         {
                                             return null;
                                         }
-                                        else
-                                        {
-                                            break;
-                                        }
                                     }
                                 }
                             }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeanTypeSetResolver.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeanTypeSetResolver.java?rev=1307021&r1=1307020&r2=1307021&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeanTypeSetResolver.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeanTypeSetResolver.java
Thu Mar 29 17:59:55 2012
@@ -48,7 +48,6 @@ public class BeanTypeSetResolver
         {
             return;
         }
-        
         else if(ClassUtil.isParametrizedType(beanType))
         {
             parametrizedClassConfiguration((ParameterizedType) beanType);

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/SerializableBeanVault.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/SerializableBeanVault.java?rev=1307021&r1=1307020&r2=1307021&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/SerializableBeanVault.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/SerializableBeanVault.java
Thu Mar 29 17:59:55 2012
@@ -48,7 +48,7 @@ public class SerializableBeanVault
     private Map<String, SerializableBean<?>> serializableBeans = new ConcurrentHashMap<String,
SerializableBean<?>>();
 
     @Deprecated
-    public final static SerializableBeanVault getInstance()
+    public static SerializableBeanVault getInstance()
     {
         return WebBeansContext.getInstance().getSerializableBeanVault();
     }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AnnotationDB.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AnnotationDB.java?rev=1307021&r1=1307020&r2=1307021&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AnnotationDB.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AnnotationDB.java
Thu Mar 29 17:59:55 2012
@@ -32,6 +32,7 @@ import org.scannotation.archiveiterator.
 
 import java.io.*;
 import java.net.URL;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -370,11 +371,7 @@ public class AnnotationDB implements Ser
             if (cf.getInterfaces() != null)
             {
                 Set<String> intfs = new HashSet<String>();
-                for (String intf : cf.getInterfaces())
-                {
-                    intfs.add(intf);
-                }
-
+                Collections.addAll(intfs, cf.getInterfaces());
                 implementsIndex.put(cf.getName(), intfs);
             }
 

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorResolverRules.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorResolverRules.java?rev=1307021&r1=1307020&r2=1307021&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorResolverRules.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorResolverRules.java
Thu Mar 29 17:59:55 2012
@@ -165,11 +165,7 @@ public final class DecoratorResolverRule
                     if(actual instanceof Class)
                     {
                         Class<?> clazz = (Class<?>)actual;
-                        if(clazz.equals(Object.class))
-                        {
-                            continue;
-                        }
-                        else
+                        if(!clazz.equals(Object.class))
                         {
                             ok = false;
                             break;

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=1307021&r1=1307020&r2=1307021&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
Thu Mar 29 17:59:55 2012
@@ -20,6 +20,7 @@ package org.apache.webbeans.portable;
 
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Set;
@@ -93,10 +94,7 @@ abstract class AbstractAnnotated impleme
     protected void setAnnotations(Annotation[] annotations)
     {        
         this.annotations.clear();
-        for(Annotation annotation : annotations)
-        {
-            this.annotations.add(annotation);
-        }
+        Collections.addAll(this.annotations, annotations);
     }
     
     /**

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java?rev=1307021&r1=1307020&r2=1307021&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java
Thu Mar 29 17:59:55 2012
@@ -287,7 +287,6 @@ public final class ClassUtil
      * Check method throws checked exception or not.
      * 
      * @param method method instance
-     * @return trur or false
      */
     public static boolean isMethodHasCheckedException(Method method)
     {
@@ -299,11 +298,7 @@ public final class ClassUtil
         {
             for (Class<?> type : et)
             {
-                if (Error.class.isAssignableFrom(type) || RuntimeException.class.isAssignableFrom(type))
-                {
-                    return false;
-                }
-                else
+                if (!Error.class.isAssignableFrom(type) && !RuntimeException.class.isAssignableFrom(type))
                 {
                     return true;
                 }
@@ -581,11 +576,7 @@ public final class ClassUtil
                         if(actual instanceof Class)
                         {
                             Class<?> clazz = (Class<?>)actual;
-                            if(clazz.equals(Object.class))
-                            {
-                                continue;
-                            }
-                            else
+                            if(!clazz.equals(Object.class))
                             {
                                 ok = false;
                                 break;



Mime
View raw message