You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Andrew Zhang <zh...@gmail.com> on 2007/03/23 21:45:44 UTC

[classlib][sql] SerialClob.setAsciiStream/setCharacterStream should throw SerialException if it's instantiated with a char array

Hi folks,

RI behaves strangely of SerialClob.setAsciiStream/setCharacterStream,
consider:

   public void testSetAsciiStream() throws Exception {
        SerialClob serialClob = new SerialClob("helloo".toCharArray());
        serialClob.setAsciiStream(1);
    }

    public void testSetCharacterStream() throws Exception {
        SerialClob serialClob = new SerialClob("helloo".toCharArray());
        serialClob.setCharacterStream(1);
    }

As spec says "If this SerialClob object is instantiated with a char array, a
SerialException object is thrown." But both test cases throw
NullPointerException. Can we regard it as RI's bug?

Thanks!
-- 
Best regards,
Andrew Zhang

Re: [classlib][sql] SerialClob.setAsciiStream/setCharacterStream should throw SerialException if it's instantiated with a char array

Posted by Andrew Zhang <zh...@gmail.com>.
On 3/24/07, Alexei Zakharov <al...@gmail.com> wrote:
>
> Looks like another RI bug. IMO it should throw SerialException instead
> NPE as directly written in spec. I am +1 for SerialException.


Thanks Alexei, I've filed a JIRA issue
http://issues.apache.org/jira/browse/HARMONY-3491.

Regards,
>
> 2007/3/23, Andrew Zhang <zh...@gmail.com>:
> > Hi folks,
> >
> > RI behaves strangely of SerialClob.setAsciiStream/setCharacterStream,
> > consider:
> >
> >    public void testSetAsciiStream() throws Exception {
> >         SerialClob serialClob = new SerialClob("helloo".toCharArray());
> >         serialClob.setAsciiStream(1);
> >     }
> >
> >     public void testSetCharacterStream() throws Exception {
> >         SerialClob serialClob = new SerialClob("helloo".toCharArray());
> >         serialClob.setCharacterStream(1);
> >     }
> >
> > As spec says "If this SerialClob object is instantiated with a char
> array, a
> > SerialException object is thrown." But both test cases throw
> > NullPointerException. Can we regard it as RI's bug?
> >
> > Thanks!
> > --
> > Best regards,
> > Andrew Zhang
> >
>
>
> --
> Alexei Zakharov,
> Intel ESSD
>



-- 
Best regards,
Andrew Zhang

Re: [classlib][sql] SerialClob.setAsciiStream/setCharacterStream should throw SerialException if it's instantiated with a char array

Posted by Alexei Zakharov <al...@gmail.com>.
Looks like another RI bug. IMO it should throw SerialException instead
NPE as directly written in spec. I am +1 for SerialException.

Regards,

2007/3/23, Andrew Zhang <zh...@gmail.com>:
> Hi folks,
>
> RI behaves strangely of SerialClob.setAsciiStream/setCharacterStream,
> consider:
>
>    public void testSetAsciiStream() throws Exception {
>         SerialClob serialClob = new SerialClob("helloo".toCharArray());
>         serialClob.setAsciiStream(1);
>     }
>
>     public void testSetCharacterStream() throws Exception {
>         SerialClob serialClob = new SerialClob("helloo".toCharArray());
>         serialClob.setCharacterStream(1);
>     }
>
> As spec says "If this SerialClob object is instantiated with a char array, a
> SerialException object is thrown." But both test cases throw
> NullPointerException. Can we regard it as RI's bug?
>
> Thanks!
> --
> Best regards,
> Andrew Zhang
>


-- 
Alexei Zakharov,
Intel ESSD