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: 4850965
Votes 0
Synopsis LookupTableJAI.getFloatData(1) generates different exception on current JAI
Category jai:demo
Reported Against 1.1.2-dev
Release Fixed
State 6-Fix Understood, bug
Priority: 4-Low
Related Bugs
Submit Date 18-APR-2003
Description
The code below generates different exceptions on JAI_1.1.2 and JAI_1.1.1:

import javax.media.jai.LookupTableJAI;
public class Bug_GetFloatData_i_37 {
    public static void main(String args[]) {
       LookupTableJAI ltj = new LookupTableJAI(new float[]{1f, 2f});
       ltj.getFloatData(1);
    }
}

On JAI_1.1.2, we see RuntimeException.
But on JAI_1.1.1, we see ArrayIndexOutOfBoundsException.
LookupTableJAI.getDoubleData(1) has the same problem also.

On JAI_1.1.2:
Exception in thread "main" java.lang.RuntimeException: Cannot invoke DataBuffer method "getData".
        at com.sun.media.jai.util.DataBufferUtils.invokeDataBufferMethod(DataBufferUtils.java:141)
        at com.sun.media.jai.util.DataBufferUtils.getDataFloat(DataBufferUtils.java:221)
        at javax.media.jai.LookupTableJAI.getFloatData(LookupTableJAI.java:603)
        at Bug_GetFloatData_i_37.main(Bug_GetFloatData_i_37.java:7)


On JAI_1.1.1:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
        at javax.media.jai.DataBufferFloat.getData(DataBufferFloat.java:155)
        at javax.media.jai.LookupTableJAI.getFloatData(LookupTableJAI.java:602)
        at Bug_GetFloatData_i_37.main(Bug_GetFloatData_i_37.java:7)
Work Around
N/A
Evaluation
This is caused in DataBufferUtil:
Exception in thread "main" java.lang.RuntimeException: Cannot invoke DataBuffer method "getData".
        at com.sun.media.jai.util.DataBufferUtils.invokeDataBufferMethod(DataBufferUtils.java:165)
        at com.sun.media.jai.util.DataBufferUtils.getDataFloat(DataBufferUtils.java:245)
        at javax.media.jai.LookupTableJAI.getFloatData(LookupTableJAI.java:603)
        at Bug_GetFloatData_i_37.main(Bug_GetFloatData_i_37.java:5)

The exception type is not ducumented.  So ArrayOutOfBound is not required.  Suggest to change the test case.


  xxxxx@xxxxx   2003-05-15
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang