-
Bug
-
Resolution: Unresolved
-
P5
-
8, 11, 17, 20, 21
The implementation of SimpleAttributeSet.containsAttributes does not check for a null value of an attribute which results in throwing NullPointerException.
Steps to reproduce:
Run the attached AttributeSetCompare.java test.
Expected output:
true
true
Actual output:
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "Object.equals(Object)" because the return value of "javax.swing.text.AttributeSet.getAttribute(Object)" is null
at java.desktop/javax.swing.text.SimpleAttributeSet.containsAttributes(SimpleAttributeSet.java:182)
at java.desktop/javax.swing.text.SimpleAttributeSet.isEqual(SimpleAttributeSet.java:119)
at AttributeSetCompare.main(AttributeSetCompare.java:32)
If you change the value of the attribute for `b` to a non-null value (for example "value"), the expected output would be:
false
false
whereas the actual output is:
false
Exception in thread "main" java.lang.NullPointerException: ...
Steps to reproduce:
Run the attached AttributeSetCompare.java test.
Expected output:
true
true
Actual output:
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "Object.equals(Object)" because the return value of "javax.swing.text.AttributeSet.getAttribute(Object)" is null
at java.desktop/javax.swing.text.SimpleAttributeSet.containsAttributes(SimpleAttributeSet.java:182)
at java.desktop/javax.swing.text.SimpleAttributeSet.isEqual(SimpleAttributeSet.java:119)
at AttributeSetCompare.main(AttributeSetCompare.java:32)
If you change the value of the attribute for `b` to a non-null value (for example "value"), the expected output would be:
false
false
whereas the actual output is:
false
Exception in thread "main" java.lang.NullPointerException: ...
- relates to
-
JDK-7083187 Class CSS.CssValue is missing implementations of equals() and hashCode()
-
- Resolved
-
- links to