onami-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From as...@apache.org
Subject svn commit: r1610125 - in /onami/trunk: persist/src/main/java/org/apache/onami/persist/ test/src/main/java/org/apache/onami/test/ test/src/main/java/org/apache/onami/test/handler/
Date Sun, 13 Jul 2014 06:39:18 GMT
Author: ash2k
Date: Sun Jul 13 06:39:18 2014
New Revision: 1610125

URL: http://svn.apache.org/r1610125
Log:
Idea inspection: minor performance issues

No functional changes

Modified:
    onami/trunk/persist/src/main/java/org/apache/onami/persist/AggregatedException.java
    onami/trunk/test/src/main/java/org/apache/onami/test/OnamiRunner.java
    onami/trunk/test/src/main/java/org/apache/onami/test/OnamiSuite.java
    onami/trunk/test/src/main/java/org/apache/onami/test/handler/GuiceProvidedModuleHandler.java

Modified: onami/trunk/persist/src/main/java/org/apache/onami/persist/AggregatedException.java
URL: http://svn.apache.org/viewvc/onami/trunk/persist/src/main/java/org/apache/onami/persist/AggregatedException.java?rev=1610125&r1=1610124&r2=1610125&view=diff
==============================================================================
--- onami/trunk/persist/src/main/java/org/apache/onami/persist/AggregatedException.java (original)
+++ onami/trunk/persist/src/main/java/org/apache/onami/persist/AggregatedException.java Sun
Jul 13 06:39:18 2014
@@ -41,8 +41,6 @@ class AggregatedException
     static class Builder
     {
 
-        private static final Throwable[] EMPTY = new Throwable[0];
-
         /**
          * list of causes for the aggregated exception.
          */
@@ -94,7 +92,7 @@ class AggregatedException
                     return (RuntimeException) cause;
                 }
             }
-            return new AggregatedException( msg, causes.toArray( EMPTY ) );
+            return new AggregatedException( msg, causes.toArray( new Throwable[causes.size()]
) );
         }
     }
 

Modified: onami/trunk/test/src/main/java/org/apache/onami/test/OnamiRunner.java
URL: http://svn.apache.org/viewvc/onami/trunk/test/src/main/java/org/apache/onami/test/OnamiRunner.java?rev=1610125&r1=1610124&r2=1610125&view=diff
==============================================================================
--- onami/trunk/test/src/main/java/org/apache/onami/test/OnamiRunner.java (original)
+++ onami/trunk/test/src/main/java/org/apache/onami/test/OnamiRunner.java Sun Jul 13 06:39:18
2014
@@ -485,7 +485,7 @@ public class OnamiRunner
                     builder.append( "\n" );
                     for ( Module module : allModules )
                     {
-                        builder.append( "    " + module );
+                        builder.append( "    " ).append( module );
                         builder.append( "\n" );
                     }
                     LOGGER.finer( builder.toString() );

Modified: onami/trunk/test/src/main/java/org/apache/onami/test/OnamiSuite.java
URL: http://svn.apache.org/viewvc/onami/trunk/test/src/main/java/org/apache/onami/test/OnamiSuite.java?rev=1610125&r1=1610124&r2=1610125&view=diff
==============================================================================
--- onami/trunk/test/src/main/java/org/apache/onami/test/OnamiSuite.java (original)
+++ onami/trunk/test/src/main/java/org/apache/onami/test/OnamiSuite.java Sun Jul 13 06:39:18
2014
@@ -443,7 +443,7 @@ public class OnamiSuite
                     builder.append( "\n" );
                     for ( Module module : allModules )
                     {
-                        builder.append( "    " + module );
+                        builder.append( "    " ).append( module );
                         builder.append( "\n" );
                     }
                     LOGGER.finer( builder.toString() );

Modified: onami/trunk/test/src/main/java/org/apache/onami/test/handler/GuiceProvidedModuleHandler.java
URL: http://svn.apache.org/viewvc/onami/trunk/test/src/main/java/org/apache/onami/test/handler/GuiceProvidedModuleHandler.java?rev=1610125&r1=1610124&r2=1610125&view=diff
==============================================================================
--- onami/trunk/test/src/main/java/org/apache/onami/test/handler/GuiceProvidedModuleHandler.java
(original)
+++ onami/trunk/test/src/main/java/org/apache/onami/test/handler/GuiceProvidedModuleHandler.java
Sun Jul 13 06:39:18 2014
@@ -24,6 +24,7 @@ import static java.lang.String.format;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 import java.util.logging.Level;
 import java.util.logging.Logger;
@@ -131,9 +132,6 @@ public final class GuiceProvidedModuleHa
 
     private void addModules( Module... modules )
     {
-        for ( Module module : modules )
-        {
-            this.modules.add( module );
-        }
+        Collections.addAll( this.modules, modules );
     }
 }



Mime
View raw message