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 08:14:54 UTC

[jira] Issue Comment Edited: (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=12799628#action_12799628 ] 

Chris A. Mattmann edited comment on SOLR-1591 at 1/13/10 7:13 AM:
------------------------------------------------------------------

Hey Noble:

Here are the disadvantages:

{quote}
    *  null values are rare .optimizing for cornercases is not a good idea
{quote}

It's not a corner case: much of the SOLR XML response calls this function for a null value (e.g., any tag without an explicit "name" attribute, which are e.g., all the docs in a result set, which can be large, depending on the start/end row params).

{quote}
    * the cost of a function call is almost zilch. it is not even measurable
{quote}

cost(function) > cost(comparison)

Cheers,
Chris



      was (Author: chrismattmann):
    Hey Noble:

Here are the disadvantages:

{quote}
    *  null values are rare .optimizing for cornercases is not a good idea
{quote}

It's not a corner case: much of the SOLR XML response calls this function for a null value (e.g., any tag without an explicit "name" attribute, which are e.g., all the docs in a result set, which can be large, depending on the start/end row params.

{quote}
    * the cost of a function call is almost zilch. it is not even measurable
{quote}

cost(function) > cost(comparison)

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