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

InputVerifier causes infinite loop when showMessageDialog() called.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.4.0
    • client-libs



      Name: sv35042 Date: 10/09/2002


      FULL PRODUCT VERSION :
      java version "1.4.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
      Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)


      Microsoft Windows 2000 [Version 5.00.2195]


      A DESCRIPTION OF THE PROBLEM :
      If OptionPane.showMessageDialog() is called from within the
      verify() method of a InputVerifier class which is attached
      to a JTextField component the syetem goes into an infinite
      loop and eventually crashes with a Stack overflow.



      REGRESSION. Last worked in version 1.3

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      You would expect the verify method to be able to display a
      messsage to the user and continue on normally. This can't
      be an unusual thing to do.

      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.*;
      import javax.swing.*;

      public class Main extends JApplet
      {
      int Count = 0;

      public void init()
      {
      JTextField tf = new JTextField("Set focus here", 21);
      tf.setInputVerifier(new Verifier());
      getContentPane().add(tf);
      }

      class Verifier extends InputVerifier
      {
      public boolean verify(JComponent input)
      {
      System.out.println("Verifier: " + ++Count);

      // Un-comment this line to crash
      // JOptionPane.showMessageDialog(null, "Verify");
      return true;
      }
      }

      } // End Main Class

      ---------- END SOURCE ----------
      (Review ID: 144322)
      ======================================================================

            joutwatesunw Joshua Outwater (Inactive)
            svioletsunw Scott Violet (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: