This patch fixes the following mauve regressions that Mark pointed out:

+FAIL: gnu.testlet.javax.swing.JFileChooser.getApproveButtonText (number
1)
+FAIL: gnu.testlet.javax.swing.JFileChooser.getDialogTitle: uncaught
exception:
java.lang.StackOverflowError
+FAIL: gnu.testlet.javax.swing.JFileChooser.getFileView (number 1)
+FAIL: gnu.testlet.javax.swing.JFileChooser.getFileView (number 3)
+FAIL: gnu.testlet.javax.swing.JFileChooser.setApproveButtonText (number
1)
+FAIL: gnu.testlet.javax.swing.JFileChooser.setApproveButtonText (number
6)
+FAIL: gnu.testlet.javax.swing.JFileChooser.setDialogTitle: uncaught
exception:
java.lang.StackOverflowError
+FAIL: gnu.testlet.javax.swing.JFileChooser.setFileView (number 1)
+FAIL: gnu.testlet.javax.swing.JFileChooser.setFileView (number 6)

2005-11-01  Anthony Balkissoon  <[EMAIL PROTECTED]>

        * javax/swing/JFileChooser.java:
        (getDialogTitle): Allow return of null.
        (getApproveButtonText): Likewise.
        (getFileView): Likewise.
        (getName): First try using the JFileChooser's FileView, if null, then
        pass call to UI.
        (getDescription): Likewise.
        (getTypeDescription): Likewise.
        (getIcon): Likewise.

--Tony
? JFileChooser.txt
Index: javax/swing/JFileChooser.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JFileChooser.java,v
retrieving revision 1.21
diff -u -r1.21 JFileChooser.java
--- javax/swing/JFileChooser.java	19 Oct 2005 15:45:03 -0000	1.21
+++ javax/swing/JFileChooser.java	1 Nov 2005 17:57:52 -0000
@@ -828,10 +828,7 @@
    */
   public String getDialogTitle()
   {
-    if (dialogTitle == null)
-      return getUI().getDialogTitle(this);
-    else
-      return dialogTitle;
+    return dialogTitle;
   }
 
   /**
@@ -942,10 +939,7 @@
    */
   public String getApproveButtonText()
   {
-    if (approveButtonText == null)
-      return getUI().getApproveButtonText(this);
-    else
-      return approveButtonText;
+    return approveButtonText;
   }
 
   /**
@@ -1264,10 +1258,7 @@
    */
   public FileView getFileView()
   {
-    if (fv == null)
-      return getUI().getFileView(this);
-    else
-      return fv;
+    return fv;
   }
 
   /**
@@ -1280,7 +1271,12 @@
    */
   public String getName(File f)
   {
-    return getFileView().getName(f);
+    String name = null;
+    if (fv != null)
+      name = fv.getName(f);
+    if (name == null)
+      name = getUI().getFileView(this).getName(f);
+    return name;
   }
 
   /**
@@ -1293,7 +1289,12 @@
    */
   public String getDescription(File f)
   {
-    return getFileView().getDescription(f);
+    String result = null;
+    if (fv != null)
+      result = fv.getDescription(f);
+    if (result == null)
+      result = getUI().getFileView(this).getDescription(f);
+    return result;
   }
 
   /**
@@ -1306,7 +1307,12 @@
    */
   public String getTypeDescription(File f)
   {
-    return getFileView().getTypeDescription(f);
+    String result = null;
+    if (fv != null)
+      result = getFileView().getTypeDescription(f);
+    if (result == null)
+      result = getUI().getFileView(this).getTypeDescription(f);
+    return result;
   }
 
   /**
@@ -1318,7 +1324,12 @@
    */
   public Icon getIcon(File f)
   {
-    return getFileView().getIcon(f);
+    Icon result = null;
+    if (fv != null)
+      result = fv.getIcon(f);
+    if (result == null)
+      result = getUI().getFileView(this).getIcon(f);
+    return result;
   }
 
   /**
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to