harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey A. Ivanov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-1817) [classlib][swing] javax.swing.text.html.HTMLEditorKit.createInputAttributes(Element element,MutableAttributeSet set) does not throw NullPointerException when RI does
Date Tue, 13 Feb 2007 09:38:06 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-1817?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12472593
] 

Alexey A. Ivanov commented on HARMONY-1817:
-------------------------------------------

Does it make sense to keep these test cases which are identical to those in HARMONY-2594?

> [classlib][swing] javax.swing.text.html.HTMLEditorKit.createInputAttributes(Element element,MutableAttributeSet
set) does not throw NullPointerException when RI does
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1817
>                 URL: https://issues.apache.org/jira/browse/HARMONY-1817
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Aleksey Victorivich Yantsen
>         Assigned To: Alexey Petrenko
>            Priority: Minor
>         Attachments: HTMLEditorKitTest.java, StyledEditorKit_patch.txt
>
>
> Problem: createInputAttributes(Element element, MutableAttributeSet set) does not throw
NullPointerException when element or set are null. Reference implementation throws unspecified
NullPointerException in such cases.
> This is compatibility issue.
> Test to reproduce:
> import junit.framework.TestCase;
> import javax.swing.text.Element;
> import javax.swing.text.MutableAttributeSet;
> import javax.swing.text.SimpleAttributeSet;
> import javax.swing.text.html.HTMLDocument;
> import javax.swing.text.html.HTMLEditorKit;
> public class Test extends TestCase {
> 	class MyHTMLEditorKit extends HTMLEditorKit {
> 		public void createInputAttributes(Element element,
> 	            MutableAttributeSet set) {
> 			super.createInputAttributes(element, set);
> 		}
> 	}
> 	public void testElementIsNull() {
> 		MyHTMLEditorKit mhe = new MyHTMLEditorKit();
> 		Element e = null;
> 		MutableAttributeSet mas = new SimpleAttributeSet();
> 		
> 		mhe.createInputAttributes(e, mas);
> 	}
> 	public void testSetIsNull() {
> 		MyHTMLEditorKit mhe = new MyHTMLEditorKit();
> 		HTMLDocument hd = new HTMLDocument();
> 		Element e = hd.getDefaultRootElement();
> 		MutableAttributeSet mas = null;
> 		
> 		mhe.createInputAttributes(e, mas);
> 	}
> }
> Output on RI: 
> ================== 
> java version "1.5.0_06"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)
> .E.E
> Time: 0.375
> There were 2 errors:
> 1) testElementIsNull(Test)java.lang.NullPointerException
> 	at javax.swing.text.html.HTMLEditorKit.createInputAttributes(HTMLEditorKit.java:415)
> 	at Test$MyHTMLEditorKit.createInputAttributes(Test.java:14)
> 	at Test.testElementIsNull(Test.java:22)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 2) testSetIsNull(Test)java.lang.NullPointerException
> 	at javax.swing.text.html.HTMLEditorKit.createInputAttributes(HTMLEditorKit.java:414)
> 	at Test$MyHTMLEditorKit.createInputAttributes(Test.java:14)
> 	at Test.testSetIsNull(Test.java:31)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> FAILURES!!!
> Tests run: 2,  Failures: 0,  Errors: 2
> Output on Harmony: 
> ================== 
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r453981, (Oct  9 2006), Windows/ia32/msvc 1310, release build
> http://incubator.apache.org/harmony
> ..
> Time: 0.39
> OK (2 tests)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message