Codereview Request for 8007379: Base64.getMimeDecoder().decode() throws IAE for a non-base64 character after padding
Xueming Shen
xueming.shen at oracle.com
Tue Apr 2 16:12:09 UTC 2013
Thanks Alan! Wording has been updated as suggested.
http://cr.openjdk.java.net/~sherman/8007379_8008925/webrev/src/share/classes/java/util/Base64.java.sdiff.html
-Sherman
On 04/02/2013 07:39 AM, Alan Bateman wrote:
> On 27/03/2013 22:20, Xueming Shen wrote:
>> Hi,
>>
>> Please help review the fix for the following two bugs:
>>
>> (1) 8007379: Base64.getMimeDecoder().decode() throws IAE for a non-base64 character after padding
>> We fixed the similar issue in 8006530, it appears there is "yet another" corner case
>> to close here. As described in the bug report, the calculation for output buffer size
>> for such case is incorrect when decoding in mime mode. The proposed change
>> should fix the problem.
>>
>> (2) 8008925: Base64.getMimeDecoder().decode() does not ignore padding chars
>> The change is to clarify the specification that "the padding character(s) is not
>> required for decoding. BUT, if the padding character(s) does appear, they must
>> be correctly encoded."
>>
>> http://cr.openjdk.java.net/~sherman/8007379_8008925/webrev
> These corner cases are a pain. The implementation changes look fine to me.
>
> For the javadoc change then I suggest
>
> "But if" --> "If"
>
> "otherwise the IllegalArgumentException will be thrown" --> "otherwise {@code IllegalArgumentException} is thrown during decoding".
>
> -Alan.
More information about the core-libs-dev
mailing list