JAL-3210 Barebones gradle/buildship/eclipse. See README
[jalview.git] / src / jalview / io / FileFormats.java
index fb490d3..aadcdb9 100644 (file)
@@ -20,8 +20,6 @@
  */
 package jalview.io;
 
-import jalview.bin.Instance;
-
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.LinkedHashMap;
@@ -40,6 +38,8 @@ import java.util.Set;
  */
 public class FileFormats
 {
+  private static FileFormats instance = new FileFormats();
+
   /*
    * A lookup map of file formats by upper-cased name
    */
@@ -52,9 +52,7 @@ public class FileFormats
 
   public static FileFormats getInstance()
   {
-    Instance i = Instance.getInstance();
-    return (i.fileFormats == null ? i.fileFormats = new FileFormats()
-            : i.fileFormats);
+    return instance;
   }
 
   /**
@@ -72,8 +70,8 @@ public class FileFormats
    */
   public synchronized void reset()
   {
-    formats = new LinkedHashMap<>();
-    identifiable = new HashSet<>();
+    formats = new LinkedHashMap<String, FileFormatI>();
+    identifiable = new HashSet<FileFormatI>();
     for (FileFormat format : FileFormat.values())
     {
       registerFileFormat(format, format.isIdentifiable());
@@ -137,7 +135,7 @@ public class FileFormats
    */
   public List<String> getWritableFormats(boolean textOnly)
   {
-    List<String> l = new ArrayList<>();
+    List<String> l = new ArrayList<String>();
     for (FileFormatI ff : formats.values())
     {
       if (ff.isWritable() && (!textOnly || ff.isTextFormat()))
@@ -156,7 +154,7 @@ public class FileFormats
    */
   public List<String> getReadableFormats()
   {
-    List<String> l = new ArrayList<>();
+    List<String> l = new ArrayList<String>();
     for (FileFormatI ff : formats.values())
     {
       if (ff.isReadable())