Details
-
Bug
-
Resolution: Fixed
-
P3
-
11, 15
-
b16
-
generic
-
linux
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8299081 | 11.0.19 | Sergey Bylokhov | P3 | Resolved | Fixed | b01 |
Description
The code below crashes on Unix:
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.Robot;
public class CrashRobot {
public static void main(final String[] args) throws Exception {
final GraphicsDevice gd = new GraphicsDevice() {
@Override
public int getType() {
return TYPE_RASTER_SCREEN;
}
@Override
public String getIDstring() {
return "Custom screen device";
}
@Override
public GraphicsConfiguration[] getConfigurations() {
return new GraphicsConfiguration[0];
}
@Override
public GraphicsConfiguration getDefaultConfiguration() {
return null;
}
};
final Robot r = new Robot(gd);
r.getPixelColor(0, 0);
}
}
On macOS the java.lang.ClassCastException is occured.
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.Robot;
public class CrashRobot {
public static void main(final String[] args) throws Exception {
final GraphicsDevice gd = new GraphicsDevice() {
@Override
public int getType() {
return TYPE_RASTER_SCREEN;
}
@Override
public String getIDstring() {
return "Custom screen device";
}
@Override
public GraphicsConfiguration[] getConfigurations() {
return new GraphicsConfiguration[0];
}
@Override
public GraphicsConfiguration getDefaultConfiguration() {
return null;
}
};
final Robot r = new Robot(gd);
r.getPixelColor(0, 0);
}
}
On macOS the java.lang.ClassCastException is occured.
Attachments
Issue Links
- backported by
-
JDK-8299081 The crash in XRobotPeer when the custom GraphicsDevice is used
-
- Resolved
-
- relates to
-
JDK-8076313 GraphicsEnvironment does not detect changes in count of monitors on Linux OS
-
- Resolved
-