source: josm/trunk/src/org/openstreetmap/josm/gui/util/FileFilterAllFiles.java@ 10943

Last change on this file since 10943 was 8126, checked in by Don-vip, 9 years ago

fix Sonar issue squid:S2444 - Lazy initialization of "static" fields should be "synchronized"

  • Property svn:eol-style set to native
File size: 826 bytes
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.util;
3
4import static org.openstreetmap.josm.tools.I18n.tr;
5
6import java.io.File;
7
8import javax.swing.filechooser.FileFilter;
9
10/**
11 * A FileFilter that accepts all files.
12 * @since 5572
13 */
14public class FileFilterAllFiles extends FileFilter {
15
16 private static FileFilterAllFiles INSTANCE;
17
18 /**
19 * Replies the unique instance.
20 * @return the unique instance
21 */
22 public static synchronized FileFilterAllFiles getInstance() {
23 if (INSTANCE == null) {
24 INSTANCE = new FileFilterAllFiles();
25 }
26 return INSTANCE;
27 }
28
29 @Override
30 public boolean accept(File f) {
31 return true;
32 }
33
34 @Override
35 public String getDescription() {
36 return tr("All files (*.*)");
37 }
38}
Note: See TracBrowser for help on using the repository browser.