From 1e5dc0e8a71d9eb0be4748f994072b11f25b04e0 Mon Sep 17 00:00:00 2001 From: jprocter Date: Tue, 4 Dec 2012 16:11:26 +0000 Subject: [PATCH] JAL-1140 - IO classes should only raise generic IOExceptions --- src/MCview/PDBViewer.java | 3 +-- src/MCview/PDBfile.java | 15 +++-------- src/jalview/appletgui/AlignFrame.java | 21 +-------------- src/jalview/datamodel/Annotation.java | 3 --- src/jalview/ext/jmol/PDBFileWithJmol.java | 19 ++------------ src/jalview/gui/AssociatePdbFileWithSeq.java | 32 +++++++---------------- src/jalview/gui/PopupMenu.java | 27 ++----------------- src/jalview/io/AlignFile.java | 36 +++----------------------- src/jalview/io/BLCFile.java | 20 ++------------ src/jalview/io/ClustalFile.java | 13 ++-------- src/jalview/io/FastaFile.java | 19 ++------------ src/jalview/io/FeaturesFile.java | 26 ++----------------- src/jalview/io/JPredFile.java | 29 +++------------------ src/jalview/io/MSFfile.java | 20 ++------------ src/jalview/io/PIRFile.java | 13 ++-------- src/jalview/io/PfamFile.java | 12 ++------- src/jalview/io/PileUpfile.java | 21 +++------------ src/jalview/io/SimpleBlastFile.java | 13 ++-------- src/jalview/io/TCoffeeScoreFile.java | 18 ++++--------- test/jalview/io/TCoffeeScoreFileTest.java | 12 ++++----- 20 files changed, 55 insertions(+), 317 deletions(-) diff --git a/src/MCview/PDBViewer.java b/src/MCview/PDBViewer.java index b3aae51..ccf68bb 100755 --- a/src/MCview/PDBViewer.java +++ b/src/MCview/PDBViewer.java @@ -57,8 +57,7 @@ public class PDBViewer extends JInternalFrame implements Runnable String tmpPDBFile; public PDBViewer(PDBEntry pdbentry, SequenceI[] seq, String[] chains, - AlignmentPanel ap, String protocol) throws ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses - + AlignmentPanel ap, String protocol) { this.pdbentry = pdbentry; this.seq = seq; diff --git a/src/MCview/PDBfile.java b/src/MCview/PDBfile.java index 2dc9e1a..95dec13 100755 --- a/src/MCview/PDBfile.java +++ b/src/MCview/PDBfile.java @@ -22,15 +22,6 @@ import java.util.*; import java.awt.*; -import javax.xml.parsers.ParserConfigurationException; - -import org.xml.sax.SAXException; - -import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax; -import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed; -import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied; -import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses; - import jalview.analysis.AlignSeq; import jalview.datamodel.*; import jalview.io.FileParse; @@ -47,12 +38,12 @@ public class PDBfile extends jalview.io.AlignFile */ boolean VisibleChainAnnotation = false; - public PDBfile(String inFile, String inType) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses + public PDBfile(String inFile, String inType) throws IOException { super(inFile, inType); } - public PDBfile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses + public PDBfile(FileParse source) throws IOException { super(source); } @@ -62,7 +53,7 @@ public class PDBfile extends jalview.io.AlignFile return null; } - public void parse() throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException + public void parse() throws IOException { // TODO set the filename sensibly - try using data source name. id = safeName(getDataName()); diff --git a/src/jalview/appletgui/AlignFrame.java b/src/jalview/appletgui/AlignFrame.java index 6826266..4d574d6 100644 --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@ -84,7 +84,6 @@ import java.awt.event.KeyListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.IOException; -import java.io.InputStreamReader; import java.net.URL; import java.net.URLEncoder; import java.util.Enumeration; @@ -93,14 +92,6 @@ import java.util.List; import java.util.StringTokenizer; import java.util.Vector; -import javax.xml.parsers.ParserConfigurationException; - -import org.xml.sax.SAXException; - -import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax; -import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed; -import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied; -import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses; public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemListener, KeyListener @@ -3724,18 +3715,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, * File/URL/T-COFFEE score file contents * @throws IOException * @return true if alignment was annotated with data from source - * @throws SAXException - * @throws ParserConfigurationException - * @throws ExceptionFileFormatOrSyntax - * @throws ExceptionLoadingFailed - * @throws ExceptionPermissionDenied - * @throws InterruptedException - * @throws ExceptionUnmatchedClosingParentheses */ - public boolean loadScoreFile(String source) throws IOException, - ExceptionFileFormatOrSyntax, ParserConfigurationException, - SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, - InterruptedException, ExceptionUnmatchedClosingParentheses + public boolean loadScoreFile(String source) throws IOException { TCoffeeScoreFile file = new TCoffeeScoreFile(source, diff --git a/src/jalview/datamodel/Annotation.java b/src/jalview/datamodel/Annotation.java index fd1021f..042e0f7 100755 --- a/src/jalview/datamodel/Annotation.java +++ b/src/jalview/datamodel/Annotation.java @@ -18,9 +18,6 @@ package jalview.datamodel; import java.awt.*; -import java.util.ArrayList; - -import fr.orsay.lri.varna.models.rna.RNA; /** * DOCUMENT ME! diff --git a/src/jalview/ext/jmol/PDBFileWithJmol.java b/src/jalview/ext/jmol/PDBFileWithJmol.java index 962fe3c..1059021 100644 --- a/src/jalview/ext/jmol/PDBFileWithJmol.java +++ b/src/jalview/ext/jmol/PDBFileWithJmol.java @@ -20,13 +20,9 @@ package jalview.ext.jmol; import java.io.IOException; import java.util.Map; -import javax.xml.parsers.ParserConfigurationException; - import org.jmol.api.JmolStatusListener; import org.jmol.api.JmolViewer; import org.jmol.constant.EnumCallback; -import org.jmol.constant.EnumStructure; -import org.jmol.modelset.Chain; import org.jmol.modelset.Group; import org.jmol.modelset.Model; import org.jmol.modelset.ModelSet; @@ -34,12 +30,7 @@ import org.jmol.modelset.Polymer; import org.jmol.modelsetbio.BioPolymer; import org.jmol.viewer.Viewer; import org.openscience.jmol.app.JmolApp; -import org.xml.sax.SAXException; -import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax; -import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed; -import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied; -import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.Annotation; import jalview.datamodel.PDBEntry; @@ -62,10 +53,7 @@ public class PDBFileWithJmol extends AlignFile implements Viewer viewer = null; public PDBFileWithJmol(String inFile, String type) - throws ExceptionUnmatchedClosingParentheses, IOException, - ExceptionFileFormatOrSyntax, ParserConfigurationException, - SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, - InterruptedException + throws IOException { super(inFile, type); } @@ -128,10 +116,7 @@ public class PDBFileWithJmol extends AlignFile implements * @see jalview.io.AlignFile#parse() */ @Override - public void parse() throws IOException, ExceptionFileFormatOrSyntax, - ParserConfigurationException, SAXException, - ExceptionPermissionDenied, ExceptionLoadingFailed, - InterruptedException, ExceptionUnmatchedClosingParentheses + public void parse() throws IOException { Viewer jmd = getJmolData(); jmd.openReader(getDataName(), getDataName(), getReader()); diff --git a/src/jalview/gui/AssociatePdbFileWithSeq.java b/src/jalview/gui/AssociatePdbFileWithSeq.java index 22c891d..979a2e2 100644 --- a/src/jalview/gui/AssociatePdbFileWithSeq.java +++ b/src/jalview/gui/AssociatePdbFileWithSeq.java @@ -39,29 +39,19 @@ import jalview.datamodel.SequenceI; public class AssociatePdbFileWithSeq { -/** - * assocate the given PDB file with - * @param choice - * @param sequence - * @throws SAXException - * @throws ParserConfigurationException - * @throws ExceptionFileFormatOrSyntax - * @throws ExceptionLoadingFailed - * @throws ExceptionPermissionDenied - * @throws InterruptedException - * @throws ExceptionUnmatchedClosingParentheses - */ - public PDBEntry associatePdbWithSeq(String choice, String protocol, SequenceI sequence, boolean prompt) throws ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses + /** + * assocate the given PDB file with + * + * @param choice + * @param sequence + */ + public PDBEntry associatePdbWithSeq(String choice, String protocol, + SequenceI sequence, boolean prompt) { PDBEntry entry = new PDBEntry(); try { - - System.out.println("This is a annotation PDB"); - - - MCview.PDBfile pdbfile = new MCview.PDBfile(choice, - protocol); + MCview.PDBfile pdbfile = new MCview.PDBfile(choice, protocol); if (pdbfile.id == null) { @@ -87,7 +77,7 @@ public class AssociatePdbFileWithSeq { entry.setId(pdbfile.id); } - + } catch (java.io.IOException ex) { ex.printStackTrace(); @@ -96,7 +86,5 @@ public class AssociatePdbFileWithSeq entry.setFile(choice); sequence.getDatasetSequence().addPDBId(entry); return entry; - } - } diff --git a/src/jalview/gui/PopupMenu.java b/src/jalview/gui/PopupMenu.java index 3b43e6b..075374a 100644 --- a/src/jalview/gui/PopupMenu.java +++ b/src/jalview/gui/PopupMenu.java @@ -1063,30 +1063,7 @@ public class PopupMenu extends JPopupMenu { public void actionPerformed(ActionEvent e) { - try { - pdbFromFile_actionPerformed(); - } catch (ExceptionFileFormatOrSyntax e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } catch (ParserConfigurationException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } catch (SAXException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } catch (ExceptionPermissionDenied e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } catch (ExceptionLoadingFailed e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } catch (InterruptedException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } catch (ExceptionUnmatchedClosingParentheses e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } + pdbFromFile_actionPerformed(); } }); enterPDB.setText("Enter PDB Id"); @@ -1984,7 +1961,7 @@ public class PopupMenu extends JPopupMenu oal = null; } - public void pdbFromFile_actionPerformed() throws ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses + public void pdbFromFile_actionPerformed() { jalview.io.JalviewFileChooser chooser = new jalview.io.JalviewFileChooser( jalview.bin.Cache.getProperty("LAST_DIRECTORY")); diff --git a/src/jalview/io/AlignFile.java b/src/jalview/io/AlignFile.java index cfd37b0..81d0ae4 100755 --- a/src/jalview/io/AlignFile.java +++ b/src/jalview/io/AlignFile.java @@ -27,15 +27,6 @@ import java.util.Enumeration; import java.util.Hashtable; import java.util.Vector; -import javax.xml.parsers.ParserConfigurationException; - -import org.xml.sax.SAXException; - -import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax; -import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed; -import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied; -import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses; - /** * DOCUMENT ME! * @@ -85,15 +76,8 @@ public abstract class AlignFile extends FileParse * Filename to read from. * @param type * What type of file to read from (File, URL) - * @throws SAXException - * @throws ParserConfigurationException - * @throws ExceptionFileFormatOrSyntax - * @throws ExceptionLoadingFailed - * @throws ExceptionPermissionDenied - * @throws InterruptedException - * @throws ExceptionUnmatchedClosingParentheses */ - public AlignFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses + public AlignFile(String inFile, String type) throws IOException { super(inFile, type); initData(); @@ -111,15 +95,8 @@ public abstract class AlignFile extends FileParse * * @param source * @throws IOException - * @throws SAXException - * @throws ParserConfigurationException - * @throws ExceptionFileFormatOrSyntax - * @throws ExceptionLoadingFailed - * @throws ExceptionPermissionDenied - * @throws InterruptedException - * @throws ExceptionUnmatchedClosingParentheses */ - public AlignFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses + public AlignFile(FileParse source) throws IOException { super(source); initData(); @@ -264,15 +241,8 @@ public abstract class AlignFile extends FileParse /** * This method must be implemented to parse the contents of the file. - * @throws ExceptionFileFormatOrSyntax - * @throws SAXException - * @throws ParserConfigurationException - * @throws ExceptionLoadingFailed - * @throws ExceptionPermissionDenied - * @throws InterruptedException - * @throws ExceptionUnmatchedClosingParentheses */ - public abstract void parse() throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses; + public abstract void parse() throws IOException; /** * Print out in alignment file format the Sequences in the seqs Vector. diff --git a/src/jalview/io/BLCFile.java b/src/jalview/io/BLCFile.java index b5617c6..5b02b59 100755 --- a/src/jalview/io/BLCFile.java +++ b/src/jalview/io/BLCFile.java @@ -20,15 +20,6 @@ package jalview.io; import java.io.*; import java.util.*; -import javax.xml.parsers.ParserConfigurationException; - -import org.xml.sax.SAXException; - -import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax; -import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed; -import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied; -import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses; - import jalview.datamodel.*; /** @@ -58,20 +49,13 @@ public class BLCFile extends AlignFile * * @throws IOException * DOCUMENT ME! - * @throws SAXException - * @throws ParserConfigurationException - * @throws ExceptionFileFormatOrSyntax - * @throws ExceptionLoadingFailed - * @throws ExceptionPermissionDenied - * @throws InterruptedException - * @throws ExceptionUnmatchedClosingParentheses */ - public BLCFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses + public BLCFile(String inFile, String type) throws IOException { super(inFile, type); } - public BLCFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses + public BLCFile(FileParse source) throws IOException { super(source); } diff --git a/src/jalview/io/ClustalFile.java b/src/jalview/io/ClustalFile.java index d1225c4..4ae5e77 100755 --- a/src/jalview/io/ClustalFile.java +++ b/src/jalview/io/ClustalFile.java @@ -20,15 +20,6 @@ package jalview.io; import java.io.*; import java.util.*; -import javax.xml.parsers.ParserConfigurationException; - -import org.xml.sax.SAXException; - -import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax; -import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed; -import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied; -import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses; - import jalview.datamodel.*; import jalview.util.*; @@ -39,12 +30,12 @@ public class ClustalFile extends AlignFile { } - public ClustalFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses + public ClustalFile(String inFile, String type) throws IOException { super(inFile, type); } - public ClustalFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses + public ClustalFile(FileParse source) throws IOException { super(source); } diff --git a/src/jalview/io/FastaFile.java b/src/jalview/io/FastaFile.java index f413540..0e964b3 100755 --- a/src/jalview/io/FastaFile.java +++ b/src/jalview/io/FastaFile.java @@ -19,14 +19,6 @@ package jalview.io; import java.io.*; -import javax.xml.parsers.ParserConfigurationException; - -import org.xml.sax.SAXException; - -import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax; -import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed; -import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied; -import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses; import jalview.datamodel.*; @@ -62,20 +54,13 @@ public class FastaFile extends AlignFile * * @throws IOException * DOCUMENT ME! - * @throws SAXException - * @throws ParserConfigurationException - * @throws ExceptionFileFormatOrSyntax - * @throws ExceptionLoadingFailed - * @throws ExceptionPermissionDenied - * @throws InterruptedException - * @throws ExceptionUnmatchedClosingParentheses */ - public FastaFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses + public FastaFile(String inFile, String type) throws IOException { super(inFile, type); } - public FastaFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses + public FastaFile(FileParse source) throws IOException { super(source); } diff --git a/src/jalview/io/FeaturesFile.java b/src/jalview/io/FeaturesFile.java index afbd223..ea7ac70 100755 --- a/src/jalview/io/FeaturesFile.java +++ b/src/jalview/io/FeaturesFile.java @@ -20,15 +20,6 @@ package jalview.io; import java.io.*; import java.util.*; -import javax.xml.parsers.ParserConfigurationException; - -import org.xml.sax.SAXException; - -import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax; -import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed; -import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied; -import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses; - import jalview.analysis.SequenceIdMatcher; import jalview.datamodel.*; import jalview.schemes.*; @@ -68,26 +59,13 @@ public class FeaturesFile extends AlignFile * * @throws IOException * DOCUMENT ME! - * @throws SAXException - * @throws ParserConfigurationException - * @throws ExceptionFileFormatOrSyntax - * @throws ExceptionLoadingFailed - * @throws ExceptionPermissionDenied - * @throws InterruptedException - * @throws ExceptionUnmatchedClosingParentheses */ - public FeaturesFile(String inFile, String type) throws IOException, - ExceptionFileFormatOrSyntax, ParserConfigurationException, - SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, - InterruptedException, ExceptionUnmatchedClosingParentheses + public FeaturesFile(String inFile, String type) throws IOException { super(inFile, type); } - public FeaturesFile(FileParse source) throws IOException, - ExceptionFileFormatOrSyntax, ParserConfigurationException, - SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, - InterruptedException, ExceptionUnmatchedClosingParentheses + public FeaturesFile(FileParse source) throws IOException { super(source); } diff --git a/src/jalview/io/JPredFile.java b/src/jalview/io/JPredFile.java index 509758b..abdfed0 100755 --- a/src/jalview/io/JPredFile.java +++ b/src/jalview/io/JPredFile.java @@ -25,15 +25,6 @@ package jalview.io; import java.io.*; import java.util.*; -import javax.xml.parsers.ParserConfigurationException; - -import org.xml.sax.SAXException; - -import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax; -import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed; -import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied; -import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses; - import jalview.datamodel.*; /** @@ -75,20 +66,13 @@ public class JPredFile extends AlignFile * * @throws IOException * DOCUMENT ME! - * @throws SAXException - * @throws ParserConfigurationException - * @throws ExceptionFileFormatOrSyntax - * @throws ExceptionLoadingFailed - * @throws ExceptionPermissionDenied - * @throws InterruptedException - * @throws ExceptionUnmatchedClosingParentheses */ - public JPredFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses + public JPredFile(String inFile, String type) throws IOException { super(inFile, type); } - public JPredFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses + public JPredFile(FileParse source) throws IOException { super(source); } @@ -363,15 +347,8 @@ public class JPredFile extends AlignFile * * @param args * DOCUMENT ME! - * @throws SAXException - * @throws ParserConfigurationException - * @throws ExceptionFileFormatOrSyntax - * @throws ExceptionLoadingFailed - * @throws ExceptionPermissionDenied - * @throws InterruptedException - * @throws ExceptionUnmatchedClosingParentheses */ - public static void main(String[] args) throws ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses + public static void main(String[] args) { try { diff --git a/src/jalview/io/MSFfile.java b/src/jalview/io/MSFfile.java index c3ee382..7c70a09 100755 --- a/src/jalview/io/MSFfile.java +++ b/src/jalview/io/MSFfile.java @@ -20,15 +20,6 @@ package jalview.io; import java.io.*; import java.util.*; -import javax.xml.parsers.ParserConfigurationException; - -import org.xml.sax.SAXException; - -import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax; -import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed; -import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied; -import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses; - import jalview.datamodel.*; import jalview.util.*; @@ -58,20 +49,13 @@ public class MSFfile extends AlignFile * * @throws IOException * DOCUMENT ME! - * @throws SAXException - * @throws ParserConfigurationException - * @throws ExceptionFileFormatOrSyntax - * @throws ExceptionLoadingFailed - * @throws ExceptionPermissionDenied - * @throws InterruptedException - * @throws ExceptionUnmatchedClosingParentheses */ - public MSFfile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses + public MSFfile(String inFile, String type) throws IOException { super(inFile, type); } - public MSFfile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses + public MSFfile(FileParse source) throws IOException { super(source); } diff --git a/src/jalview/io/PIRFile.java b/src/jalview/io/PIRFile.java index cdd0b98..9431cc5 100755 --- a/src/jalview/io/PIRFile.java +++ b/src/jalview/io/PIRFile.java @@ -20,15 +20,6 @@ package jalview.io; import java.io.*; import java.util.*; -import javax.xml.parsers.ParserConfigurationException; - -import org.xml.sax.SAXException; - -import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax; -import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed; -import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied; -import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses; - import jalview.datamodel.*; public class PIRFile extends AlignFile @@ -41,12 +32,12 @@ public class PIRFile extends AlignFile { } - public PIRFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses + public PIRFile(String inFile, String type) throws IOException { super(inFile, type); } - public PIRFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses + public PIRFile(FileParse source) throws IOException { super(source); } diff --git a/src/jalview/io/PfamFile.java b/src/jalview/io/PfamFile.java index af91390..c5ef4f7 100755 --- a/src/jalview/io/PfamFile.java +++ b/src/jalview/io/PfamFile.java @@ -20,14 +20,6 @@ package jalview.io; import java.io.*; import java.util.*; -import javax.xml.parsers.ParserConfigurationException; - -import org.xml.sax.SAXException; - -import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax; -import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed; -import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied; -import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses; import jalview.datamodel.*; import jalview.util.*; @@ -39,12 +31,12 @@ public class PfamFile extends AlignFile { } - public PfamFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses + public PfamFile(String inFile, String type) throws IOException { super(inFile, type); } - public PfamFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses + public PfamFile(FileParse source) throws IOException { super(source); } diff --git a/src/jalview/io/PileUpfile.java b/src/jalview/io/PileUpfile.java index 3fffab3..39f367b 100755 --- a/src/jalview/io/PileUpfile.java +++ b/src/jalview/io/PileUpfile.java @@ -34,15 +34,6 @@ package jalview.io; */ import java.io.*; -import javax.xml.parsers.ParserConfigurationException; - -import org.xml.sax.SAXException; - -import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax; -import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed; -import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied; -import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses; - import jalview.datamodel.*; import jalview.util.*; @@ -66,20 +57,14 @@ public class PileUpfile extends MSFfile * * @throws IOException * DOCUMENT ME! - * @throws SAXException - * @throws ParserConfigurationException - * @throws ExceptionFileFormatOrSyntax - * @throws ExceptionLoadingFailed - * @throws ExceptionPermissionDenied - * @throws InterruptedException - * @throws ExceptionUnmatchedClosingParentheses + */ - public PileUpfile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses + public PileUpfile(String inFile, String type) throws IOException { super(inFile, type); } - public PileUpfile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses + public PileUpfile(FileParse source) throws IOException { super(source); } diff --git a/src/jalview/io/SimpleBlastFile.java b/src/jalview/io/SimpleBlastFile.java index 9256283..5cbf78d 100644 --- a/src/jalview/io/SimpleBlastFile.java +++ b/src/jalview/io/SimpleBlastFile.java @@ -20,15 +20,6 @@ package jalview.io; import java.io.*; import java.util.*; -import javax.xml.parsers.ParserConfigurationException; - -import org.xml.sax.SAXException; - -import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax; -import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed; -import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied; -import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses; - import jalview.datamodel.*; /** @@ -54,12 +45,12 @@ public class SimpleBlastFile extends AlignFile { } - public SimpleBlastFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses + public SimpleBlastFile(String inFile, String type) throws IOException { super(inFile, type); } - public SimpleBlastFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses + public SimpleBlastFile(FileParse source) throws IOException { super(source); } diff --git a/src/jalview/io/TCoffeeScoreFile.java b/src/jalview/io/TCoffeeScoreFile.java index 56994ae..ad5f52a 100644 --- a/src/jalview/io/TCoffeeScoreFile.java +++ b/src/jalview/io/TCoffeeScoreFile.java @@ -33,15 +33,6 @@ import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; -import javax.xml.parsers.ParserConfigurationException; - -import org.xml.sax.SAXException; - -import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax; -import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed; -import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied; -import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses; - /** * A file parse for T-Coffee score ascii format. This file contains the * alignment consensus for each resude in any sequence. @@ -95,15 +86,16 @@ import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses; * @author Paolo Di Tommaso * */ -public class TCoffeeScoreFile extends AlignFile { - - public TCoffeeScoreFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses +public class TCoffeeScoreFile extends AlignFile +{ + + public TCoffeeScoreFile(String inFile, String type) throws IOException { super(inFile, type); } - public TCoffeeScoreFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses + public TCoffeeScoreFile(FileParse source) throws IOException { super(source); } diff --git a/test/jalview/io/TCoffeeScoreFileTest.java b/test/jalview/io/TCoffeeScoreFileTest.java index ce23728..6d11ebe 100644 --- a/test/jalview/io/TCoffeeScoreFileTest.java +++ b/test/jalview/io/TCoffeeScoreFileTest.java @@ -42,7 +42,7 @@ public class TCoffeeScoreFileTest { final static File ALIGN_FILE = new File("test/jalview/io/tcoffee.fasta_aln"); @Test - public void testReadHeader() throws IOException, FileNotFoundException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses { + public void testReadHeader() throws IOException { TCoffeeScoreFile scoreFile = new TCoffeeScoreFile(SCORE_FILE.getPath(),AppletFormatAdapter.FILE); assertTrue(scoreFile.getWarningMessage(),scoreFile.isValid()); @@ -64,7 +64,7 @@ public class TCoffeeScoreFileTest { @Test - public void testWrongFile() throws ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses { + public void testWrongFile() { try { TCoffeeScoreFile result = new TCoffeeScoreFile(ALIGN_FILE.getPath(), FormatAdapter.FILE); assertFalse(result.isValid()); @@ -76,7 +76,7 @@ public class TCoffeeScoreFileTest { } @Test - public void testHeightAndWidth() throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses { + public void testHeightAndWidth() throws IOException { TCoffeeScoreFile result = new TCoffeeScoreFile(SCORE_FILE.getPath(), FormatAdapter.FILE); assertTrue(result.isValid()); assertEquals( 8, result.getHeight() ); @@ -116,7 +116,7 @@ public class TCoffeeScoreFileTest { } @Test - public void testParse() throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses { + public void testParse() throws IOException { TCoffeeScoreFile parser = new TCoffeeScoreFile(SCORE_FILE.getPath(), FormatAdapter.FILE); @@ -133,7 +133,7 @@ public class TCoffeeScoreFileTest { @Test - public void testGetAsList() throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses { + public void testGetAsList() throws IOException { TCoffeeScoreFile parser = new TCoffeeScoreFile(SCORE_FILE.getPath(),FormatAdapter.FILE); assertTrue(parser.getWarningMessage(),parser.isValid()); @@ -152,7 +152,7 @@ public class TCoffeeScoreFileTest { @Test - public void testGetAsArray() throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses { + public void testGetAsArray() throws IOException { TCoffeeScoreFile parser = new TCoffeeScoreFile(SCORE_FILE.getPath(),FormatAdapter.FILE); assertTrue(parser.getWarningMessage(),parser.isValid()); -- 1.7.10.2