camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hadr...@apache.org
Subject svn commit: r1397125 - in /camel/branches/camel-2.10.x/camel-core/src: main/java/org/apache/camel/processor/loadbalancer/ test/java/org/apache/camel/impl/ test/java/org/apache/camel/issues/
Date Thu, 11 Oct 2012 15:51:49 GMT
Author: hadrian
Date: Thu Oct 11 15:51:48 2012
New Revision: 1397125

URL: http://svn.apache.org/viewvc?rev=1397125&view=rev
Log:
CS fixes. Preparing the 2.10.2 release

Modified:
    camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/processor/loadbalancer/RandomLoadBalancer.java
    camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerCacheTest.java
    camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/issues/RedeliveryPolicyOnExceptionWhileRedeliveringIssueTest.java

Modified: camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/processor/loadbalancer/RandomLoadBalancer.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/processor/loadbalancer/RandomLoadBalancer.java?rev=1397125&r1=1397124&r2=1397125&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/processor/loadbalancer/RandomLoadBalancer.java
(original)
+++ camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/processor/loadbalancer/RandomLoadBalancer.java
Thu Oct 11 15:51:48 2012
@@ -29,7 +29,7 @@ import org.apache.camel.Processor;
  */
 public class RandomLoadBalancer extends QueueLoadBalancer {
 
-    private static final Random random = new Random();
+    private static final Random RANDOM = new Random();
 
     protected synchronized Processor chooseProcessor(List<Processor> processors, Exchange
exchange) {
         int size = processors.size();
@@ -41,7 +41,7 @@ public class RandomLoadBalancer extends 
         }
 
         // pick a random
-        int index = random.nextInt(size);
+        int index = RANDOM.nextInt(size);
         return processors.get(index);
     }
 

Modified: camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerCacheTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerCacheTest.java?rev=1397125&r1=1397124&r2=1397125&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerCacheTest.java
(original)
+++ camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerCacheTest.java
Thu Oct 11 15:51:48 2012
@@ -30,7 +30,7 @@ import org.apache.camel.Producer;
  */
 public class DefaultProducerCacheTest extends ContextTestSupport {
 
-    private static final AtomicInteger counter = new AtomicInteger();
+    private static final AtomicInteger COUNTER = new AtomicInteger();
 
     public void testCacheProducerAcquireAndRelease() throws Exception {
         ProducerCache cache = new ProducerCache(this, context);
@@ -64,15 +64,15 @@ public class DefaultProducerCacheTest ex
         assertEquals("Size should be 5", 5, cache.size());
 
         // should have stopped the 3 evicted
-        assertEquals(3, counter.get());
+        assertEquals(3, COUNTER.get());
 
         cache.stop();
 
         // should have stopped all 8
-        assertEquals(8, counter.get());
+        assertEquals(8, COUNTER.get());
     }
 
-    private class MyEndpoint extends DefaultEndpoint {
+    private final class MyEndpoint extends DefaultEndpoint {
 
         private int number;
 
@@ -114,7 +114,7 @@ public class DefaultProducerCacheTest ex
 
         @Override
         protected void doStop() throws Exception {
-            counter.incrementAndGet();
+            COUNTER.incrementAndGet();
         }
     }
 

Modified: camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/issues/RedeliveryPolicyOnExceptionWhileRedeliveringIssueTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/issues/RedeliveryPolicyOnExceptionWhileRedeliveringIssueTest.java?rev=1397125&r1=1397124&r2=1397125&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/issues/RedeliveryPolicyOnExceptionWhileRedeliveringIssueTest.java
(original)
+++ camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/issues/RedeliveryPolicyOnExceptionWhileRedeliveringIssueTest.java
Thu Oct 11 15:51:48 2012
@@ -39,12 +39,12 @@ public class RedeliveryPolicyOnException
             String camelRedeliveryCounter = exchange.getIn().getHeader(Exchange.REDELIVERY_COUNTER,
String.class);
             int redeliveries = camelRedeliveryCounter == null ? 0 : Integer.valueOf(camelRedeliveryCounter);
             switch (redeliveries) {
-                case 0:
-                    throw new FirstException();
-                case 1:
-                    throw new SecondException();
-                default:
-                    break; // no-op
+            case 0:
+                throw new FirstException();
+            case 1:
+                throw new SecondException();
+            default:
+                break; // no-op
             }
         }
     }



Mime
View raw message