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] Created: (HARMONY-2660) javax.swing.plaf.basic.BasicTabbedPaneUI.paintFocusIndicator(....) doesn't throw unspecified ArrayIndexOutOfBoundsException
Date Wed, 13 Dec 2006 08:36:21 GMT
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