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

Possible bug with JSON parser

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • 2.5.3
    • None
    • None

    Description

      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?

      Attachments

        Activity

          People

            bryan.reinero Bryan Reinero
            jeff.yemin@mtvstaff.com Jeff Yemin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: