JDK-4760432 : InputVerifier causes infinite loop when showMessageDialog() called.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.4.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2002-10-09
  • Updated: 2002-10-18
  • Resolved: 2002-10-18
Related Reports
Duplicate :  
Description

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) 
======================================================================

Comments
EVALUATION This is a duplicate of 4518307, refer to it for details. ###@###.### 2002-10-18
18-10-2002