harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexei Zakharov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-4887) [classlib][awt] some AWT classes may cause a dead loop
Date Fri, 26 Oct 2007 16:57:53 GMT

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

Alexei Zakharov commented on HARMONY-4887:
------------------------------------------

Sure Igor, I've increased this value to 15 at r588707. Please verify it helps.

> [classlib][awt] some AWT classes may cause a dead loop
> ------------------------------------------------------
>
>                 Key: HARMONY-4887
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4887
>             Project: Harmony
>          Issue Type: Bug
>         Environment: any
>            Reporter: Alexei Zakharov
>            Assignee: Alexei Zakharov
>         Attachments: H4887_Button.patch, H4887_ButtonRTest.patch
>
>
> The following AWT classes & methods may cause repaint dead loop:
> java.awt
>   Button
>     setEnabled(boolean)
>     setLabel(String)
>   Checkbox
>     setChecked(boolean)
>     setEnabled(boolean)
>   Choice
>     select(int)
>   Component
>     setBackground(Color)
>     setFont(Font)
>     setForeground(Color)
>   Label
>     setEnabledImpl(boolean)
>   TextComponent
>     setEditable(boolean)
>     setEnabled(boolean)
>   TextField
>     scrollRectToVisible(Rectangle)
>     setEchoChar(char) 
> Below is a simple reproducer for Button.setEnabled().
> ---
> import java.awt.*;
> import junit.framework.TestCase;
> public class ButtonRTest extends TestCase {
>     final static int DEAD_LOOP_TIMEOUT = 300;
>     final static int VALID_NUMBER_OF_PAINT_CALLS = 3;
>     public void testDeadLoopXXX() {
>         final int count[] = new int[1];
>         Button b = new Button() {
>             public void paint(Graphics g) {
>                 count[0]++;
>                 setEnabled(true);
>             }
>         };
>         new DummyFrame(b);
>         try {
>             Thread.sleep(DEAD_LOOP_TIMEOUT);
>         } catch (Exception e) {}
>         
>         assertTrue("paint() called " + count[0] + " times, dead loop occurred",
>                 count[0] <= VALID_NUMBER_OF_PAINT_CALLS);
>     }
>     static class DummyFrame extends Frame {
>         public DummyFrame(Component b){
>             add(b);
>             setSize(300,200);
>             setVisible(true);
>         } 
>     }
> }
> ---

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


Mime
View raw message