GridBagLayout inefficiency

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Cannot Reproduce
    • Priority: P5
    • None
    • Affects Version/s: 5.0
    • Component/s: client-libs
    • x86
    • linux

      A DESCRIPTION OF THE REQUEST :
      java.awt.GridBagLayout, Java 1.5.0-b64, lines 897-899:

            /* Adjust the grid width and height */
            for (px = curX + curWidth; r.width < px; r.width++);
            for (py = curY + curHeight; r.height < py; r.height++);

      JUSTIFICATION :
      Using a for loop to do something which doesn't require a loop is very inefficient.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      This should be
          px = curX + curWidth;
          r.width = Math.max(r.width, px);
          py = curY + curHeight;
          r.height = Math.max(r.height, py);
      ACTUAL -
      See above

            Assignee:
            Andrei Dmitriev (Inactive)
            Reporter:
            Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: