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-2666) [classlib][swing] javax.swing.plaf.metal.BasicInternalFrameTitlePane(null) doesn't throw unspecified NPE while RI does
Date Mon, 19 Feb 2007 09:06:05 GMT

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

Alexey A. Ivanov commented on HARMONY-2666:

Sergey, Alexey,

Of course, this is the problem! But not throwing NPE courses much less harm than throwing
NPE when an application want to use L&F decorations. Does it make sense?

To avoid NPE with L&F decoration the code should be re-designed -- it's not a easy thing.
Harmony implementation shares implementation of BasicInternalFrame (which is child frames)
on the main frame. Obviously it's good to share the code. But BasicInternalFrame can't configure
itself correctly if null is passed to its constructor -- this is the case where main frame
(i.e. of JFrame) decorations are initialized.

> [classlib][swing] javax.swing.plaf.metal.BasicInternalFrameTitlePane(null) doesn't throw
unspecified NPE while RI does
> ----------------------------------------------------------------------------------------------------------------------
>                 Key: HARMONY-2666
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2666
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Alexander Simbirtsev
>         Assigned To: Mark Hindess
>            Priority: Minor
>         Attachments: Harmony-2666-BasicInternalFrameTitlePane.patch, Harmony-2666-BasicInternalFrameTitlePaneTest.patch
> There is no mention of any exception in the specification.
> Harmony does not throw unspecified NPE for MetalInternalFrameTitlePane(null)
> while RI does.
> Use the following code to reproduce:
> import javax.swing.JInternalFrame;
> import javax.swing.plaf.basic.BasicInternalFrameTitlePane;
> import junit.framework.TestCase;
> public class Test extends TestCase {       
>     public static void main(String[] args) {                                
>         try {   
>             new BasicInternalFrameTitlePane((JInternalFrame) null);     
>         } catch (Exception e) { 
>             e.printStackTrace();
>         }                                                                       
>     }  
> }
> Inconsistency is that in Harmony's implementation of this constructor 
> installTitlePane() is not called when null parameter is passed in

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

View raw message