Community
Participate
Working Groups
In the spec for constructing a Font with a name, null names are not allowed: * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the name argument is null</li> But nothing is said in the spec for constructing a FontData, so a FontData with a null name is gleefully constructed. Of course, you can't do anything reasonable with this bogus FontData, and if you pass it to a Font you will blow up randomly. Suggest strongly that we javadoc the FontData constructor to throw the exception (and do it in the code). Also, same thing for FontData.setName - we currently allow null. We should spec and throw illegal arg. NOTES:
Interestingly, the implementation of fonts changed recently, and now the FontData constructor and setName actually throw a NullPointerException when null is given, which is pretty bad. This change makes it all the more compelling to make this tiny spec change. Since the spec already says that the argument can not be null, no correct program can be using this "feature", so we feel the change is justified. Added new exception spec and now throw exception. All platforms.
PRODUCT VERSION: 137