You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Chris A. Mattmann (JIRA)" <ji...@apache.org> on 2010/01/13 07:25:54 UTC

[jira] Commented: (SOLR-1591) XMLWriter#writeAttr silently ignores null attribute values

    [ https://issues.apache.org/jira/browse/SOLR-1591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12799604#action_12799604 ] 

Chris A. Mattmann commented on SOLR-1591:
-----------------------------------------

Hey Yonik:

Thanks for your last comment, but I'm still confused. This is a wasted method call. At the very least, the method should log a message saying "a null attribute was attempted to be written". Otherwise you have no record that the function was even called at all, which makes it hard to debug and track things down. I'd favor an exception to be thrown and a null check explicitly (at the expense of the additional lines of code) since it's more verbose and explicit rather than implicit.

Thoughts? Anyone?

Cheers,
Chris


> 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.