<Swing Dev> <Swind Dev> [7u6] Review request for 6836089: Swing HTML parser can't properly decode codepoints outside the Unicode Plane 0 into a surrogate pair

Vladislav Karnaukhov Vladislav.Karnaukhov at oracle.com
Wed Jun 27 17:53:58 UTC 2012


Hello Pavel,

please find new webrev here: 
http://cr.openjdk.java.net/~vkarnauk/6836089/webrev.02/

I've fixed code style mistakes and re-wrote test, it now conforms to 
Swing test rules. I also run this test with jtreg to check if it works 
(it does).

Regards,
- Vlad

On 6/25/2012 6:43 PM, Pavel Porvatov wrote:
> Hi Vladislav,
>
> Do you have a link to the fix for 6u19?
>
> I didn't investigate the fix deeply, but
>
> 1.
>  private final int MAX_BMP_BOUND = 65535;
> should be static (otherwise variable name should be in lower case)
>
> 2. Add a space in single line comments
>
> 3.
> +                    char data[];
> +                    if (n <= MAX_BMP_BOUND) {
> +                        data = 
> Character.toChars(mapNumericReference((char) n));
> +                    } else {
> +                        data = Character.toChars(n);
> +                    }
> +
>                  return data;
>
> can be written in one line via "? :" operator and looks more readable 
> for me
>
> Thanks, Pavel
>> Hello,
>>
>> please review the fix for 6836089: Swing HTML parser can't properly 
>> decode codepoints outside the Unicode Plane 0 into a surrogate pair. 
>> This is a forward port from JDK6 (fixed escalated issue, fix 
>> integrated) to JDK7.
>>
>> The issue is a defect in Swing HTML Parser: if the codepoint is 
>> outside BMP (Unicode Plain 0), Parser incorrectly decodes codepoint 
>> into surrogate pair. The fix is to use Character.toChars() method if 
>> codepoint value is greater than upper bound of BMP.
>>
>> Webrev: http://cr.openjdk.java.net/~vkarnauk/6836089/webrev.00/
>> Bug description: 
>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6836089
>>
>> Regards,
>> - Vlad
>





More information about the swing-dev mailing list