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

SolrClient.getByIds(ArrayList<String>) fails with class cast exception

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.1
    • Fix Version/s: 5.2
    • Component/s: clients - java
    • Labels:
      None
    • Environment:

      Java 1.7

      Description

      In the getById(collection<String>) function SolrClient:1172

      reqParams.set("ids", (String[]) ids.toArray());
      throws a ClassCastException: Object[] cannot be cast to String[]

      The call for toArray should be changed to the typed version
      reqParams.set("ids", ids.toArray(new String[ids.size()]));

        Attachments

        1. SOLR-7514.patch
          16 kB
          Ramkumar Aiyengar

          Activity

            People

            • Assignee:
              andyetitmoves Ramkumar Aiyengar
              Reporter:
              tomfarnworth Tom Farnworth
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: