Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-7462

ArrayIndexOutOfBoundsException in RecordingJSONParser.java

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 5.1
    • 5.3.2, 5.4.1, 5.5, 6.0
    • None
    • None

    Description

      With Solr 5.1 I'm getting an occasional fatal exception during indexing. It's an ArrayIndexOutOfBoundsException at line 61 of org/apache/solr/util/RecordingJSONParser.java. Looking at the code (see below), it seems obvious that the if-statement at line 60 should use a greater-than sign instead of greater-than-or-equals.

      @Override
      public CharArr getStringChars() throws IOException {
      CharArr chars = super.getStringChars();
      recordStr(chars.toString());
      position = getPosition();
      // if reading a String , the getStringChars do not return the closing single quote or double quote
      //so, try to capture that
      if(chars.getArray().length >=chars.getStart()+chars.size()) { // line 60
      char next = chars.getArray()[chars.getStart() + chars.size()]; // line 61
      if(next =='"' || next == '\'')

      { recordChar(next); }

      }
      return chars;
      }

      Attachments

        1. SOLR-7462.patch
          0.7 kB
          Scott Dawson
        2. SOLR-7462.test.json
          17 kB
          Scott Dawson

        Activity

          People

            noble.paul Noble Paul
            se_dawson Scott Dawson
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: