camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r734392 - /activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
Date Wed, 14 Jan 2009 13:44:14 GMT
Author: jstrachan
Date: Wed Jan 14 05:43:55 2009
New Revision: 734392

URL: http://svn.apache.org/viewvc?rev=734392&view=rev
Log:
avoided possible IndexOutOfBoundsException mentioned here  http://www.nabble.com/Reason-why-Mockendpoint-generates-an-IndexOutOfBoundsException-error---tp21453025s22882p21453025.html

Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java?rev=734392&r1=734391&r2=734392&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
Wed Jan 14 05:43:55 2009
@@ -341,7 +341,10 @@
                     assertTrue("No exchange received for counter: " + i, exchange != null);
 
                     Object expectedBody = expectedBodyValues.get(i);
-                    Object actualBody = actualBodyValues.get(i);
+                    Object actualBody = null;
+                    if (i < actualBodyValues.size()) {
+                        actualBody = actualBodyValues.get(i);
+                    }
 
                     assertEquals("Body of message: " + i, expectedBody, actualBody);
                 }



Mime
View raw message