harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Liang <richard.lian...@gmail.com>
Subject Re: [classlib] Exception throwing compatibility: java.util.Scanner
Date Thu, 06 Jul 2006 14:04:32 GMT


Anton Avtamonov wrote:
> Hi Richard,
>
> Very good example.
> You are right, spec says nothing about invalid radix processing for
> nextInt(). RI behavior just proves they have no guard check. However
> useRadix() produces IAE for the invalid radix and the sound of logic
> says that IAE is a proper reaction for wrong radix in any method with
> radix. Looks like a bug in RI for me...
>
> Don't beat me please :-), but I would suggest two approaches:
> - either no checks for radix, so that underlying algorithm does or
> doesn't produce some exceptions
> - implement guard check and produce IAE.
>
> I believe that right solution is the second one - produce IAE -
> however it potentailly results in less compatibility with RI.
>
Thanks a lot, Anton.

Actually, I'd like to follow RI's behavior except throwing a meaningless 
PatternSyntaxException when radix is 0.

It's said that RI will update spec instead of implementation when bug is 
reported[1] [2] ;-)

1. 
http://www.mail-archive.com/harmony-dev@incubator.apache.org/msg09588.html
2. 
http://www.mail-archive.com/harmony-dev@incubator.apache.org/msg09589.html

-- 
Richard Liang
China Software Development Lab, IBM 



---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message