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] Updated: (HARMONY-2603) [classlib][swing] j.s.undo.CompoundEdit.getPresentationName throws NPE
Date Mon, 11 Dec 2006 13:03:22 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-2603?page=all ]

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

    Attachment: H2603-CompoundEdit.patch

The fix: if getPresentationName() of last edit returned either null or empty string, the call
is forwarded to super implementation.

> [classlib][swing] j.s.undo.CompoundEdit.getPresentationName throws NPE
> ----------------------------------------------------------------------
>
>                 Key: HARMONY-2603
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2603
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Alexey A. Ivanov
>         Attachments: H2603-CompoundEdit.patch, H2603-CompoundEditTest.patch
>
>
> Code to reproduce:
> import java.util.Hashtable;
> import javax.swing.undo.CompoundEdit;
> import javax.swing.undo.StateEdit;
> import javax.swing.undo.StateEditable;
> public class Test {
>     private static StateEdit getStateEdit() {
>         return new StateEdit(new StateEditable() {
>             public void storeState(Hashtable arg0) {
>             }
>             public void restoreState(Hashtable arg0) {
>             }
>         });
>     }
>     public static void main(String[] args) {
>         CompoundEdit ce = new CompoundEdit();
>         ce.addEdit(getStateEdit());
>         try {
>             System.err.println("'" + ce.getPresentationName() + "'");
>             System.err.println(ce.getPresentationName() == null);
>         } catch (Exception e) {
>             e.printStackTrace();
>         }
>     }
> }
> ------ end of code ------
> === Harmony output ===
> java.lang.NullPointerException
> 	at javax.swing.undo.CompoundEdit.getPresentationName(CompoundEdit.java:111)
> 	at Test.main(Test.java:22)
> ===================
> === RI output ===
> 'null'
> true
> =============

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