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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.0
    • 2.2.0
    • kernel
    • 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
          Hong Fang Han
        2. OPENJPA-1992.patch
          2 kB
          Hong Fang Han

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: