harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Petrenko (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-2709) [classlib][swing] javax.swing.plaf.basic.BasicInternalFrameUI.setupMenuOpenKey() throws unspecified IllegalArgumentException
Date Thu, 15 Mar 2007 16:13:09 GMT

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

Alexey Petrenko commented on HARMONY-2709:
------------------------------------------

Sergey,

I've created a small test to check do we need to initialize frame field or not.
frame is protected field so we can easily test the RI's behavior. Here is the test:
=== cut ===
import javax.swing.JButton;
import javax.swing.JInternalFrame;
import javax.swing.plaf.basic.BasicInternalFrameUI;
 
public class Harmony2709Test {
    public static class TestInternalFrameUI extends BasicInternalFrameUI {
        TestInternalFrameUI(JInternalFrame frm) {
            super(frm);
        }
        
        public JInternalFrame getFrame() {
            return frame;
        }
    }
 
    public static void main(String argv[]) {
        JInternalFrame jif = new JInternalFrame();
        TestInternalFrameUI bif = new TestInternalFrameUI(jif);
 
        System.err.println("UI frame: "+bif.getFrame());
        System.err.println("Frames are equals: "+(jif == bif.getFrame()));
    }
}
=== cut ===
 
It creates subclass of BasicInternalFrameUI and checks the frame field value right after constructor
call.
Here is output from RI:
UI frame: null
Frames are equals: false
 
Here is output from Harmony without the patch (same as RI):
UI frame: null
Frames are equals: false
 
Here is output from Harmony with the patch:
UI frame: javax.swing.JInternalFrame[... skipped ...]
Frames are equals: true
 
This means that your patch introduces a regression to Harmony code and this patch is can not
be applied without changes.
 
Please be more careful with your patches.
 
Thanks in advance.

> [classlib][swing] javax.swing.plaf.basic.BasicInternalFrameUI.setupMenuOpenKey() throws
unspecified IllegalArgumentException
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2709
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2709
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Alexander Simbirtsev
>         Assigned To: Alexey Petrenko
>         Attachments: Harmony-2709-BasicInternalFrameUI.patch, Harmony-2709-BasicInternalFrameUITest.patch
>
>
> Compatibility
> There is no mention of any exception in the specification.
> Harmony throws unspecified IllegalArgumentException for setupMenuOpenKey() while RI throws
unspecified NPE.
> Use the following code to reproduce:
> import javax.swing.JInternalFrame;
> import javax.swing.plaf.basic.BasicInternalFrameUI;
> import junit.framework.TestCase;
> public class Test extends TestCase {
>     public void testcase1() {                                    
>         try {
>             testBasicInternalFrameUI fr = new testBasicInternalFrameUI(null);
>             fr.setupMenuOpenKey();
>         } catch (IllegalArgumentException e) {
>             fail("exception thrown");
>         } catch (NullPointerException e) {
>             // expected
>         }
>     }
> }
> class testBasicInternalFrameUI extends BasicInternalFrameUI {
>     testBasicInternalFrameUI(JInternalFrame s){
>         super(s);
>     }
>     
>     public void setupMenuOpenKey()  {
>         super.setupMenuOpenKey();
>     }
> }

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