harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anton Luht (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-2660) [classlib][swing][plaf] javax.swing.plaf.basic.BasicTabbedPaneUI.paintFocusIndicator(....) doesn't throw unspecified ArrayIndexOutOfBoundsException
Date Wed, 13 Dec 2006 09:07:25 GMT
    [ http://issues.apache.org/jira/browse/HARMONY-2660?page=comments#action_12458056 ] 
            
Anton Luht commented on HARMONY-2660:
-------------------------------------

Similar problem with public method getTabBounds():

Code to reproduce:

import javax.swing.*;
import javax.swing.plaf.basic.*;

public class Test
{
        public static void main(String args[]) {
                BasicTabbedPaneUI localBasicTabbedPaneUI = new BasicTabbedPaneUI();
                localBasicTabbedPaneUI.installUI(new JTabbedPane());
                localBasicTabbedPaneUI.getTabBounds((JTabbedPane) null, 0);
        }
}


Output inRI:

java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
        at javax.swing.plaf.basic.BasicTabbedPaneUI.getTabBounds(Unknown Source)

        at javax.swing.plaf.basic.BasicTabbedPaneUI.getTabBounds(Unknown Source)

        at Test.main(Test.java:10)

Output in Harmony:

Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundatio
n or its licensors, as applicable.
java version "1.5.0"
pre-alpha : not complete or compatible
svn = r485537, (Dec 11 2006), Windows/ia32/msvc 1310, debug build
http://incubator.apache.org/harmony


> [classlib][swing][plaf] javax.swing.plaf.basic.BasicTabbedPaneUI.paintFocusIndicator(....)
doesn't throw unspecified ArrayIndexOutOfBoundsException
> ---------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2660
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2660
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Anton Luht
>            Priority: Minor
>
> Compatibility issue.
> javax.swing.plaf.basic.BasicTabbedPaneUI.paintFocusIndicator(....)  throws ArrayIndexOutOfBoundsException
in RI but doesn't throw it in Harmony.
> This method is protected and not documented.
> Code to reproduce:
> import java.awt.Graphics;
> import java.awt.Rectangle;
> import java.awt.image.BufferedImage;
> import javax.swing.*;
> import javax.swing.plaf.basic.*;
> class lBasicTabbedPaneUI extends BasicTabbedPaneUI {
>         public lBasicTabbedPaneUI() {
>                 super();
>         }
>         public void paintFocusIndicator(Graphics g, int tabPlacement,
> Rectangle[] rects, int tabIndex, Rectangle iconRect, Rectangle textRect,
> boolean isSelected) {
>                 super.paintFocusIndicator(g, tabPlacement, rects, tabIndex,
> iconRect, textRect, isSelected);
>         }
> }
> public class Test    
> {
>         public static Graphics getGraphics() {
>                 int a = 100;
>                 return new BufferedImage(a, a, BufferedImage.TYPE_4BYTE_ABGR)
>                         .createGraphics();
>         }
>         public static void main(String args[]) {
>                 lBasicTabbedPaneUI localBasicTabbedPaneUI = new
> lBasicTabbedPaneUI();
>                 localBasicTabbedPaneUI.installUI(new JTabbedPane());
>                 localBasicTabbedPaneUI.paintFocusIndicator(
>                                 getGraphics(),
>                                 SwingConstants.VERTICAL,
>                                 new Rectangle[] {},
>                                 SwingConstants.TOP,
>                                 null,
>                                 null,
>                                 false);
>         }
> }
> Output in RI:
> java version "1.5.0_06"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)
> Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1
>         at javax.swing.plaf.basic.BasicTabbedPaneUI.paintFocusIndicator(Unknown
> Source)
>         at lBasicTabbedPaneUI.paintFocusIndicator(Test.java:14)
>         at Test.main(Test.java:32)
> Output in Harmony:
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundatio
> n or its licensors, as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r485537, (Dec 11 2006), Windows/ia32/msvc 1310, debug build
> http://incubator.apache.org/harmony
> <none>

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