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

javax.swing.plaf.basic.BasicScrollPaneUI.getBaseline(JComponent, int, int) doesn't throw NPE and IAE

XMLWordPrintable

    • b118
    • generic
    • generic
    • Verified

        The specification inherited from ComponentUI.getBaseline(JComponent, int, int) says:

             * @throws NullPointerException if <code>c</code> is <code>null</code>
             * @throws IllegalArgumentException if width or height is &lt; 0

        But the following code will throw nothing:

            BasicScrollPaneUI ui = new BasicScrollPaneUI();
            ui.installUI(new JScrollPane());
            // no NPE
            ui.getBaseline((JComponent)null, 1, 1);
            // no IAE
            ui.getBaseline(new JScrollPane(), -1, 1);
            ui.getBaseline(new JScrollPane(), 1, -1);
            ui.getBaseline(new JScrollPane(), -1, -1);

              rupashka Pavel Porvatov (Inactive)
              dbessono Dmitry Bessonov
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: