On Tue, 9 Feb 2021 11:57:44 GMT, Prasanta Sadhukhan <psadhuk...@openjdk.org> wrote:
> The API doc for Graphics2D.clip(shape s) claims that passing a null argument > would actually clear the existing clipping area, which is incorrect. > This statement is applicable only to G2D.setClip() and not for the clip() > method. G2D.clip() would throw a NullPointerException when it encounters a > null argument. > Updated spec to rectify this. src/java.desktop/share/classes/java/awt/Graphics2D.java line 1206: > 1204: * @param s the {@code Shape} to be intersected with the current > 1205: * {@code Clip}. > 1206: * @throws NullPointerException if {@code s} is {@code null} Actually it is not always true, you can check it by commenting `setClip()` call in the test. ------------- PR: https://git.openjdk.java.net/jdk/pull/2476