You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Mark Hindess (JIRA)" <ji...@apache.org> on 2007/01/12 11:32:27 UTC

[jira] Assigned: (HARMONY-1797) [classlib][swing] javax.swing.text.PlainDocument.removeUpdate(AbstractDocument.DefaultDocumentEvent chng) throws unspecified NullPointerException

     [ https://issues.apache.org/jira/browse/HARMONY-1797?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Hindess reassigned HARMONY-1797:
-------------------------------------

    Assignee: Mark Hindess

> [classlib][swing] javax.swing.text.PlainDocument.removeUpdate(AbstractDocument.DefaultDocumentEvent chng) throws unspecified NullPointerException
> -------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1797
>                 URL: https://issues.apache.org/jira/browse/HARMONY-1797
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Aleksey Victorivich Yantsen
>         Assigned To: Mark Hindess
>            Priority: Minor
>         Attachments: H1797-PlainDocument.patch, H1797-PlainDocumentTest.patch, patch1797.txt
>
>
> Problem: javax.swing.text.PlainDocument.removeUpdate(AbstractDocument.DefaultDocumentEvent chng) throws unspecified NullPointerException if no change where made to document before removeUpdate is invoked.
> Test to reproduce:
> import junit.framework.TestCase;
> import javax.swing.text.PlainDocument;
> import javax.swing.text.AbstractDocument;
> import javax.swing.text.html.HTMLDocument;
> import javax.swing.event.DocumentEvent;
> class MyPlainDocument extends PlainDocument {
> 	public void removeUpdate(AbstractDocument.DefaultDocumentEvent chng) {
> 		super.removeUpdate(chng);
> 	}
> }
> public class Test extends TestCase {
> 	public void testcase() {
> 		MyPlainDocument mpd = new MyPlainDocument();
> 		HTMLDocument localHTMLDocument = new HTMLDocument();
> 		AbstractDocument.DefaultDocumentEvent chng = localHTMLDocument.new DefaultDocumentEvent( 3, 13, DocumentEvent.EventType.INSERT);
> 		
> 		mpd.removeUpdate(chng); // no exception should be thrown
> 	}
> }
> Output on Sun 1.5: 
> ================== 
> 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)
> .
> Time: 1.25
> OK (1 test)
> 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
> .E
> Time: 0.812
> There was 1 error:
> 1) testcase(Test)java.lang.NullPointerException
> 	at javax.swing.text.PlainDocument.removeUpdate(PlainDocument.java:155)
> 	at MyPlainDocument.removeUpdate(Test.java:10)
> 	at Test.testcase(Test.java:21)
> 	at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25)
> FAILURES!!!
> Tests run: 1,  Failures: 0,  Errors: 1

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira