[OpenJDK 2D-Dev] RFR: 6211257: BasicStroke.createStrokedShape(Shape): NPE is not specified [v2]
Sergey Bylokhov
serb at openjdk.java.net
Sat Feb 6 00:07:42 UTC 2021
On Thu, 4 Feb 2021 04:15:03 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:
>> Method createStrokedShape(Shape) for java.awt.BasicStroke class throws NullPointerException when passed a null object reference for a input parameter but it's not specified in the spec.
>> Updated spec to illustrate this.
>
> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
>
> Doc change to @throws
Changes requested by serb (Reviewer).
src/java.desktop/share/classes/java/awt/BasicStroke.java line 297:
> 295: * @param s the {@code Shape} boundary be stroked
> 296: * @return the {@code Shape} of the stroked outline.
> 297: * @throws NullPointerException if {@code Shape} is {@code null}
I think that you mean the parameter {@code s}, not a type Shape.
test/jdk/java/awt/BasicStroke/TestNullShape.java line 40:
> 38: System.out.println("result: false");
> 39: }
> 40: catch(NullPointerException ne) {
You can add a space after catch and move it to one line above.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2377
More information about the 2d-dev
mailing list