jalview.release=releases/Release_2_11_1_Branch
-jalview.version=2.11.1.6
+jalview.version=2.11.1.7
<tr>
<td width="60" align="center" nowrap><strong><a
id="Jalview.2.11.1">2.11.1</a><a id="Jalview.2.11.1.7">.7</a><br />
- <em></em></strong>
+ <em>18/01/2022</em></strong>
</td>
<td>
</td>
<td align="left" valign="top"><em>Security</em>
<ul>
- <li>
- <!-- JAL-3937 -->Enable AIA download of HTTPS intermediate certificates.
- </li>
- </ul>
- </td>
+ <li>
+ <!-- JAL-3937 -->Enable AIA download of HTTPS intermediate
+ certificates.
+ </li>
+ <li>
+ <!-- JAL-3703, JAL-3935 -->Files open in Jalview cannot be
+ updated by Jalview or other applications (Windows, other non
+ Unix/BSD OSs)
+ </li>
+ </ul></td>
</tr>
<tr>
<td width="60" align="center" nowrap><strong><a
</head>
<body>
<p>
- <strong>Jalview 2.11.1.6</strong>
+ <strong>Jalview 2.11.1.7</strong>
</p>
- <p>Jalview 2.11.1.6 is a critical patch release that updates one
- of the open source components, log4j, that Jalview relies on. The
- update addresses the widely reported log4shell security
- vunerability.</p>
+ <p>Jalview 2.11.1.7 is a patch release that addresses connectivity
+ issues for third party services over HTTPS, and problems experienced
+ by Windows users when saving files from Jalview.</p>
<p>
For the full release notes, see <a
- href="releases.html#Jalview.2.11.1.6">the Jalview 2.11.1.6
+ href="releases.html#Jalview.2.11.1.7">the Jalview 2.11.1.7
release notes</a>.
</p>
</body>
*/
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;
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!
*
private boolean parseImmediately = true;
+ private boolean dataClosed = false;
+
/**
* @return if doParse() was called at construction time
*/
public AlignFile(boolean parseImmediately, FileParse source)
throws IOException
{
+ this(parseImmediately, source, true);
+ }
+
+ public AlignFile(boolean parseImmediately, FileParse source,
+ boolean closeData) throws IOException
+ {
super(source);
initData();
if (parseImmediately)
{
- doParse();
+ doParse(closeData);
}
}
*/
public void doParse() throws IOException
{
+ doParse(true);
+ }
+
+ public void doParse(boolean closeData) throws IOException
+ {
if (parseCalled)
{
throw new IOException(
}
parseCalled = true;
parse();
+ if (closeData && !dataClosed)
+ {
+ dataIn.close();
+ dataClosed = true;
+ }
}
/**
*/
package jalview.io;
+import java.io.IOException;
+
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.Annotation;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceI;
-import java.io.IOException;
-
/**
* DOCUMENT ME!
*
public FastaFile(FileParse source) throws IOException
{
- super(source);
+ this(source, true);
+ }
+
+ public FastaFile(FileParse source, boolean closeData) throws IOException
+ {
+ super(true, source, closeData);
}
public FastaFile(SequenceI[] seqs)
} catch (IOException q)
{
}
- FastaFile parser = new FastaFile(this);
+ // Opening a FastaFile object with the remainder of this object's dataIn.
+ // Tell the constructor to NOT close the dataIn when finished.
+ FastaFile parser = new FastaFile(this, false);
List<SequenceI> includedseqs = parser.getSeqs();
SequenceIdMatcher smatcher = new SequenceIdMatcher(newseqs);
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;
{
final PDBEntry pdbentry = bindingModel.getPdbEntry(peid);
final String pdbId = pdbentry.getId();
- if (!pdbId.equals(entry.getId())
- && !(entry.getId().length() > 4 && entry.getId().toLowerCase()
- .startsWith(pdbId.toLowerCase())))
+ if (!pdbId.equals(entry.getId()) && !(entry.getId().length() > 4
+ && entry.getId().toLowerCase(Locale.ROOT)
+ .startsWith(pdbId.toLowerCase(Locale.ROOT))))
{
/*
* not interested in a binding to a different PDB entry here
entryCount++;
}
} while (jarentry != null);
+ jin.close();
resolveFrefedSequences();
} catch (IOException ex)
{
@AfterClass(alwaysRun = true)
private void cleanupTmpFiles()
{
- File newfile = new File(newFile);
+ cleanupTmpFiles(newFile, suffix, digits);
+ }
+
+ protected static void cleanupTmpFiles(String file, String mysuffix,
+ int mydigits)
+ {
+ File newfile = new File(file);
if (newfile.exists())
{
newfile.delete();
--- /dev/null
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
+package jalview.io;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.StandardCopyOption;
+
+import org.testng.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import jalview.datamodel.AlignmentI;
+import jalview.gui.AlignFrame;
+import jalview.gui.JvOptionPane;
+
+/**
+ * WindowsFileSaveTest simply opens an alignment file and then tries to save it.
+ * This failed in Windows from 2.11.0 to 2.11.1.6 due to a combination of the
+ * opening file handle being left open ad infinitum, causing the BackupFiles
+ * operation of moving the saved (temp) file onto the original filename to fail,
+ * but only in Windows. See: https://issues.jalview.org/browse/JAL-3628
+ * https://issues.jalview.org/browse/JAL-3703
+ * https://issues.jalview.org/browse/JAL-3935 These issues are really all fixed
+ * by JAL-3703 This test is to ensure it doesn't start again, but note that this
+ * test will only fail in Windows.
+ */
+public class WindowsFileLoadAndSaveTest
+{
+
+ private final static String fileName = "examples" + File.separator
+ + "uniref50.fa";
+
+ private final static String testFileName = fileName + "-TEST";
+
+ @BeforeClass(alwaysRun = true)
+ public void setUpJvOptionPane()
+ {
+ JvOptionPane.setInteractiveMode(false);
+ JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+ }
+
+ /**
+ * Test saving and re-reading in a specified format
+ *
+ * @throws IOException
+ */
+ @Test(groups = { "Functional" })
+ public void loadAndSaveAlignment() throws IOException
+ {
+ File file = new File(fileName);
+ File testFile = new File(testFileName);
+ Files.copy(file.toPath(), testFile.toPath(),
+ StandardCopyOption.REPLACE_EXISTING);
+ FormatAdapter fa = new FormatAdapter();
+ AlignmentI a = fa.readFile(testFile, DataSourceType.FILE,
+ FileFormat.Fasta);
+
+ AlignFrame af = new AlignFrame(a, 500, 500);
+ af.saveAlignment(testFileName, FileFormat.Fasta);
+
+ Assert.assertTrue(af.isSaveAlignmentSuccessful());
+ }
+
+ @AfterClass(alwaysRun = true)
+ private void cleanupTmpFiles()
+ {
+ BackupFilesPresetEntry bfpe = BackupFilesPresetEntry
+ .getSavedBackupEntry();
+ BackupFilesTest.cleanupTmpFiles(testFileName, bfpe.suffix, bfpe.digits);
+ }
+
+}