harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Zhang (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-3335) [classlib][sql] SerialClob.setString(long, String) should not throw ArrrayIndexOutOfBoundsException
Date Thu, 08 Mar 2007 10:39:24 GMT
[classlib][sql] SerialClob.setString(long, String) should not throw ArrrayIndexOutOfBoundsException

                 Key: HARMONY-3335
                 URL: https://issues.apache.org/jira/browse/HARMONY-3335
             Project: Harmony
          Issue Type: Bug
          Components: Classlib, Non-bug differences from RI
            Reporter: Andrew Zhang
            Priority: Minor

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
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

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message