[ https://issues.apache.org/jira/browse/SOLR-1591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12799779#action_12799779 ]
Yonik Seeley commented on SOLR-1591: ------------------------------------ bq. Thanks for your last comment, but I'm still confused. *shrugs* - the example I gave was meant to show how defining the function to work for "null" can simplify code that calls the function. What didn't you understand about that? bq. At the very least, the method should log a message saying "a null attribute was attempted to be written". No, not if the function is well defined for a null value. And if we moved the null check to the callers, I'd argue that the null check should be entirely left out of writeAttr - skip the extra code and let the NPE happen naturally. > XMLWriter#writeAttr silently ignores null attribute values > ---------------------------------------------------------- > > Key: SOLR-1591 > URL: https://issues.apache.org/jira/browse/SOLR-1591 > Project: Solr > Issue Type: Bug > Affects Versions: 1.4 > Environment: My local MacBook pro laptop. > Reporter: Chris A. Mattmann > Priority: Minor > Fix For: 1.5 > > Attachments: SOLR-1591.Mattmann.112209.patch.txt > > > XMLWriter#writeAttr checks for val == null, and if so, does nothing. Instead > of doing nothing, it could leverage its method signature, and throw an > IOException declaring that the value provided is null. Patch, attached. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.