Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 5031274
Votes 0
Synopsis java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
Category hotspot:compiler2
Reported Against 6.5sp1_mu4
Release Fixed 1.3.1_13
State 10-Fix Delivered, bug
Priority: 4-Low
Related Bugs
Submit Date 14-APR-2004
Description
The product is IAS 6.5 sp1 mu4 and turn off dynamic re-loading.
jdk : 1.3.1_11-b02
Java flag include -XX:+PrintCompilation

Sample jsp code
-----------------
<%@ page contentType="text/html; charset=utf-8" %>
<%
for (int i = 0; i < 1000; i++) {
    int dataCount = 0;
    java.util.List dataList = new java.util.ArrayList();
    dataCount = dataList.size();

    if (dataCount > 0) {
        Object tmp = new String[dataCount][2];
    }

    for (int k = 0; k < dataCount; k++) {
        dataList.get(k);
    }
}
%>

 When the jsp is compiled, load and run for the first time,  the indexOutOfBoundsException is thrown
 Running the same piece of code in Tomcat, work well. 

choon-  xxxxx@xxxxx   2004-04-13
Work Around
1.  Turn on dynamic reloading of jsp ( IAS feature )
2. Modified the jsp to
-----------------
<%@ page contentType="text/html; charset=utf-8" %>
<%
for (int i = 0; i < 1000; i++) {
    int dataCount = 0;
    java.util.List dataList = new java.util.ArrayList();
    dataCount = dataList.size();

    if (dataCount > 0) {
        Object tmp = new String[dataCount][2];
    }
  else
            System.out.print("");

    for (int k = 0; k < dataCount; k++) {
        dataList.get(k);
    }
}
%>
--------------------
3. create a .hotspot_compiler with the following lines

exclude jsp/APPS/fortune/fortune _jspService

choon-  xxxxx@xxxxx   2004-04-13
Evaluation
See the suggested fix section.

  xxxxx@xxxxx   2004-05-27
Comments
  
  Include a link with my name & email   

Submitted On 27-SEP-2009
dd



PLEASE NOTE: JDK6 is formerly known as Project Mustang