-
Bug
-
Resolution: Fixed
-
P4
-
6
-
None
There is undefined NullPointerException in method createCompatibleVolatileImage,
when parameter transparency has illegal value.
Note: I test this only on linux machine.
See next example:
-------------------------------------------------------------------------------
import java.awt.*;
import java.awt.image.*;
class Test {
public static void main(String[] args) {
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice dsd = ge.getDefaultScreenDevice();
GraphicsConfiguration gc = dsd.getDefaultConfiguration();
int[] transparency = { Integer.MIN_VALUE, -1, 0, 4, Integer.MAX_VALUE };
for (int t = 0; t < transparency.length; t++) {
try {
System.out.println("VolatileImage will be created with transparency = "
+ transparency[t]);
VolatileImage vi = gc.createCompatibleVolatileImage(
10, 10, transparency[t]);
System.out.println("VolatileImage was created with transparency = "
+ transparency[t]);
} catch (IllegalArgumentException e) {
} catch (NullPointerException e) {
System.out.println("Unexpected NullPointer Exception ");
}
}
}
}
###@###.### 10/28/04 14:17 GMT
when parameter transparency has illegal value.
Note: I test this only on linux machine.
See next example:
-------------------------------------------------------------------------------
import java.awt.*;
import java.awt.image.*;
class Test {
public static void main(String[] args) {
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice dsd = ge.getDefaultScreenDevice();
GraphicsConfiguration gc = dsd.getDefaultConfiguration();
int[] transparency = { Integer.MIN_VALUE, -1, 0, 4, Integer.MAX_VALUE };
for (int t = 0; t < transparency.length; t++) {
try {
System.out.println("VolatileImage will be created with transparency = "
+ transparency[t]);
VolatileImage vi = gc.createCompatibleVolatileImage(
10, 10, transparency[t]);
System.out.println("VolatileImage was created with transparency = "
+ transparency[t]);
} catch (IllegalArgumentException e) {
} catch (NullPointerException e) {
System.out.println("Unexpected NullPointer Exception ");
}
}
}
}
###@###.### 10/28/04 14:17 GMT