Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-3335

[classlib][sql] SerialClob.setString(long, String) should not throw ArrrayIndexOutOfBoundsException

Details

    Description

      As spec says, SerialClob.setString(long, String) throws SerialException - if there is an error accessing the CLOB value; if an invalid position is set; if an invalid offset value is set; if number of bytes to be written is greater than the SerialClob length; or the combined values of the length and offset is greater than the Clob buffer. But following code throws ArrayIndexOutOfBoundException instead.
      public void test() {
      String s = "hello";
      char[] buf = s.toCharArray();
      SerialClob serialClob = new SerialClob(buf);
      try

      { serialClob.setString(2, "hello"); fail("should throw SerialException"); }

      catch (SerialException e)

      { // expected }


      }

      As discussed in dev mailing list, Harmony will comply with spec, and won't follow RI for this case.

      Attachments

        Activity

          People

            Unassigned Unassigned
            zhanghuangzhu Zhang Huang Zhu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment