<Swing Dev> RFR(S): 8234913 Improve parsing of Length Units in javax/swing/text/html/CSS

Volodin, Vladislav vladislav.volodin at sap.com
Mon Dec 2 22:38:43 UTC 2019


Hello Sergey,

indeed I wish I can create it. The main difficulty is that the exception (when it occurs) is handled by try-catch and swallowed. So only if I turn on the debugger with “any exception” breakpoint, I will be able to find that the execution path was wrong.

I am new here, and I will appreciate if you can give me an idea how to test the exception presence? Something with reflection? E.g. count a number of NumberFormatException constructor calls?

Kind regards,
Vlad

Sent from myFone

On 2. Dec 2019, at 23:24, Sergey Bylokhov <Sergey.Bylokhov at oracle.com> wrote:

Hi, Vladislav.

Is it possible to provide an automated test for this change?

On 11/28/19 2:08 am, Volodin, Vladislav wrote:
Hello everyone,
I'd like to contribute a little improvement to javax/swing/text/html/CSS. The issue is that "font-size: 100%" throws NumberFormatException for 100%, because of a wrong execution path. It is possible to reproduce the issue with the code below (but you should create Java exception breakpoints to see the place):
package com.test;
import javax.swing.text.MutableAttributeSet;
import javax.swing.text.SimpleAttributeSet;
import javax.swing.text.html.CSS;
import javax.swing.text.html.StyleSheet;
public class Main {
    public static void main(String[] args) {
        StyleSheet ss = new StyleSheet();
        MutableAttributeSet attr = new SimpleAttributeSet();
        ss.addCSSAttribute(attr, CSS.Attribute.FONT_SIZE, "100%");
    }
}
Bug: https://bugs.openjdk.java.net/browse/JDK-8234913
Webrev: http://cr.openjdk.java.net/~clanger/webrevs/8234913.0/
Kind regards,
Vlad


--
Best regards, Sergey.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/swing-dev/attachments/20191202/bce41c46/attachment-0001.html>


More information about the swing-dev mailing list