Solr
  1. Solr
  2. SOLR-7514

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major 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()]));

      1. SOLR-7514.patch
        16 kB
        Ramkumar Aiyengar

        Activity

        Hide
        Ramkumar Aiyengar added a comment -

        Patch with the fix. I have also shored up the tests a bit to catch this..

        Show
        Ramkumar Aiyengar added a comment - Patch with the fix. I have also shored up the tests a bit to catch this..
        Hide
        ASF subversion and git services added a comment -

        Commit 1678648 from Ramkumar Aiyengar in branch 'dev/trunk'
        [ https://svn.apache.org/r1678648 ]

        SOLR-7514: SolrClient.getByIds fails with ClassCastException

        Show
        ASF subversion and git services added a comment - Commit 1678648 from Ramkumar Aiyengar in branch 'dev/trunk' [ https://svn.apache.org/r1678648 ] SOLR-7514 : SolrClient.getByIds fails with ClassCastException
        Hide
        ASF subversion and git services added a comment -

        Commit 1678649 from Ramkumar Aiyengar in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1678649 ]

        SOLR-7514: SolrClient.getByIds fails with ClassCastException

        Show
        ASF subversion and git services added a comment - Commit 1678649 from Ramkumar Aiyengar in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1678649 ] SOLR-7514 : SolrClient.getByIds fails with ClassCastException
        Hide
        Ramkumar Aiyengar added a comment -

        Thanks for reporting Tom!

        Show
        Ramkumar Aiyengar added a comment - Thanks for reporting Tom!
        Hide
        Anshum Gupta added a comment -

        Bulk close for 5.2.0.

        Show
        Anshum Gupta added a comment - Bulk close for 5.2.0.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development