harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aleksey Victorivich Yantsen (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-1817) [classlib][swing] javax.swing.text.html.HTMLEditorKit.createInputAttributes(Element element,MutableAttributeSet set) does not throw NullPointerException when RI does
Date Wed, 11 Oct 2006 05:43:20 GMT
[classlib][swing] javax.swing.text.html.HTMLEditorKit.createInputAttributes(Element element,MutableAttributeSet
set) does not throw NullPointerException when RI does
---------------------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-1817
                 URL: http://issues.apache.org/jira/browse/HARMONY-1817
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Aleksey Victorivich Yantsen
            Priority: Minor
         Attachments: 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.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message