JDK-6206189 : Graphics2D.clip specifies incorrectly that a 'null' is a valid value for this method
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 1.3.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2004-12-09
  • Updated: 2021-03-02
  • Resolved: 2021-02-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17
17 b11Fixed
Related Reports
CSR :  
Description
The API doc for Graphics2D.clip(shape s) claims that passing a null argument would actually clear the existing clipping area. This 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. 

Hence the '@param' of G2D.clip(shape s) must be changed to state that a null argument would throw a NPE. 

This has been there since 1.3.
###@###.### 2004-12-09 04:11:35 GMT

Comments
Changeset: 0c21dd05 Author: Prasanta Sadhukhan <psadhukhan@openjdk.org> Date: 2021-02-22 04:46:33 +0000 URL: https://git.openjdk.java.net/jdk/commit/0c21dd05
22-02-2021