You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2012/07/21 10:43:19 UTC

svn commit: r1364046 - /ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java

Author: jleroux
Date: Sat Jul 21 08:43:19 2012
New Revision: 1364046

URL: http://svn.apache.org/viewvc?rev=1364046&view=rev
Log:
A patch from Leon for "IndexOutOfBoundsException thrown by ServerHitBin.countHit" https://issues.apache.org/jira/browse/OFBIZ-4969

This exception thrown out when initiated a "json" request.

    229156224 [http-bio-0.0.0.0-443-exec-6138] ERROR org.ofbiz.webapp.control.ControlServlet -
    ---- runtime exception report --------------------------------------------------
    Error in request handler:
    Exception: java.lang.IndexOutOfBoundsException
    Message: index: 0
    ---- stack trace ---------------------------------------------------------------
    java.lang.IndexOutOfBoundsException: index: 0
    javolution.util.FastList.add(FastList.java:228)
    org.ofbiz.webapp.stats.ServerHitBin.countHit(ServerHitBin.java:210)

Modified:
    ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java?rev=1364046&r1=1364045&r2=1364046&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java Sat Jul 21 08:43:19 2012
@@ -207,7 +207,11 @@ public class ServerHitBin {
                 }
                 if (bin == null) {
                     bin = new ServerHitBin(id, type, true, delegator);
-                    binList.add(0, bin);
+                    if (binList.size() > 0) {
+                        binList.add(0, bin);
+                    } else {
+                        binList.add(bin);
+                    }
                 }
             }
         }