You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexey A. Ivanov (JIRA)" <ji...@apache.org> on 2006/12/22 12:02:21 UTC

[jira] Created: (HARMONY-2844) [classlib][swing] j.s.undo.StateEdit.init does not throw NPE on Harmony

[classlib][swing] j.s.undo.StateEdit.init does not throw NPE on Harmony
-----------------------------------------------------------------------

                 Key: HARMONY-2844
                 URL: http://issues.apache.org/jira/browse/HARMONY-2844
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Alexey A. Ivanov
            Priority: Minor


javax.swing.undo.StateEdit.init with null object parameter does not throw NPE on Harmony whereas it does on RI.

======= Code to Reproduce =======
import java.util.Hashtable;

import javax.swing.undo.StateEdit;
import javax.swing.undo.StateEditable;

public class Test {
    private static class TestStateEditable implements StateEditable {
        public void restoreState(Hashtable< ? , ? > ht) {
        }

        public void storeState(Hashtable<Object, Object> arg0) {
        }
    }

    private static class TestStateEdit extends StateEdit {
        public TestStateEdit(StateEditable anObject) {
            super(anObject);
        }

        @Override
        public void init(StateEditable anObject, String name) {
            super.init(anObject, name);
        }
    }

    public static void main(String[] args) {
        StateEditable stateEditable = new TestStateEditable();
        TestStateEdit stateEdit = new TestStateEdit(stateEditable);
        stateEdit.init(null, "name");
    }
}
======= end of code =======


No output when run on Harmony.

RI prints:
java.lang.NullPointerException
	at javax.swing.undo.StateEdit.init(StateEdit.java:103)
	at Test$TestStateEdit.init(Test.java:22)
	at Test.main(Test.java:29)

-- 
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] Commented: (HARMONY-2844) [classlib][swing] j.s.undo.StateEdit.init does not throw NPE on Harmony

Posted by "Mark Hindess (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12464694 ] 

Mark Hindess commented on HARMONY-2844:
---------------------------------------

The regression test passes for me without applying the fix?


> [classlib][swing] j.s.undo.StateEdit.init does not throw NPE on Harmony
> -----------------------------------------------------------------------
>
>                 Key: HARMONY-2844
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2844
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Alexey A. Ivanov
>            Priority: Minor
>         Attachments: H2844-StateEdit.patch, H2844-StateEditTest.patch
>
>
> javax.swing.undo.StateEdit.init with null object parameter does not throw NPE on Harmony whereas it does on RI.
> ======= Code to Reproduce =======
> import java.util.Hashtable;
> import javax.swing.undo.StateEdit;
> import javax.swing.undo.StateEditable;
> public class Test {
>     private static class TestStateEditable implements StateEditable {
>         public void restoreState(Hashtable< ? , ? > ht) {
>         }
>         public void storeState(Hashtable<Object, Object> arg0) {
>         }
>     }
>     private static class TestStateEdit extends StateEdit {
>         public TestStateEdit(StateEditable anObject) {
>             super(anObject);
>         }
>         @Override
>         public void init(StateEditable anObject, String name) {
>             super.init(anObject, name);
>         }
>     }
>     public static void main(String[] args) {
>         StateEditable stateEditable = new TestStateEditable();
>         TestStateEdit stateEdit = new TestStateEdit(stateEditable);
>         stateEdit.init(null, "name");
>     }
> }
> ======= end of code =======
> No output when run on Harmony.
> RI prints:
> java.lang.NullPointerException
> 	at javax.swing.undo.StateEdit.init(StateEdit.java:103)
> 	at Test$TestStateEdit.init(Test.java:22)
> 	at Test.main(Test.java:29)

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

        

[jira] Resolved: (HARMONY-2844) [classlib][swing] j.s.undo.StateEdit.init does not throw NPE on Harmony

Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2844?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Petrenko resolved HARMONY-2844.
--------------------------------------

    Resolution: Cannot Reproduce

The regression test was committed to svn.

Alexey, please confirm that you are agree with the resolution.

> [classlib][swing] j.s.undo.StateEdit.init does not throw NPE on Harmony
> -----------------------------------------------------------------------
>
>                 Key: HARMONY-2844
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2844
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Alexey A. Ivanov
>         Assigned To: Alexey Petrenko
>            Priority: Minor
>         Attachments: H2844-StateEdit.patch, H2844-StateEditTest.patch
>
>
> javax.swing.undo.StateEdit.init with null object parameter does not throw NPE on Harmony whereas it does on RI.
> ======= Code to Reproduce =======
> import java.util.Hashtable;
> import javax.swing.undo.StateEdit;
> import javax.swing.undo.StateEditable;
> public class Test {
>     private static class TestStateEditable implements StateEditable {
>         public void restoreState(Hashtable< ? , ? > ht) {
>         }
>         public void storeState(Hashtable<Object, Object> arg0) {
>         }
>     }
>     private static class TestStateEdit extends StateEdit {
>         public TestStateEdit(StateEditable anObject) {
>             super(anObject);
>         }
>         @Override
>         public void init(StateEditable anObject, String name) {
>             super.init(anObject, name);
>         }
>     }
>     public static void main(String[] args) {
>         StateEditable stateEditable = new TestStateEditable();
>         TestStateEdit stateEdit = new TestStateEdit(stateEditable);
>         stateEdit.init(null, "name");
>     }
> }
> ======= end of code =======
> No output when run on Harmony.
> RI prints:
> java.lang.NullPointerException
> 	at javax.swing.undo.StateEdit.init(StateEdit.java:103)
> 	at Test$TestStateEdit.init(Test.java:22)
> 	at Test.main(Test.java:29)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (HARMONY-2844) [classlib][swing] j.s.undo.StateEdit.init does not throw NPE on Harmony

Posted by "Alexey A. Ivanov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2844?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey A. Ivanov closed HARMONY-2844.
-------------------------------------


Oh, sorry, I haven't update the local copy completely.

Everything's fine.

> [classlib][swing] j.s.undo.StateEdit.init does not throw NPE on Harmony
> -----------------------------------------------------------------------
>
>                 Key: HARMONY-2844
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2844
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Alexey A. Ivanov
>         Assigned To: Alexey Petrenko
>            Priority: Minor
>         Attachments: H2844-StateEdit.patch, H2844-StateEditTest.patch
>
>
> javax.swing.undo.StateEdit.init with null object parameter does not throw NPE on Harmony whereas it does on RI.
> ======= Code to Reproduce =======
> import java.util.Hashtable;
> import javax.swing.undo.StateEdit;
> import javax.swing.undo.StateEditable;
> public class Test {
>     private static class TestStateEditable implements StateEditable {
>         public void restoreState(Hashtable< ? , ? > ht) {
>         }
>         public void storeState(Hashtable<Object, Object> arg0) {
>         }
>     }
>     private static class TestStateEdit extends StateEdit {
>         public TestStateEdit(StateEditable anObject) {
>             super(anObject);
>         }
>         @Override
>         public void init(StateEditable anObject, String name) {
>             super.init(anObject, name);
>         }
>     }
>     public static void main(String[] args) {
>         StateEditable stateEditable = new TestStateEditable();
>         TestStateEdit stateEdit = new TestStateEdit(stateEditable);
>         stateEdit.init(null, "name");
>     }
> }
> ======= end of code =======
> No output when run on Harmony.
> RI prints:
> java.lang.NullPointerException
> 	at javax.swing.undo.StateEdit.init(StateEdit.java:103)
> 	at Test$TestStateEdit.init(Test.java:22)
> 	at Test.main(Test.java:29)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-2844) [classlib][swing] j.s.undo.StateEdit.init does not throw NPE on Harmony

Posted by "Alexey A. Ivanov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470878 ] 

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

Yes, I agree with the resolution.
However, we should remove the duplicate test cases. HARMONY-2536 adds the same assertions as the one in *Test.patch. The only difference here a new test method is used whereas in HARMONY-2536 these assertions are added into the existing testInit() test method. Additionally the tests in HARMONY-2536 call StateEdit.init() indirectly -- they use constructor instead.
And the empty tearDown() should be removed.

Alexey, what do you think?

> [classlib][swing] j.s.undo.StateEdit.init does not throw NPE on Harmony
> -----------------------------------------------------------------------
>
>                 Key: HARMONY-2844
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2844
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Alexey A. Ivanov
>         Assigned To: Alexey Petrenko
>            Priority: Minor
>         Attachments: H2844-StateEdit.patch, H2844-StateEditTest.patch
>
>
> javax.swing.undo.StateEdit.init with null object parameter does not throw NPE on Harmony whereas it does on RI.
> ======= Code to Reproduce =======
> import java.util.Hashtable;
> import javax.swing.undo.StateEdit;
> import javax.swing.undo.StateEditable;
> public class Test {
>     private static class TestStateEditable implements StateEditable {
>         public void restoreState(Hashtable< ? , ? > ht) {
>         }
>         public void storeState(Hashtable<Object, Object> arg0) {
>         }
>     }
>     private static class TestStateEdit extends StateEdit {
>         public TestStateEdit(StateEditable anObject) {
>             super(anObject);
>         }
>         @Override
>         public void init(StateEditable anObject, String name) {
>             super.init(anObject, name);
>         }
>     }
>     public static void main(String[] args) {
>         StateEditable stateEditable = new TestStateEditable();
>         TestStateEdit stateEdit = new TestStateEdit(stateEditable);
>         stateEdit.init(null, "name");
>     }
> }
> ======= end of code =======
> No output when run on Harmony.
> RI prints:
> java.lang.NullPointerException
> 	at javax.swing.undo.StateEdit.init(StateEdit.java:103)
> 	at Test$TestStateEdit.init(Test.java:22)
> 	at Test.main(Test.java:29)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-2844) [classlib][swing] j.s.undo.StateEdit.init does not throw NPE on Harmony

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

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

    Attachment: H2844-StateEditTest.patch
                H2844-StateEdit.patch

Regression test and fix.

I've just removed null check from init() method.

> [classlib][swing] j.s.undo.StateEdit.init does not throw NPE on Harmony
> -----------------------------------------------------------------------
>
>                 Key: HARMONY-2844
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2844
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Alexey A. Ivanov
>            Priority: Minor
>         Attachments: H2844-StateEdit.patch, H2844-StateEditTest.patch
>
>
> javax.swing.undo.StateEdit.init with null object parameter does not throw NPE on Harmony whereas it does on RI.
> ======= Code to Reproduce =======
> import java.util.Hashtable;
> import javax.swing.undo.StateEdit;
> import javax.swing.undo.StateEditable;
> public class Test {
>     private static class TestStateEditable implements StateEditable {
>         public void restoreState(Hashtable< ? , ? > ht) {
>         }
>         public void storeState(Hashtable<Object, Object> arg0) {
>         }
>     }
>     private static class TestStateEdit extends StateEdit {
>         public TestStateEdit(StateEditable anObject) {
>             super(anObject);
>         }
>         @Override
>         public void init(StateEditable anObject, String name) {
>             super.init(anObject, name);
>         }
>     }
>     public static void main(String[] args) {
>         StateEditable stateEditable = new TestStateEditable();
>         TestStateEdit stateEdit = new TestStateEdit(stateEditable);
>         stateEdit.init(null, "name");
>     }
> }
> ======= end of code =======
> No output when run on Harmony.
> RI prints:
> java.lang.NullPointerException
> 	at javax.swing.undo.StateEdit.init(StateEdit.java:103)
> 	at Test$TestStateEdit.init(Test.java:22)
> 	at Test.main(Test.java:29)

-- 
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] Assigned: (HARMONY-2844) [classlib][swing] j.s.undo.StateEdit.init does not throw NPE on Harmony

Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2844?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Petrenko reassigned HARMONY-2844:
----------------------------------------

    Assignee: Alexey Petrenko

> [classlib][swing] j.s.undo.StateEdit.init does not throw NPE on Harmony
> -----------------------------------------------------------------------
>
>                 Key: HARMONY-2844
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2844
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Alexey A. Ivanov
>         Assigned To: Alexey Petrenko
>            Priority: Minor
>         Attachments: H2844-StateEdit.patch, H2844-StateEditTest.patch
>
>
> javax.swing.undo.StateEdit.init with null object parameter does not throw NPE on Harmony whereas it does on RI.
> ======= Code to Reproduce =======
> import java.util.Hashtable;
> import javax.swing.undo.StateEdit;
> import javax.swing.undo.StateEditable;
> public class Test {
>     private static class TestStateEditable implements StateEditable {
>         public void restoreState(Hashtable< ? , ? > ht) {
>         }
>         public void storeState(Hashtable<Object, Object> arg0) {
>         }
>     }
>     private static class TestStateEdit extends StateEdit {
>         public TestStateEdit(StateEditable anObject) {
>             super(anObject);
>         }
>         @Override
>         public void init(StateEditable anObject, String name) {
>             super.init(anObject, name);
>         }
>     }
>     public static void main(String[] args) {
>         StateEditable stateEditable = new TestStateEditable();
>         TestStateEdit stateEdit = new TestStateEdit(stateEditable);
>         stateEdit.init(null, "name");
>     }
> }
> ======= end of code =======
> No output when run on Harmony.
> RI prints:
> java.lang.NullPointerException
> 	at javax.swing.undo.StateEdit.init(StateEdit.java:103)
> 	at Test$TestStateEdit.init(Test.java:22)
> 	at Test.main(Test.java:29)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.