According to the JavaDocs, CellFormatResult.text may never be null. However, there's nothing in the constructor that guarentees this. https://poi.apache.org/apidocs/org/apache/poi/ss/format/CellFormatResult.html http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/format/CellFormatResult.java Either the documentation needs to be updated or the constructor needs to throw an IllegalArgumentException if the passed-in text parameter is null.IllegalArgumentException
I wonder if throwing a NullPointerException would be better than IllegalArgumentException? If you could work up a unit test + patch for whatever seems the most sensible option, that'd be wonderful!
Created attachment 33009 [details] Fixed documentation patch
Created attachment 33010 [details] throws IllegalArgumentException patch Select one of the attached patches, NOT BOTH! Feel free to change the exception type to NullPointerException. I feel that an IllegalArgumentException is more descriptive because it describes the problem as invalid input to a method/constructor rather than accidentally dereferencing a null pointer (which would happen if the constructor didn't check for null and a later method expected non-null).
Created attachment 33011 [details] throws IllegalArgumentException patch import java.awt.Color instead of java.awt.*
Thanks, second patch committed in r1696638.