changeset 7704:607ad960fe24

8019975: closed/javax/swing/JFileChooser/4966171/bug4966171.java throws java.io.NotSerializableException: javax.swing.plaf.basic.BasicFileChooserUI$AcceptAllFileFilter Reviewed-by: alexsch
author malenkov
date Mon, 22 Jul 2013 15:36:30 +0400
parents 0967103c1b65
children 3cbe376233a9
files src/share/classes/javax/swing/JFileChooser.java
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/javax/swing/JFileChooser.java	Mon Jul 15 17:33:44 2013 +0400
+++ b/src/share/classes/javax/swing/JFileChooser.java	Mon Jul 22 15:36:30 2013 +0400
@@ -1149,9 +1149,10 @@
         int index = filters.indexOf(f);
         if (index >= 0) {
             if(getFileFilter() == f) {
-                if (isAcceptAllFileFilterUsed()) {
+                FileFilter aaff = getAcceptAllFileFilter();
+                if (isAcceptAllFileFilterUsed() && (aaff != f)) {
                     // choose default filter if it is used
-                    setFileFilter(getAcceptAllFileFilter());
+                    setFileFilter(aaff);
                 }
                 else if (index > 0) {
                     // choose the first filter, because it is not removed