United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6421984 realSync throws InfiniteLoop some times.
6421984 : realSync throws InfiniteLoop some times.

Details
Type:
Bug
Submit Date:
2006-05-04
Status:
Open
Updated Date:
2013-01-30
Project Name:
JDK
Resolved Date:
Component:
client-libs
OS:
windows_vista,generic,solaris_10,windows_xp
Sub-Component:
java.awt
CPU:
x86,sparc,generic
Priority:
P4
Resolution:
Unresolved
Affected Versions:
6,6u10,7
Targeted Versions:
8-pool

Related Reports
Duplicate:
Duplicate:
Duplicate:
Relates:

Sub Tasks

Description
Here's a test case:

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
/*
 * @test %I% %E%
 * @bug 4942216
 * @summary Tests 4942216
 * @library ../../../../javax/swing/regtesthelpers
 * @build SwingTestHelper Test JRobot Assert
 * @run main bug4942216
 * @author Scott Violet
 */
public class bug4942216 extends SwingTestHelper {
    private JTextField textField;

    public static void main(String[] args) throws Throwable {
        new bug4942216().run(args);
    }

    protected Component createContentPane() {
        textField = new JTextField();
        textField.setAutoscrolls(true);
        return textField;
    }

    public void onEDT10() {
        robot.moveMouseTo(textField);
        robot.mousePress(InputEvent.BUTTON1_MASK);
        waitForEvent(textField, MouseEvent.MOUSE_PRESSED);
    }

    public void onEDT20() {
        Point loc = textField.getLocationOnScreen();
        robot.mouseMove(loc.x + textField.getWidth() + 10,
                        loc.y + textField.getHeight() + 10);
        waitForEvent(textField, MouseEvent.MOUSE_EXITED);
    }

    public void onEDT30() {
        Point loc = textField.getLocationOnScreen();
        textField.setVisible(false);
        robot.mouseMove(loc.x + textField.getWidth() + 20,
                        loc.y + textField.getHeight() + 20);
        waitForEvent(textField, MouseEvent.MOUSE_DRAGGED);
    }

    public void onEDT40() {
        robot.mouseRelease(InputEvent.BUTTON1_MASK);
        waitForEvent(textField, MouseEvent.MOUSE_RELEASED);
    }
}

This relies on SwingTestHelper and other classes which can be found in test/javax/swing/regtesthelpers. On my solaris box running this test produces:

Exception in thread "Thread-1" sun.awt.SunToolkit$InfiniteLoop
> >>>>    at sun.awt.SunToolkit.realSync(SunToolkit.java:1424)
> >>>>    at SwingTestHelper.controlLoop(SwingTestHelper.java:513)
> >>>>    at SwingTestHelper.access$600(SwingTestHelper.java:173)
> >>>>    at SwingTestHelper$4.run(SwingTestHelper.java:470)
> >>>>    at java.lang.Thread.run(Thread.java:619)

                                    

Comments
EVALUATION

it is important to find the problem in this method since we use it for testing
                                     
2006-06-23



Hardware and Software, Engineered to Work Together