You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Aleksey Victorivich Yantsen (JIRA)" <ji...@apache.org> on 2006/10/10 08:57:20 UTC

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

[classlib][swing] javax.swing.text.PlainDocument.removeUpdate(AbstractDocument.DefaultDocumentEvent chng) throws unspecified NullPointerException
-------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-1797
                 URL: http://issues.apache.org/jira/browse/HARMONY-1797
             Project: Harmony
          Issue Type: Bug
            Reporter: Aleksey Victorivich Yantsen
            Priority: Minor


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: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Posted by "Alexey A. Ivanov (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-1797?page=all ]

Alexey A. Ivanov updated HARMONY-1797:
--------------------------------------

    Attachment: H1797-PlainDocument.patch

H1797-PlainDocument.patch contains the bug fix.

> [classlib][swing] javax.swing.text.PlainDocument.removeUpdate(AbstractDocument.DefaultDocumentEvent chng) throws unspecified NullPointerException
> -------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1797
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1797
>             Project: Harmony
>          Issue Type: Bug
>            Reporter: Aleksey Victorivich Yantsen
>            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: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Posted by "Aleksey Victorivich Yantsen (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-1797?page=all ]

Aleksey Victorivich Yantsen updated HARMONY-1797:
-------------------------------------------------

    Attachment: patch1797.txt

Test patch.

> [classlib][swing] javax.swing.text.PlainDocument.removeUpdate(AbstractDocument.DefaultDocumentEvent chng) throws unspecified NullPointerException
> -------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1797
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1797
>             Project: Harmony
>          Issue Type: Bug
>            Reporter: Aleksey Victorivich Yantsen
>            Priority: Minor
>         Attachments: 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: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Posted by "Alexey A. Ivanov (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-1797?page=all ]

Alexey A. Ivanov updated HARMONY-1797:
--------------------------------------

    Attachment: H1797-PlainDocumentTest.patch

H1797-PlainDocumentTest.patch contains simplified regression test which is equivalent to the test case presented in patch1797.txt.

> [classlib][swing] javax.swing.text.PlainDocument.removeUpdate(AbstractDocument.DefaultDocumentEvent chng) throws unspecified NullPointerException
> -------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1797
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1797
>             Project: Harmony
>          Issue Type: Bug
>            Reporter: Aleksey Victorivich Yantsen
>            Priority: Minor
>         Attachments: 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: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira