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

[jira] Created: (HARMONY-2660) javax.swing.plaf.basic.BasicTabbedPaneUI.paintFocusIndicator(....) doesn't throw unspecified ArrayIndexOutOfBoundsException

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

        

[jira] Commented: (HARMONY-2660) [classlib][swing][plaf] javax.swing.plaf.basic.BasicTabbedPaneUI.paintFocusIndicator(....) doesn't throw unspecified ArrayIndexOutOfBoundsException

Posted by "Anton Luht (JIRA)" <ji...@apache.org>.
    [ 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

        

[jira] Commented: (HARMONY-2660) [classlib][swing][plaf] javax.swing.plaf.basic.BasicTabbedPaneUI.paintFocusIndicator(....) doesn't throw unspecified ArrayIndexOutOfBoundsException

Posted by "Anton Luht (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-2660?page=comments#action_12458050 ] 
            
Anton Luht commented on HARMONY-2660:
-------------------------------------

Similar problem with another protected undocumented method getTabLabelShiftX :

Code to reproduce:

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

class lBasicTabbedPaneUI extends BasicTabbedPaneUI {
        public lBasicTabbedPaneUI() {
                super();
        }
        public int getTabLabelShiftX(int tabPlacement, int tabIndex, boolean
isSelected) {
                return super.getTabLabelShiftX(tabPlacement, tabIndex,
isSelected);
        }
}

public class Test    
{
        public static void main(String args[]) {
                lBasicTabbedPaneUI localBasicTabbedPaneUI = new lBasicTabbedPaneUI();
                int returnValue = localBasicTabbedPaneUI.getTabLabelShiftX(
                        11,
                        4,
                        true);
                System.out.println("returnValue = " + returnValue);
        }
}

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: 4
        at javax.swing.plaf.basic.BasicTabbedPaneUI.getTabLabelShiftX(Unknown So
urce)
        at lBasicTabbedPaneUI.getTabLabelShiftX(Test.java:10)
        at Test.main(Test.java:19)

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
returnValue = -1


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

        

[jira] Updated: (HARMONY-2660) [classlib][swing][plaf] javax.swing.plaf.basic.BasicTabbedPaneUI.paintFocusIndicator(....) doesn't throw unspecified ArrayIndexOutOfBoundsException

Posted by "Anton Luht (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2660?page=all ]

Anton Luht updated HARMONY-2660:
--------------------------------

    Summary: [classlib][swing][plaf] javax.swing.plaf.basic.BasicTabbedPaneUI.paintFocusIndicator(....) doesn't throw unspecified ArrayIndexOutOfBoundsException  (was: javax.swing.plaf.basic.BasicTabbedPaneUI.paintFocusIndicator(....) doesn't throw unspecified ArrayIndexOutOfBoundsException)

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