From: Ben Soares Date: Tue, 11 Jan 2022 16:04:49 +0000 (+0000) Subject: close filehandles straight after parse, without setting an error X-Git-Tag: Release_2_11_2_0~17^2~2^2~2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=4e00ffd10b483cb3d1ff96711cb2500a0ed01508;p=jalview.git close filehandles straight after parse, without setting an error --- diff --git a/src/jalview/io/AlignFile.java b/src/jalview/io/AlignFile.java index cea2870..9e426ab 100755 --- a/src/jalview/io/AlignFile.java +++ b/src/jalview/io/AlignFile.java @@ -20,13 +20,6 @@ */ package jalview.io; -import jalview.datamodel.AlignmentAnnotation; -import jalview.datamodel.AlignmentI; -import jalview.datamodel.Sequence; -import jalview.datamodel.SequenceGroup; -import jalview.datamodel.SequenceI; -import jalview.util.MessageManager; - import java.io.IOException; import java.util.ArrayList; import java.util.Enumeration; @@ -34,6 +27,13 @@ import java.util.Hashtable; import java.util.List; import java.util.Vector; +import jalview.datamodel.AlignmentAnnotation; +import jalview.datamodel.AlignmentI; +import jalview.datamodel.Sequence; +import jalview.datamodel.SequenceGroup; +import jalview.datamodel.SequenceI; +import jalview.util.MessageManager; + /** * DOCUMENT ME! * @@ -193,6 +193,7 @@ public abstract class AlignFile extends FileParse } parseCalled = true; parse(); + dataIn.close(); } /** diff --git a/src/jalview/project/Jalview2XML.java b/src/jalview/project/Jalview2XML.java index 9b6741b..acfeb2a 100644 --- a/src/jalview/project/Jalview2XML.java +++ b/src/jalview/project/Jalview2XML.java @@ -20,8 +20,6 @@ */ package jalview.project; -import java.util.Locale; - import static jalview.math.RotatableMatrix.Axis.X; import static jalview.math.RotatableMatrix.Axis.Y; import static jalview.math.RotatableMatrix.Axis.Z; @@ -56,6 +54,7 @@ import java.util.IdentityHashMap; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Map.Entry; import java.util.Set; @@ -2077,8 +2076,8 @@ public class Jalview2XML { final PDBEntry pdbentry = bindingModel.getPdbEntry(peid); final String pdbId = pdbentry.getId(); - if (!pdbId.equals(entry.getId()) - && !(entry.getId().length() > 4 && entry.getId().toLowerCase(Locale.ROOT) + if (!pdbId.equals(entry.getId()) && !(entry.getId().length() > 4 + && entry.getId().toLowerCase(Locale.ROOT) .startsWith(pdbId.toLowerCase(Locale.ROOT)))) { /* @@ -2922,6 +2921,7 @@ public class Jalview2XML entryCount++; } } while (jarentry != null); + jin.close(); resolveFrefedSequences(); } catch (IOException ex) {