Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6780457

Focus problem causing infinite loop

    XMLWordPrintable

    Details

    • Subcomponent:
    • Introduced In Version:
    • Resolved In Build:
      b104
    • CPU:
      x86
    • OS:
      windows_xp

      Backports

        Description

        FULL PRODUCT VERSION :
        java version "1.6.0_10"
        Java(TM) SE Runtime Environment (build 1.6.0_10-b33) Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode, sharing)

        ADDITIONAL OS VERSION INFORMATION :
        Windows XP

        EXTRA RELEVANT SYSTEM CONFIGURATION :
        IE 6 and 7

        A DESCRIPTION OF THE PROBLEM :
        We have some error validation code that results in the display of an error dialog. Previously, the error dialog is displayed when you move focus to another component.

        For example, a column has an error. When user clicks away from the column, an error dialog is displayed. When the dialog is dismissed, we shift focus back to the column so that the user can fix the problem. If user clicks away from the column without fixing the error, then the dialog is displayed again.

        In update 10, as soon as you dismiss the dialog, another dialog opens immediately. It looks like when the dialog is dismissed, the focusLost() event is fired causing another dialog to appear. This causes an infinite cycle of dialogs being displayed. Once you get into this situation, the only way to get out it is to kill the browser.

        The code that displays the error dialog is in a FocusListener. The dialog is displayed when focus is lost.

        This problem only occurs in update 10 when I have the "Enable the next-generation Java Plug-in" option checked in the control panel. Unchecking the "next-generation Java Plug-in" will cause the problem to go away.


        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
            public class FocusListenerImpl implements FocusListener {
                public void focusGained(FocusEvent arg0) {
                }

                public void focusLost(FocusEvent e) {
                    String enteredCode = codeField.getText();
                    ModelValidator modelValidator = getCanvas().getBuilder().getModelValidator();
                    ModelValidator.ValidationStatus validationStatus = modelValidator.checkColumnCode(getColumn(), enteredCode);

                    ModelValidator.showErrorDialog(getCanvas().getBuilder().getTracker(),
                                                   validationStatus,
                                                   null, getLocale());
                    SwingUtilities.invokeLater(new Runnable(){
                        public void run(){
                          codeField.requestFocusInWindow();
                          codeField.selectAll();
                        }
                      });
                }
            }
        ---------- END SOURCE ----------

        CUSTOMER SUBMITTED WORKAROUND :
        Uncheck the "Enable the next-generation Java Plug-in" option in the control panel.

        Release Regression From : 6u7
        The above release value was the last known release where this
        bug was not reproducible. Since then there has been a regression.
        see comments for more info.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                herrick Andy Herrick (Inactive)
                Reporter:
                ndcosta Nelson Dcosta (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: