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

Rectangle contains methods don't specify what happens with 0 dimension arguments

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 6
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • Understanding:
      Cause Known
    • CPU:
      x86
    • OS:
      windows_xp

      Description

      A DESCRIPTION OF THE PROBLEM :
      The contains method of class rectangle doesn't not consider a zero width or height rectangle to be contained in any other.
      I found this situation in a custom paragraphview paint method. Some of the children were zero width (i think the \n) , and since i was using this method for indexing the text much head scratching ensued when sometimes the index got corrupted.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The contains (or any other method there) should specify that they don't accept zero dimension arguments. A work around is creating a method that checks that the max and min points are contained in the rectangle to check

      URL OF FAULTY DOCUMENTATION :
      http://download.java.net/jdk6/docs/api/java/awt/Rectangle.html#contains(java.awt.Rectangle)

        Attachments

          Activity

            People

            Assignee:
            denis Denis Fokin (Inactive)
            Reporter:
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Imported:
              Indexed: