Uploaded image for project: 'Commons JXPath'
  1. Commons JXPath
  2. JXPATH-151

null handling is inconsistent

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 1.3
    • None
    • None
    • windows oracle jvm 1.6_25

    Description

      Comparing a vaule to null using unequals (!=) yields false!

              Map<String, Integer> m = new HashMap<String, Integer>();
              m.put("a", 1);
              m.put("b", null);
              m.put("c", 1);
              JXPathContext c = JXPathContext.newContext(m);
              System.out.println(c.getValue("a != b") + " should be true");
              System.out.println(c.getValue("a != c") + " should be false");
              System.out.println(c.getValue("a = b") + " should be false");
              System.out.println(c.getValue("a = c") + " should be true");
              System.out.println(c.getValue("not(a = b)") + " should be true");
              System.out.println(c.getValue("not(a = c)") + " should be false");
      

      Output using 1.3:
      false should be true
      false should be false
      false should be false
      true should be true
      true should be true
      false should be false

      In 1.2 it works correctly!

      Attachments

        Activity

          People

            Unassigned Unassigned
            joshi Johannes Stelzer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: