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

[classlib][sql] RI throws SerialException when both parameters in SerialBlob.getBytes(long pos, int len) are valid.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • None
    • Patch Available

    Description

      RI throws SerialException when both parameters in SerialBlob.getBytes(long pos, int len) are valid.
      Consider following code:
      public void testGetBytesJI1() throws Exception {
      byte[] buf =

      { 1, 2, 3, 4, 5, 6, 7, 8 }

      ;
      SerialBlob serialBlob = new SerialBlob(buf);
      byte [] data = serialBlob.getBytes(2, 1);
      assertEquals(1, data.length);
      assertEquals(2, data[0]);
      }
      Harmony passes the test, while RI throws SerialException with message "Invalid arguments: position cannot be less that 1". As discussed in mailing list, Harmony's behaviour is reasonable, and it's non bug different from RI.

      Best regards,
      Andrew

      Attachments

        1. patch.diff
          1 kB
          Zhang Huang Zhu

        Activity

          People

            zakha Alexei Zakharov
            zhanghuangzhu Zhang Huang Zhu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: