Possible bug with JSON parser

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.5.3
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      It seems strange that this test passes, but it does:

          @org.junit.Test
          public void testJSONParseOfPartialLong() {
              Object obj = com.mongodb.util.JSON.parse("666 is the devil");
              Assert.assertEquals(Long.valueOf(666), obj);
          }
      

      We happen to be using that method to parse a query parameter to one of our REST endpoints, and it bit us. Should it not throw a JSONParseException instead of swallowing " is the devil" silently?

            Assignee:
            Bryan Reinero (Inactive)
            Reporter:
            Jeff Yemin (Inactive)
            None
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: