-
CSR
-
Resolution: Approved
-
P4
-
None
-
behavioral
-
minimal
-
Java API
-
SE
Summary
It is not documented what Grahics.setColor(null) should do. According to the implementation Graphics.setColor(null) does not change graphics color at all.
Problem
It is not documented what Grahics.setColor(null) should do.
Solution
Document Graphics.setColor(null) citing it is silently ignored, same way Graphics.setFont(null) is documented.
Specification
diff --git a/src/java.desktop/share/classes/java/awt/Graphics.java b/src/java.desktop/share/classes/java/awt/Graphics.java
index fe8437f029e..234b474764e 100644
--- a/src/java.desktop/share/classes/java/awt/Graphics.java
+++ b/src/java.desktop/share/classes/java/awt/Graphics.java
@@ -193,6 +193,7 @@ public abstract class Graphics {
* Sets this graphics context's current color to the specified
* color. All subsequent graphics operations using this graphics
* context use this specified color.
+ * A null argument is silently ignored.
* @param c the new rendering color.
* @see java.awt.Color
* @see java.awt.Graphics#getColor
*/
public abstract void setColor(Color c);
- csr of
-
JDK-6436374 Graphics.setColor(null) is not documented
- Resolved