-
Bug
-
Resolution: Fixed
-
P2
-
1.4.0
-
beta
-
generic
-
generic
-
Verified
Name: naC79102 Date: 06/23/2000
java.awt.GraphicsEnvironment.createGraphics(BufferedImage) throws a VM
exception when passed a Null parameter in JDK Merlin.
The error was verified for build 1.4.0beta-F and build 1.4.0beta-b19.
When run on windowsNT with the HotSpot VM in both mixed and integrated modes
a HotSpot VM ExceptionAccessViolation was thrown while in classic VM Dr
Watson error was thrown. However in both cases the system did not hang.
The output was as follows...
D:\tests\api\java_awt\java2d\awt\GraphicsEnvironment>java
javasoft.sqe.tests.api
.java.awt.java2d.awt.GraphicsEnvironment.test
#
# HotSpot Virtual Machine Error, EXCEPTION_ACCESS_VIOLATION
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
#
# Error ID: 4F533F57494E13120E43505002D4
#
abnormal program termination
D:\tests\api\java_awt\java2d\awt\GraphicsEnvironment>
Sample code run is as follows....
package javasoft.sqe.tests.api.java.awt.java2d.awt.GraphicsEnvironment;
import java.awt.GraphicsEnvironment;
import java.awt.GraphicsDevice;
import java.awt.GraphicsConfiguration;
import java.awt.Font;
import java.awt.image.BufferedImage;
import java.awt.Graphics2D;
import java.awt.geom.Rectangle2D;
public class test {
public test() {
/**
apiTested = GraphicsEnvironment.createGraphics(BufferedImage);
parameter passed = null
**/
GraphicsEnvironment ge = GraphicsEnvironment.
getLocalGraphicsEnvironment();
try {
Graphics2D g2d = ge.createGraphics(null);
Rectangle2D.Float r = new Rectangle2D.Float(0f, 0f, 100f, 100f);
g2d.draw(r);
} catch (NullPointerException e) {
System.out.println("NPE");
}
}
public static void main(String[] args) {
new test();
}
}
======================================================================