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 Petrenko (JIRA)" <ji...@apache.org> on 2007/03/20 11:34:32 UTC

[jira] Closed: (HARMONY-2698) [classlib][swing] javax.swing.plaf.basic.BasicProgressBarUI.getPreferredInnerHorizontal() returns null while RI throws NPE

     [ https://issues.apache.org/jira/browse/HARMONY-2698?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Petrenko closed HARMONY-2698.
------------------------------------

    Estimated Complexity: Novice

The patch throws NPE in the case of progressbar field in null.
This is the same behaviour with RI. Both Harmony and RI stops throwing the NPE after installUI call.

> [classlib][swing] javax.swing.plaf.basic.BasicProgressBarUI.getPreferredInnerHorizontal() returns null while RI throws NPE
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2698
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2698
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Alexander Simbirtsev
>         Assigned To: Alexey Petrenko
>            Priority: Minor
>
> Harmony for getPreferredInnerHorizontal()/getPreferredInnerVertical() methods
> returns null while RI throws NPE. 
> Compatibility issue.
> Use the following code to reproduce:
> import java.awt.Dimension;
> import javax.swing.plaf.basic.BasicProgressBarUI;
> import junit.framework.TestCase;
> public class Test extends TestCase {
>     public void testcase1() {                                    
>         try {                   
>             testBasicProgressBarUI pb = new testBasicProgressBarUI();
>             pb.getPreferredInnerHorizontal(); 
>             fail("No NPE thrown"); 
>         } catch (NullPointerException e) { 
>             // expected;
>         }
>     }
>     
>     public void testcase2() {                                    
>         try {                   
>             testBasicProgressBarUI pb = new testBasicProgressBarUI();
>             pb.getPreferredInnerVertical(); 
>             fail("No NPE thrown"); 
>         } catch (NullPointerException e) { 
>             // expected;
>         } 
>     }                                                                        
> }
> class testBasicProgressBarUI extends BasicProgressBarUI {
>      public Dimension getPreferredInnerVertical()  {
>          return super.getPreferredInnerVertical();
>      }
>      
>      public Dimension getPreferredInnerHorizontal()  {
>          return super.getPreferredInnerHorizontal();
>      }     
> }

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