Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8298864

unclear spec for Polygon.bounds field

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Unresolved
    • Icon: P5 P5
    • None
    • client-libs
    • None
    • 2d
    • low

      Summary

      Explain what may make the bounds field of a java.awt.Polygon null.

      Problem

      The current documentation is vague as to the reasoning for why it is null, only specifying: "This value can be null."

      Solution

      Replace the vague specification with more detail and clarify that the protected field should not be used by users.

      Specification

      @@ -101,11 +101,15 @@ */ public int[] ypoints;

       /**
        * The bounds of this {@code Polygon}.

      - * This value can be null. + *

      + * When created, {@link #invalidate() invalidated}, or {@link #reset() reset}, + * this becomes {@code null}. To get out of the null state, + * {@link #getBounds()} called with {@link #npoints} being greater than + * {@code 0} will transfer into a non-null {@link Rectangle}. * * @serial * @see #getBoundingBox() * @see #getBounds() * @since 1.0

            jwaters Julian Waters
            kvtsunw Kvt Kvt (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated: