-
CSR
-
Resolution: Approved
-
P4
-
None
-
behavioral
-
minimal
-
No behavior change - specification only so minimal risk
-
Java API
-
SE
Summary
Specify that java.awt.BasicStroke.createStrokedShape(Shape) will throw NullPointerException when passed a null object reference for the parameter.
Problem
Method createStrokedShape(Shape) of the java.awt.BasicStroke class throws NullPointerException when passed a null object reference for the parameter but it is not specified in the specification.
Solution
Update the specification to document that NullPointerException will be thrown for null a Shape object passed to createStrokedShape()
Specification
diff --git a/src/java.desktop/share/classes/java/awt/BasicStroke.java b/src/java.desktop/share/classes/java/awt/BasicStroke.java
index e74753265e3..2c3ddde106c 100644
--- a/src/java.desktop/share/classes/java/awt/BasicStroke.java
+++ b/src/java.desktop/share/classes/java/awt/BasicStroke.java
@@ -294,6 +294,7 @@ public class BasicStroke implements Stroke {
* stroked outline of a specified {@code Shape}.
* @param s the {@code Shape} boundary be stroked
* @return the {@code Shape} of the stroked outline.
+ * @throws NullPointerException if {@code s} is {@code null}
*/
public Shape createStrokedShape(Shape s) {
sun.java2d.pipe.RenderingEngine re =
- csr of
-
JDK-6211257 BasicStroke.createStrokedShape(Shape): NPE is not specified
-
- Resolved
-