Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-446

Possible bug with JSON parser

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.5.3
    • Component/s: None
    • Labels:
      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 Bryan Reinero
            Reporter:
            jeff.yemin@mtvstaff.com Jeff Yemin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: