United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-4936498 SPEC: incorrect default type for BMPImageWriteParam.getCompressionType()
JDK-4936498 : SPEC: incorrect default type for BMPImageWriteParam.getCompressionType()

Details
Type:
Bug
Submit Date:
2003-10-13
Status:
Closed
Updated Date:
2004-03-18
Project Name:
JDK
Resolved Date:
2004-01-26
Component:
client-libs
OS:
generic
Sub-Component:
javax.imageio
CPU:
generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
5.0
Fixed Versions:
5.0 (b36)

Related Reports

Sub Tasks

Description

Name: viR10068			Date: 10/13/2003


The API spec for jdk 1.5.0-b23 say for the class BMPImageWriteParam:
"By default, no compression is used (the compression type is "BI_RGB")".
But the methods getCompressionType() return 'null' as default value.

The example:
-------------------------- test.java ----------------------------
import java.io.PrintStream;
import javax.imageio.ImageWriteParam;
import javax.imageio.plugins.bmp.BMPImageWriteParam;

class test {

    public static void main(String argv[]) { 
        BMPImageWriteParam biwp = new BMPImageWriteParam();
        if (setModeExpl(biwp) != 0) {
            System.out.println("Unexpected exception");
            return;
        }
        if(!"BI_RGB".equals(biwp.getCompressionType())) {
            System.out.println("FAILED. Incorrect default value for CompressionType: " + 
biwp.getCompressionType());
            return;
        }
        System.out.println("OKAY");
    }

    private static int setModeExpl(BMPImageWriteParam biwp) {

        try {
            if (biwp.getCompressionMode() != ImageWriteParam.MODE_EXPLICIT) {
                biwp.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
            }
        } catch (RuntimeException re) {
            System.out.println("Unexpected exception: " + re);
            return -1;
        }
        return 0;
    }
}
-----------------------------------------------------------------

The execution log:
% jdk1.5.0-b23/solaris-sparc/bin/javac test.java && jdk1.5.0-b23/solaris-sparc/bin/java 
-showversion  -Xfuture test
java version "1.5.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b23)
Java HotSpot(TM) Client VM (build 1.5.0-beta-b23, mixed mode)

FAILED. Incorrect default value for CompressionType: null
% 

======================================================================

                                    

Comments
EVALUATION

Need to update the javadoc.
###@###.### 2003-10-23
                                     
2003-10-23
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
tiger-beta2

FIXED IN:
tiger-beta
tiger-beta2

INTEGRATED IN:
tiger-b36
tiger-beta2

VERIFIED IN:
tiger-beta2


                                     
2004-08-21



Hardware and Software, Engineered to Work Together