Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-1992

java.lang.ArrayIndexOutOfBoundsException if positional parameter are not started from 1

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.0
    • Fix Version/s: 2.2.0
    • Component/s: kernel
    • Labels:
      None

      Description

      Query q = em.createQuery("SELECT x FROM Magazine x WHERE x.title = ?2 and x.price > ?3");
      q.setParameter(2, "JDJ").setParameter(3, 25.0);

      When the query is executed, java.lang.ArrayIndexOutOfBoundsException will be thrown. Since "JDJ" and "25.0" will be stored in arr[0] and arr[1] (when arr.size =2) but the query execution code tries to get them via arr[2] and arr[3].

        Attachments

        1. Main.java
          3 kB
          Han Hong Fang
        2. OPENJPA-1992.patch
          2 kB
          Han Hong Fang

          Issue Links

            Activity

              People

              • Assignee:
                mikedd Michael Dick
                Reporter:
                hanhongfang Han Hong Fang
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: