#477 meta with nulls parsed as marker

Andrey Zakharov Thu 16 Mar 2017

verifyGrid("ver:\"2.0\" tag:N\n" +
  "a nullmetatag:N, b markermetatag\n" +
  "",
  null, // meta
  new Object[] { "a", new Object[] {"nullmetatag", null}, "b", new Object[] { "markermetatag", HMarker.VAL} },
  new HVal[][] {}
);

doesnt pass in haysstack-java 138 revision (is it latest?)

  1. it gives NPE while calling to assert, dict couldnt toString() as it contains null value: HDict.toZincMeta:
    sb.append(name);
    if (val != HMarker.VAL) { sb.append(':').append(val.toZinc()); }
  2. but it appears in HDict by wrong - it shouldn't be there at all: HZincReader.parseDict:
    // tag value
    HVal val = HMarker.VAL;
    if (cur == HaystackToken.colon)
    {
      consume(HaystackToken.colon);
      val = parseVal();
    }
    db.add(id, val);

parseVal returns everything right, i think: parseVal:

if ("N".equals(id))   return null;

so, we need a check in parseDict?

Matthew Giannini Fri 17 Mar 2017

Thanks for reporting Andrey. I have pushed a fix for haystack-java to the bitbucket repo. Sync up and see if it is working ok for you.

Login or Signup to reply.