-
Bug
-
Resolution: Fixed
-
P2
-
7
-
b130
-
generic
-
generic
-
Verified
JDK: 7b118+
Platform: Any
Brute force testing revealed a case when NPE is not thrown
as specified in the following method if passed Component is null
http://download.java.net/jdk7/docs/api/javax/swing/border/StrokeBorder.html#paintBorder(java.awt.Component, java.awt.Graphics, int, int, int, int)
Throws:
NullPointerException - if the specified c or g are null
---------------------------------------------------------------------
import java.awt.*;
import java.awt.image.BufferedImage;
public class StrokeBorderNPE {
public static void main(String[] args) {
new javax.swing.border.StrokeBorder(
new BasicStroke(100,
BasicStroke.CAP_SQUARE,
BasicStroke.JOIN_ROUND), Color.BLACK)
// @throws NullPointerException
// if the specified {@code c} or {@code g} are {@code null}
.paintBorder(
(Component) null,
new BufferedImage(
1,1, BufferedImage.TYPE_INT_RGB).createGraphics(),
0,0,1,1);
}
}
---------------------------------------------------------------------
Platform: Any
Brute force testing revealed a case when NPE is not thrown
as specified in the following method if passed Component is null
http://download.java.net/jdk7/docs/api/javax/swing/border/StrokeBorder.html#paintBorder(java.awt.Component, java.awt.Graphics, int, int, int, int)
Throws:
NullPointerException - if the specified c or g are null
---------------------------------------------------------------------
import java.awt.*;
import java.awt.image.BufferedImage;
public class StrokeBorderNPE {
public static void main(String[] args) {
new javax.swing.border.StrokeBorder(
new BasicStroke(100,
BasicStroke.CAP_SQUARE,
BasicStroke.JOIN_ROUND), Color.BLACK)
// @throws NullPointerException
// if the specified {@code c} or {@code g} are {@code null}
.paintBorder(
(Component) null,
new BufferedImage(
1,1, BufferedImage.TYPE_INT_RGB).createGraphics(),
0,0,1,1);
}
}
---------------------------------------------------------------------
- relates to
-
JDK-4358979 javax.swing.border should have a DashedBorder
- Closed