Re: [OpenJDK 2D-Dev] RFR: 6206189: Graphics2D.clip specifies incorrectly that a 'null' is a valid value for this method [v3]

2021-02-10 Thread Phil Race
On Wed, 10 Feb 2021 18:46:33 GMT, Phil Race wrote: >> From what I can tell, if clip is null, then calling clip(null) has no effect. >> And it won't throw an NPE in that case. So the proposed documentation is >> less accurate than no documentation at all. >> And I would shy away from changing

Re: [OpenJDK 2D-Dev] RFR: 6206189: Graphics2D.clip specifies incorrectly that a 'null' is a valid value for this method [v3]

2021-02-10 Thread Phil Race
On Wed, 10 Feb 2021 18:30:18 GMT, Phil Race wrote: >> As per code >> public void setClip(Shape sh) { >> usrClip = transformShape(sh); >> >> usrClip is set to null if "sh" is null so clip is cleared...I will update >> the setClip doc too.. > > From what I can tell, if clip is null,

Re: [OpenJDK 2D-Dev] RFR: 6206189: Graphics2D.clip specifies incorrectly that a 'null' is a valid value for this method [v3]

2021-02-10 Thread Phil Race
On Wed, 10 Feb 2021 06:01:59 GMT, Prasanta Sadhukhan 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() >>

Re: [OpenJDK 2D-Dev] RFR: 6206189: Graphics2D.clip specifies incorrectly that a 'null' is a valid value for this method [v3]

2021-02-10 Thread Phil Race
On Wed, 10 Feb 2021 04:51:33 GMT, Prasanta Sadhukhan wrote: >> If "*setClip*(null)" has to clear the clip then it should be specified, >> currently, that method said nothing about the null parameter. > > As per code > public void setClip(Shape sh) { > usrClip = transformShape(sh); >

Re: [OpenJDK 2D-Dev] RFR: 6206189: Graphics2D.clip specifies incorrectly that a 'null' is a valid value for this method [v3]

2021-02-09 Thread Prasanta Sadhukhan
> 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