<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

Pavel Porvatov pavel.porvatov at oracle.com
Mon Jun 25 14:43:02 UTC 2012


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