-
CSR
-
Resolution: Unresolved
-
P4
-
None
-
None
-
medium
Summary
Clarify the documentation of creating a java.awt.Polygon.
Problem
An initializer of the Polygon class does not describe how it uses the arrays passed into it as parameters. Passing an array could mean a pass-by-value or a pass-by-reference, but that isn't specified. Whatever is done with the array after the initialization is important so that the polygon won't differ across different implementations. In the OpenJDK, the arrays are copied by value.
Solution
Clarify that the initializer copies the arrays passed in.
Specification
@@ -133,8 +133,10 @@ public Polygon() {
}
/**
- * Constructs and initializes a {@code Polygon} from the specified
- * parameters.
+ * Constructs and initializes a {@code Polygon} from the
+ * specified parameters, copying the array contents of
+ * {@code xpoints} and {@code ypoints}.
+ *
* @param xpoints an array of X coordinates
* @param ypoints an array of Y coordinates
* @param npoints the total number of points in the
- csr of
-
JDK-4756278 RFE: Insufficient API documentation for java.awt.Polygon constructor
-
- Open
-