# HG changeset patch # User malenkov # Date 1374492990 -14400 # Node ID 14d6859b9dcc175d78f4f1e8d011320fb1f71fc2 # Parent 12a1993f109b3841dd5edcfa356ed747f0bb9c6b 8019975: closed/javax/swing/JFileChooser/4966171/bug4966171.java throws java.io.NotSerializableException: javax.swing.plaf.basic.BasicFileChooserUI$AcceptAllFileFilter Reviewed-by: alexsch diff -r 12a1993f109b -r 14d6859b9dcc jdk/src/share/classes/javax/swing/JFileChooser.java --- a/jdk/src/share/classes/javax/swing/JFileChooser.java Mon Jul 15 17:33:44 2013 +0400 +++ b/jdk/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