openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1072628 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util: ClassUtil.java WebBeansUtil.java
Date Sun, 20 Feb 2011 16:44:30 GMT
Author: struberg
Date: Sun Feb 20 16:44:29 2011
New Revision: 1072628

URL: http://svn.apache.org/viewvc?rev=1072628&view=rev
Log:
OWB-461 cleanup: use known size for toArray

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java
    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/ClassUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java?rev=1072628&r1=1072627&r2=1072628&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
Sun Feb 20 16:44:29 2011
@@ -1907,7 +1907,7 @@ public final class ClassUtil
             }
         }
 
-        return fieldsWithType.toArray(new Field[0]);
+        return fieldsWithType.toArray(new Field[fieldsWithType.size()]);
 
     }
     

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=1072628&r1=1072627&r2=1072628&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
Sun Feb 20 16:44:29 2011
@@ -972,7 +972,7 @@ public final class WebBeansUtil
                         clazzParameters.add(ClassUtil.getClazz(parameter.getBaseType()));
                     }
 
-                    Class<?>[] params = clazzParameters.toArray(new Class<?>[0]);
+                    Class<?>[] params = clazzParameters.toArray(new Class<?>[clazzParameters.size()]);
                     if (params.length != 1 || !params[0].equals(InvocationContext.class))
                     {
                         throw new WebBeansConfigurationException("@" + commonAnnotation.getSimpleName()
@@ -1120,7 +1120,7 @@ public final class WebBeansUtil
                     clazzParameters.add(ClassUtil.getClazz(parameter.getBaseType()));
                 }
 
-                Class<?>[] params = clazzParameters.toArray(new Class<?>[0]);
+                Class<?>[] params = clazzParameters.toArray(new Class<?>[clazzParameters.size()]);
 
                 if (params.length != 1 || !params[0].equals(InvocationContext.class))
                 {
@@ -3204,7 +3204,8 @@ public final class WebBeansUtil
 
             if (delegate != null)
             {
-                Annotation[] anns = annotatedType.getAnnotations().toArray(new Annotation[0]);
+                Set<Annotation> annTypeSet = annotatedType.getAnnotations();
+                Annotation[] anns = annTypeSet.toArray(new Annotation[annTypeSet.size()]);
                 AnnotationManager annotationManager = webBeansContext.getAnnotationManager();
                 WebBeansInterceptorConfig.configureInterceptorClass(delegate,
                                                                     annotationManager.getInterceptorBindingMetaAnnotations(anns));



Mime
View raw message