|
Re: bug-to-bug compatibility - another issue: msg#00932java.harmony.devel
Mikhail Mikhail Loenko wrote: Paulex,As I said, what I paste at first is just ONE Example that RI's interesting internal status. I happened to have another simple JUnit test to show RI's contradiction on the paragraph above public void testFlushAfterDecode() throws Exception { ByteBuffer in = ByteBuffer.wrap(new byte[] { 98, 98 }); CharsetDecoder decoder = Charset.forName("utf-8").newDecoder(); CharBuffer out = decoder.decode(in); try { decoder.flush(out); fail("should illegal"); } catch (IllegalStateException e) { } } RI(JDK 5.0/1.4.2) failed to pass this test because the flush(out) is permitted, but from the spec above, the decoder.decode(in) should invoke flush method at last, and the current status is FLUSHED, so that the flush(out) after that should throw IllegalStateException. Should Harmony be same with RI again? So RI works according to class description. It might be a misprint in theI'm afraid I have different view on this, First, the method spec is not contradict with class's, the flush(CharBuffer) should be invoked in the decode(ByteBuffer), that's right, and it also can be invoked just after reset(), any logic problem? Second, how can we judge JavaDoc is misprinted? just by RI's behavior?
-- Paulex Yang China Software Development Lab IBM
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: bug-to-bug compatibility - another issue, Anton Avtamonov |
|---|---|
| Next by Date: | Re: bug-to-bug compatibility - another issue, Paulex Yang |
| Previous by Thread: | Re: bug-to-bug compatibility - another issue, Mikhail Loenko |
| Next by Thread: | Re: bug-to-bug compatibility - another issue, Mikhail Loenko |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |