You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by LvJimmy,Jing <fi...@gmail.com> on 2007/05/09 11:05:53 UTC

[classlib][sql] RI forgets to throw the exception?

Hi All,

     I meet something interesting when I try to improve/fix a bug on
javax.sql.rowset.serial.SerialJavaObject, the Spec reads:
(The constructor)
"public SerialJavaObject(Object obj)
                 throws SerialException
...
Throws:
    SerialException - if the object is found to be unserializable"

But a simple test shows that RI forgets to do so:
    public void test_Constructor() throws Exception {
        new SerialJavaObject(new Object());
    }
RI passed quickly on this test on my desktop(windows, both RI6 build
1.6.0-b105 and RI5 build 1.5.0_06)

IIRC, we should follow Spec than RI, so I suggest we throw the proper
exception here in our code.
Any comments/suggestions? Thanks!
-- 

Best Regards!

Jimmy, Jing Lv
China Software Development Lab, IBM

Re: [classlib][sql] RI forgets to throw the exception?

Posted by Andrew Zhang <zh...@gmail.com>.
On 5/9/07, Tony Wu <wu...@gmail.com> wrote:
>
> IMO, SerialJavaObject is used for checking if the object is
> serializable. it's hard to  believe that RI forgot to do so.


>From my experience for writing javax.sql.rowset.serial package, I think
we'll find many more incredible things of RI.


On 5/9/07, LvJimmy,Jing <fi...@gmail.com> wrote:
> > Hi All,
> >
> >     I meet something interesting when I try to improve/fix a bug on
> > javax.sql.rowset.serial.SerialJavaObject, the Spec reads:
> > (The constructor)
> > "public SerialJavaObject(Object obj)
> >                 throws SerialException
> > ...
> > Throws:
> >    SerialException - if the object is found to be unserializable"
> >
> > But a simple test shows that RI forgets to do so:
> >    public void test_Constructor() throws Exception {
> >        new SerialJavaObject(new Object());
> >    }
> > RI passed quickly on this test on my desktop(windows, both RI6 build
> > 1.6.0-b105 and RI5 build 1.5.0_06)
> >
> > IIRC, we should follow Spec than RI, so I suggest we throw the proper
> > exception here in our code.
> > Any comments/suggestions? Thanks!
> > --
> >
> > Best Regards!
> >
> > Jimmy, Jing Lv
> > China Software Development Lab, IBM
> >
>
>
> --
> Tony Wu
> China Software Development Lab, IBM
>



-- 
Best regards,
Andrew Zhang

http://zhanghuangzhu.blogspot.com/

Re: [classlib][sql] RI forgets to throw the exception?

Posted by Tony Wu <wu...@gmail.com>.
IMO, SerialJavaObject is used for checking if the object is
serializable. it's hard to  believe that RI forgot to do so.

On 5/9/07, LvJimmy,Jing <fi...@gmail.com> wrote:
> Hi All,
>
>     I meet something interesting when I try to improve/fix a bug on
> javax.sql.rowset.serial.SerialJavaObject, the Spec reads:
> (The constructor)
> "public SerialJavaObject(Object obj)
>                 throws SerialException
> ...
> Throws:
>    SerialException - if the object is found to be unserializable"
>
> But a simple test shows that RI forgets to do so:
>    public void test_Constructor() throws Exception {
>        new SerialJavaObject(new Object());
>    }
> RI passed quickly on this test on my desktop(windows, both RI6 build
> 1.6.0-b105 and RI5 build 1.5.0_06)
>
> IIRC, we should follow Spec than RI, so I suggest we throw the proper
> exception here in our code.
> Any comments/suggestions? Thanks!
> --
>
> Best Regards!
>
> Jimmy, Jing Lv
> China Software Development Lab, IBM
>


-- 
Tony Wu
China Software Development Lab, IBM