-
Bug
-
Resolution: Not an Issue
-
P4
-
7
-
x86
-
windows_7
FULL PRODUCT VERSION :
java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b05)
Java HotSpot(TM) 64-Bit Server VM (build 22.1-b02, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [version 6.1.7601] 64 bit
A DESCRIPTION OF THE PROBLEM :
When creating a JLabel with text equals to "<html>'</html>", the text displayed by this JLabel is set to "'", and not to the apostrophe character.
This bug seems to concern only the apostrophe character. All the other HTML entities we have tested are correctly escaped.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Create a JLabel as new JLabel("<html>'</html>")
2. Look at the text displayed
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The text displayed should be an apostrophe.
ACTUAL -
The text "'" is shown.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.swing.*;
public class Test {
public static void main(String[] args) {
JFrame frame = new JFrame();
JPanel panel = new JPanel();
panel.add(new JLabel("<html>"</html>")); // OK
panel.add(new JLabel("<html>'</html>")); // NOT OK !
panel.add(new JLabel("<html>&</html>")); // OK
panel.add(new JLabel("<html><</html>")); // OK
panel.add(new JLabel("<html>></html>")); // OK
frame.add(panel);
frame.setVisible(true);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Replace all "'" sequences from HTML code by apostrophe characters before passing it to JLabel.
java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b05)
Java HotSpot(TM) 64-Bit Server VM (build 22.1-b02, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [version 6.1.7601] 64 bit
A DESCRIPTION OF THE PROBLEM :
When creating a JLabel with text equals to "<html>'</html>", the text displayed by this JLabel is set to "'", and not to the apostrophe character.
This bug seems to concern only the apostrophe character. All the other HTML entities we have tested are correctly escaped.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Create a JLabel as new JLabel("<html>'</html>")
2. Look at the text displayed
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The text displayed should be an apostrophe.
ACTUAL -
The text "'" is shown.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.swing.*;
public class Test {
public static void main(String[] args) {
JFrame frame = new JFrame();
JPanel panel = new JPanel();
panel.add(new JLabel("<html>"</html>")); // OK
panel.add(new JLabel("<html>'</html>")); // NOT OK !
panel.add(new JLabel("<html>&</html>")); // OK
panel.add(new JLabel("<html><</html>")); // OK
panel.add(new JLabel("<html>></html>")); // OK
frame.add(panel);
frame.setVisible(true);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Replace all "'" sequences from HTML code by apostrophe characters before passing it to JLabel.