On Wed, 10 Feb 2021 04:51:33 GMT, Prasanta Sadhukhan <psadhuk...@openjdk.org> 
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);
> 
> 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, 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 the implementation on this without LOTS of 
VERY careful testing.  
Oh the javadoc clause you propose is split by many lines of comments. I see you 
have the rider "and clip is already set via {@code setClip}".
Well I am not sure why it has to be set by setClip for this to be true but just 
having to say this sounds weird.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2476

Reply via email to