Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6625450
Votes 0
Synopsis javax.swing.border.TitledBorder.getBaseline() doesn't throw IAE when width is < 0
Category java:classes_swing
Reported Against 1.6
Release Fixed 7(b27)
State 10-Fix Delivered, bug
Priority: 3-Medium
Related Bugs
Submit Date 02-NOV-2007
Description
The spec ( http://java.sun.com/javase/6/docs/api/javax/swing/border/TitledBorder.html#getBaseline(java.awt.Component,%20int,%20int) ) says:

Throws:
    IllegalArgumentException - if width or height is < 0

For example, the following lines of code will throw nothing:

    new TitledBorder("123").getBaseline( new Button(), -1, 0 );
    new TitledBorder("123").getBaseline( new Component() {}, Integer.MIN_VALUE, 0 );
Posted Date : 2007-11-02 18:29:25.0
Work Around
N/A
Evaluation
TitledBrder should do the same as its super class does:

        if (width < 0 || height < 0) {
            throw new IllegalArgumentException(
                    "Width and height must be >= 0");
        }
Posted Date : 2007-11-06 10:36:41.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang