harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexei Zakharov" <alexei.zakha...@gmail.com>
Subject Re: [classlib][sql] Compatibility issue of SerialBlob.setBinaryStream(long pos)
Date Wed, 10 Jan 2007 13:38:46 GMT
> "If this SerialBlob is instantiated with a byte array, a SerialException
> is thrown."
> So I say throw the SerialException.

+1 from me.

Regards,

2007/1/8, Tim Ellison <t.p.ellison@gmail.com>:
> 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!


-- 
Alexei Zakharov,
Intel ESSD

Mime
View raw message