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 Mark Miller <ma...@gmail.com> on 2009/09/27 06:11:48 UTC

DebugLogger oddity

DebugLogger has the following code:

    public DebugInfo(String name, int type, DebugInfo parent) {
      this.name = name;
      this.type = type;
      this.parent = parent;
      lst = new NamedList();
      if (parent != null) {
        String displayName = null;
        if (type == SolrWriter.START_ENTITY) {
          displayName = "entity:" + name;
        } else if (type == SolrWriter.TRANSFORMED_ROW
                || type == SolrWriter.TRANSFORMER_EXCEPTION) {
          displayName = "transformer:" + name;
        } else if (type == SolrWriter.START_DOC) {
          name = displayName = "document#" + SolrWriter.getDocCount();
        }
        parent.lst.add(displayName, lst);
      }
    }

That last assignment to name does nothing, so I'm guessing its meant to
be this.name, or else it can be removed.

-- 
- Mark

http://www.lucidimagination.com




Re: DebugLogger oddity

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Sun, Sep 27, 2009 at 9:41 AM, Mark Miller <ma...@gmail.com> wrote:

> DebugLogger has the following code:
>
>    public DebugInfo(String name, int type, DebugInfo parent) {
>      this.name = name;
>      this.type = type;
>      this.parent = parent;
>      lst = new NamedList();
>      if (parent != null) {
>        String displayName = null;
>        if (type == SolrWriter.START_ENTITY) {
>          displayName = "entity:" + name;
>        } else if (type == SolrWriter.TRANSFORMED_ROW
>                || type == SolrWriter.TRANSFORMER_EXCEPTION) {
>          displayName = "transformer:" + name;
>        } else if (type == SolrWriter.START_DOC) {
>          name = displayName = "document#" + SolrWriter.getDocCount();
>        }
>        parent.lst.add(displayName, lst);
>      }
>    }
>
> That last assignment to name does nothing, so I'm guessing its meant to
> be this.name, or else it can be removed.
>
>
Yeah, that should've been this.name. The name is not used anywhere other
than the constructor so it can be made a local variable. However, I guess it
is there for future use.

-- 
Regards,
Shalin Shekhar Mangar.