harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Ellison <t.p.elli...@gmail.com>
Subject Re: [classlib][sql] Compatibility issue of SerialBlob.setBinaryStream(long pos)
Date Mon, 08 Jan 2007 16:04:44 GMT
The main JavaDoc description seems quite clear to me:
"If this SerialBlob is instantiated with a byte array, a SerialException
is thrown."

So I say throw the SerialException.

Regards,
Tim

Andrew Zhang wrote:
> Hi guys,
> 
> sorry, SerialBlob compatibility problem again. It's the last unimplemented
> method of SerialBlob, setBinaryStream(long pos). The spec says "throws
> SerialException - if the SerialBlob in not instantiated with a Blob object
> that supports setBinaryStream()".  What should happen if the SerialBlob is
> instantiated with a byte buffer? As my understanding, it should throw
> SerialException, but I feel the spec is a little ambiguous, is it? I need
> native speakers' help. :-) Anyway, I think throws SerialException sounds
> reasonable to me if it's instantiated with a byte buffer. But RI throws
> NullPointerException instead. Following test shows the problem:
> public void testSetBinaryStreamJ() throws Exception {
>        byte[] buf = { 1, 2, 3, 4, 5, 6, 7, 8 };
>        SerialBlob serialBlob = new SerialBlob(buf);
>        serialBlob.setBinaryStream(1);
>    }
> Shall we follow RI or throw SerialException? Thanks!
> 

Mime
View raw message