[Patch][gui] javax.swing.JFormattedTextField.setDocument()

Michael Koch konqueror@gmx.de
Tue Nov 30 18:32:00 GMT 2004


Hi list,


I just commited the attached patch to fix an endless loop in
javax.swing.JFormattedTextField.setDocument().


Michael


2004-11-30  Michael Koch  <konqueror@gmx.de>

	* javax/swing/JFormattedTextField.java
	(setDocument): Call setDocument of super class. Don't fire property
	change event.

-------------- next part --------------
Index: javax/swing/JFormattedTextField.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/JFormattedTextField.java,v
retrieving revision 1.3.2.6
diff -u -r1.3.2.6 JFormattedTextField.java
--- javax/swing/JFormattedTextField.java	22 Oct 2004 12:41:12 -0000	1.3.2.6
+++ javax/swing/JFormattedTextField.java	30 Nov 2004 08:14:56 -0000
@@ -217,13 +217,12 @@
 
   public void setDocument(Document newdoc)
   {
-    Document document = getDocument();
+    Document olddoc = getDocument();
 
-    if (document == newdoc)
+    if (olddoc == newdoc)
       return;
     
-    setDocument(newdoc);
-    firePropertyChange("document", document, newdoc);
+    super.setDocument(newdoc);
   }
 
   public void setLostFocusBehavior (int behavior)


More information about the Java-patches mailing list