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-1797) [classlib][swing] javax.swing.text.PlainDocument.removeUpdate(AbstractDocument.DefaultDocumentEvent chng) throws unspecified NullPointerException
Date Mon, 12 Feb 2007 15:17:05 GMT

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

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

Works fine.
Thank you Mark.

> [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.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message