-
Bug
-
Resolution: Fixed
-
P2
-
7
-
b68
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2184379 | OpenJDK6 | Peter Zhelezniakov | P3 | Resolved | Fixed | b18 |
When creating an instance of AbstractRegionPainter and then trying to invoke decodeX(), decodeY(), decodeAnchorY() etc. methods a NullPointerException is thrown.
Please see the following code sample:
import javax.swing.*;
import java.awt.*;
public class TestARP {
public static void main(String[] args) {
class MyARP extends javax.swing.plaf.nimbus.AbstractRegionPainter {
protected PaintContext getPaintContext() {
return null;
}
protected void doPaint(Graphics2D g, JComponent c,
int width, int height,
Object[] extendedCacheKeys) {
}
public void callDecodeAnchorX() {
decodeX(0.5f);
}
}
new MyARP().callDecodeAnchorX();
}
}
-----------------------------------------
output will be:
Exception in thread "main" java.lang.NullPointerException
at javax.swing.plaf.nimbus.AbstractRegionPainter$PaintContext.access$100(AbstractRegionPainter.java:472)
at javax.swing.plaf.nimbus.AbstractRegionPainter.decodeX(AbstractRegionPainter.java:233)
at TestARP$1MyARP.callDecodeAnchorX(TestARP.java:16)
at TestARP.main(TestARP.java:19)
Please see the following code sample:
import javax.swing.*;
import java.awt.*;
public class TestARP {
public static void main(String[] args) {
class MyARP extends javax.swing.plaf.nimbus.AbstractRegionPainter {
protected PaintContext getPaintContext() {
return null;
}
protected void doPaint(Graphics2D g, JComponent c,
int width, int height,
Object[] extendedCacheKeys) {
}
public void callDecodeAnchorX() {
decodeX(0.5f);
}
}
new MyARP().callDecodeAnchorX();
}
}
-----------------------------------------
output will be:
Exception in thread "main" java.lang.NullPointerException
at javax.swing.plaf.nimbus.AbstractRegionPainter$PaintContext.access$100(AbstractRegionPainter.java:472)
at javax.swing.plaf.nimbus.AbstractRegionPainter.decodeX(AbstractRegionPainter.java:233)
at TestARP$1MyARP.callDecodeAnchorX(TestARP.java:16)
at TestARP.main(TestARP.java:19)
- backported by
-
JDK-2184379 Nimbus L&F: AbstractRegionPainter's paint context is not initialized
-
- Resolved
-
- duplicates
-
JDK-6849338 Nimbus L&F: AbstractRegionPainter.PaintContext doesn't accept null insets
-
- Closed
-
-
JDK-6849403 Nimbus L&F: AbstractRegionPainter.decodeGradient(...) should specify IAEs
-
- Closed
-
-
JDK-6849723 Nimbus L&F: AbstractRegionPainter.decodeRadialGradient(...) should specify IAE thrown for neg radius
-
- Closed
-
-
JDK-6849734 Nimbus L&F:AbstractRegionPainter.decodeX/Y() should throw (specified) IAE instead of AssertionError
-
- Closed
-