harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anton Avtamonov" <anton.avtamo...@gmail.com>
Subject Re: bug-to-bug compatibility - another issue
Date Wed, 22 Feb 2006 09:33:05 GMT
On 2/22/06, Paulex Yang <paulex.yang@gmail.com> wrote:
> But the spec of CharsetDecoder.flush() says:
> Throws:
>    IllegalStateException - If the previous step of the current decoding
> operation was an invocation neither of the reset method nor of the
> three-argument decode method with a value of true for the endOfInput
> parameter
> It's so interesting that the spec emphasizes it SHOULD NOT throw
> IllegalStateException when flush() just after reset().
> In fact, this is just one example of contradiction between spec and RI's
> CharsetDecoder/Encoder internal status implementation. These *bugs*  are
> serious so that the RI's Decoder/Encoder must be used by experiment.
> Should Harmony be compatible with RI?

Hi Paulex,
I have no deep knowledge in this area and therefore cannot really
judge the possible impact. My opinion is from common sense only:
- spec DEFINITELY states exception should not be thrown and people
DEFINITELY take this into account
- I cannot believe applications really EXPECT this exception to detect
this particular scenario and do something specific for the case
flush() is called after reset(). Most likely application just stop
processing if exception occur. Exception is terated as a 'signal that
something is wrong'.
- I cannot find what is wrong in calling flush() after reset(). Looks
like quite normal operation. Spec proves that.

My opinion here - to follow the spec. At least unless we really have
an application failing on that (what I personally hardly believe to

Anton Avtamonov,
Intel Middleware Products Division

View raw message