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

Parameter substitution (MacroExpander) Map expand issue

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 6.0.1
    • Fix Version/s: 6.4
    • Component/s: None
    • Security Level: Public (Default Security Level. Issues are Public)
    • Labels:
      None

      Description

        @Test
        public void testMap() {
          final Map<String,String[]> request = new HashMap<String,String[]>();
          request.put("fq", new String[] {"${one_ref}","two"});
          request.put("one_ref",new String[] {"one"});
          Map expanded = MacroExpander.expand(request);
          assertEquals("one", ((String[])expanded.get("fq"))[0]);
          assertEquals("two", ((String[]) expanded.get("fq"))[1]);
        }
      

      fails with `java.lang.ArrayIndexOutOfBoundsException` because the resultant `expanded` structure only has a single "fq" value of "one". "two" got eaten.

        Attachments

          Activity

            People

            • Assignee:
              yseeley@gmail.com Yonik Seeley
              Reporter:
              ehatcher Erik Hatcher
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: