harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Hindess (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (HARMONY-1797) [classlib][swing] javax.swing.text.PlainDocument.removeUpdate(AbstractDocument.DefaultDocumentEvent chng) throws unspecified NullPointerException
Date Fri, 12 Jan 2007 10:32:28 GMT

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

Mark Hindess resolved HARMONY-1797.
-----------------------------------

    Resolution: Fixed

Patches applied in r495538.  Aleksey, please confirm that this resolves the issue for you.


> [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

        

Mime
View raw message