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

MetalComboBoxUI.getBaseline(JComponent, int, int) throws IAE for valid width/height

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b114
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Backports

        Description

        Unexpected IAE is thrown for (valid) width/height values = 0, 1, 2, 3:

        Exception in thread "main" java.lang.IllegalArgumentException: Width and height must be >= 0
        at javax.swing.plaf.ComponentUI.getBaseline(ComponentUI.java:274)
        at javax.swing.plaf.basic.BasicComboBoxUI.getBaseline(BasicComboBoxUI.java:900)
        at javax.swing.plaf.metal.MetalComboBoxUI.getBaseline(MetalComboBoxUI.java:132)

        Please see the following code sample:

                MetalComboBoxUI ui = new MetalComboBoxUI();
                ui.installUI(new JComboBox());
                // IAE thrown from any of the following lines
                ui.getBaseline(new JComboBox(), 0, 0);
                ui.getBaseline(new JComboBox(), 0, 1);
                ui.getBaseline(new JComboBox(), 1, 0);
                ui.getBaseline(new JComboBox(), 1, 1);
                ui.getBaseline(new JComboBox(), 2, 2);
                ...
                ui.getBaseline(new JComboBox(), 2, 3);
                ui.getBaseline(new JComboBox(), 3, 3);
        The following JCK test fails due to this problem:
        api/java_awt/Component/index.html#BaselineRelatedTests[comboBoxUI_01]
        api/java_awt/Component/index.html#BaselineRelatedTests[comboBoxUI_03]

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                alexp Alexander Potochkin (Inactive)
                Reporter:
                dbessono Dmitry Bessonov
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: