Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ antbuild/
.classpath
.project

#emacs
*~

# LaTeX auxiliary files
*.aux
*.blg
Expand Down
Empty file modified src/megan/accessiondb/AccessAccessionMappingDatabase.java
100755 → 100644
Empty file.
Empty file modified src/megan/accessiondb/CreateAccessionMappingDatabase.java
100755 → 100644
Empty file.
Empty file modified src/megan/accessiondb/ModifyAccessionMappingDatabase.java
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion src/megan/algorithms/AssignmentUsingBestHit.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ private Map<String, Integer> loadAssignmentFiles(String cName, String fileName)
}
}
} catch (IOException ex) {
System.err.println(ex.getMessage());
System.err.println(ex);
}
System.err.println("Count: " + map.size());
if (map.size() > 0)
Expand Down
2 changes: 1 addition & 1 deletion src/megan/algorithms/DataProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ else if (id > 0)
return (int) doc.getDataTable().getTotalReads();
} catch (IOException ex) {
Basic.caught(ex);
NotificationsInSwing.showInternalError("Data Processor failed: " + ex.getMessage());
NotificationsInSwing.showInternalError("Data Processor failed: " + ex);
}
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/megan/alignment/commands/ExportAlignmentCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void apply(NexusStreamParser np) throws Exception {
w.close();
}
} catch (IOException e) {
NotificationsInSwing.showError("Export Alignment failed: " + e.getMessage());
NotificationsInSwing.showError("Export Alignment failed: " + e);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/megan/alignment/commands/ExportConsensusCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void apply(NexusStreamParser np) throws Exception {
w.close();
}
} catch (IOException e) {
NotificationsInSwing.showError("Export Consensus failed: " + e.getMessage());
NotificationsInSwing.showError("Export Consensus failed: " + e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void apply(NexusStreamParser np) throws Exception {
if (showGraph)
alignmentAssembler.showOverlapGraph(dir, dir.getDocument().getProgressListener());
} catch (IOException e) {
NotificationsInSwing.showError("Export overlap file FAILED: " + e.getMessage());
NotificationsInSwing.showError("Export overlap file FAILED: " + e);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/megan/alignment/commands/ExportReferenceCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void apply(NexusStreamParser np) throws Exception {
w.close();
}
} catch (IOException e) {
NotificationsInSwing.showError("Export Reference failed: " + e.getMessage());
NotificationsInSwing.showError("Export Reference failed: " + e);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/megan/blastclient/RemoteBlastDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public void actionPerformed(ActionEvent e) {
break;
}
} catch (IOException ex) {
NotificationsInSwing.showError("Write file failed: " + ex.getMessage());
NotificationsInSwing.showError("Write file failed: " + ex);
return;
}
System.err.println("Reads written to: " + readsFile);
Expand Down
2 changes: 1 addition & 1 deletion src/megan/chart/commands/ExportDataCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void apply(NexusStreamParser np) throws Exception {
chartViewer.getChartDrawer().writeData(w);
w.close();
} catch (IOException e) {
NotificationsInSwing.showError("Export Data failed: " + e.getMessage());
NotificationsInSwing.showError("Export Data failed: " + e);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/megan/chart/drawers/CoOccurrenceToolBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public void actionPerformed(ActionEvent actionEvent) {

chartViewer.getDir().execute("show what=all target=classes;", chartViewer.getCommandManager());
} catch (Exception ex) {
NotificationsInSwing.showInternalError(chartViewer.getFrame(), "CoOccurrence drawer: " + ex.getMessage());
NotificationsInSwing.showInternalError(chartViewer.getFrame(), "CoOccurrence drawer: " + ex);
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/megan/classification/Classification.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void load(String treeFile, String mapFile, ProgressListener progress) {
progress.setProgress(2);
} catch (Exception e) {
Basic.caught(e);
NotificationsInSwing.showError(MainViewer.getLastActiveFrame(), "Failed to open files: " + treeFile + " and " + mapFile + ": " + e.getMessage());
NotificationsInSwing.showError(MainViewer.getLastActiveFrame(), "Failed to open files: " + treeFile + " and " + mapFile + ": " + e);
} finally {
progress.setCancelable(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public void actionPerformed(ActionEvent ev) {
ClassificationManager.setMeganMapDBFile(file.toString());
ClassificationManager.setUseFastAccessionMappingMode(true);
} catch (IOException e) {
NotificationsInSwing.showError("Load MEGAN mapping db failed: " + e.getMessage());
NotificationsInSwing.showError("Load MEGAN mapping db failed: " + e);
return;
}
final Collection<String> supportedClassifications = AccessAccessionMappingDatabase.getContainedClassificationsIfDBExists(file.getPath());
Expand Down
4 changes: 2 additions & 2 deletions src/megan/commands/MeganizeDAACommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,8 @@ public void apply(NexusStreamParser np) throws Exception {
} catch (CanceledException ex) {
throw ex;
} catch (Exception ex) {
NotificationsInSwing.showError(ex.getMessage());
System.err.println(ex.getMessage());
NotificationsInSwing.showError(ex.toString());
System.err.println(ex);
countFailed++;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/megan/commands/SetWindowSizeCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void actionPerformed(ActionEvent event) {
throw new NumberFormatException("Unexpected characters at end of string");
execute("set windowSize=" + width + " x " + height + ";");
} catch (NumberFormatException e) {
NotificationsInSwing.showError("Window Size: Invalid entry: " + e.getMessage());
NotificationsInSwing.showError("Window Size: Invalid entry: " + e.toString());
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/megan/commands/additional/RunBlastOnNCBICommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public void apply(NexusStreamParser np) throws Exception {
}
}
} catch (Exception ex) {
NotificationsInSwing.showError("Create RMA file failed: " + ex.getMessage());
NotificationsInSwing.showError("Create RMA file failed: " + ex);
getDir().notifyUnlockInput();
getDir().executeImmediately("close what=current;", ((Director) getDir()).getCommandManager());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void apply(NexusStreamParser np) throws Exception {
exception.setIfCurrentValueIsNull(ex);
}
if(exception.isNotNull()) {
NotificationsInSwing.showError("Write failed: "+exception.get().getMessage());
NotificationsInSwing.showError("Write failed: "+exception.get());
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/megan/core/Director.java
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ public boolean executeImmediately(final String command, CommandManager commandMa

return false;
} catch (Exception ex) {
NotificationsInSwing.showError("Command failed: " + ex.getMessage());
NotificationsInSwing.showError("Command failed: " + ex);
return false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/megan/dialogs/attributes/AttributeData.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private AttributeData(String filename) {
System.err.println("done (" + attribute2kind2taxaNames.size() + ")");
} catch (IOException e) {
Basic.caught(e);
NotificationsInSwing.showError(MainViewer.getLastActiveFrame(), "Init failed: " + e.getMessage());
NotificationsInSwing.showError(MainViewer.getLastActiveFrame(), "Init failed: " + e);
}
setTaxaAttributes();
setAttributes2Properties();
Expand Down
2 changes: 1 addition & 1 deletion src/megan/dialogs/compare/Comparer.java
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ else if (useRelative) {
service.shutdownNow();
}
if(exception.isNotNull())
throw new IOException("Comparison computation failed: " + exception.get().getMessage(), exception.get());
throw new IOException("Comparison computation failed: " + exception.get(), exception.get());

// if we have a taxonomy classification, then use it to get exact values:
if (result.getClassification2Class2Counts().containsKey(Classification.Taxonomy)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void apply(NexusStreamParser np) throws Exception {
FileUtils.writeStreamToFile(new ByteInputStream(selection, selection.length), new File(fileName));
NotificationsInSwing.showInformation("Exported " + StringUtils.countOccurrences(selection, '\n') + " lines to file: " + fileName);
} catch (IOException ex) {
NotificationsInSwing.showError("Export failed: " + ex.getMessage());
NotificationsInSwing.showError("Export failed: " + ex);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void actionPerformed(ActionEvent ev) {
executeImmediately("show window=message; list taxa=" + contaminantManager.getTaxonIdsString() + " title='Contaminants';");

} catch (IOException e) {
NotificationsInSwing.showWarning("Read contaminant file failed: " + e.getMessage());
NotificationsInSwing.showWarning("Read contaminant file failed: " + e);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/megan/importblast/commands/ChooseReadsFileCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void actionPerformed(ActionEvent event) {
importBlastDialog.setReadFileName(StringUtils.toString(files, "\n"));
importBlastDialog.getReadFileNameField().setText(StringUtils.toString(files, "\n"));
} catch (IOException ex) {
NotificationsInSwing.showError(getViewer().getFrame(), "Failed to load file: " + ex.getMessage());
NotificationsInSwing.showError(getViewer().getFrame(), "Failed to load file: " + ex);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void actionPerformed(ActionEvent ev) {
contaminantManager.read(((ImportBlastDialog) getViewer()).getContaminantsFileName());
} catch (IOException e) {
NotificationsInSwing.showError("Failed to parse file: " + ((ImportBlastDialog) getViewer()).getContaminantsFileName()
+ ":\n" + e.getMessage());
+ ":\n" + e);
}
executeImmediately("show window=message;list taxa=" + contaminantManager.getTaxonIdsString() + " title='Contaminants';");
}
Expand Down
2 changes: 1 addition & 1 deletion src/megan/inspector/Loader.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private void processQueue() {
// System.err.println("USER CANCELED EXECUTE");
} catch (Exception ex) {
Basic.caught(ex);
NotificationsInSwing.showError(inspectorWindow.getFrame(), "Load data failed: " + ex.getMessage());
NotificationsInSwing.showError(inspectorWindow.getFrame(), "Load data failed: " + ex);
}
}
} finally {
Expand Down
2 changes: 1 addition & 1 deletion src/megan/io/InputOutputReaderWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public String readString() throws IOException {
try {
return compressor.inflateByteArray2String(-size, bytes);
} catch (DataFormatException e) {
throw new IOException(e.getMessage());
throw new IOException(e.toString());
}
} else {
return Compressor.convertUncompressedByteArray2String(size, bytes);
Expand Down
4 changes: 2 additions & 2 deletions src/megan/io/InputReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public String readString() throws IOException {
try {
return compressor.inflateByteArray2String(-size, bytes);
} catch (DataFormatException e) {
throw new IOException(e.getMessage());
throw new IOException(e.toString());
}
} else {
return Compressor.convertUncompressedByteArray2String(size, bytes);
Expand Down Expand Up @@ -183,7 +183,7 @@ public int readString(byte[] tmp, byte[] target) throws IOException {
try {
return compressor.inflateByteArray(size, tmp, target);
} catch (DataFormatException e) {
throw new IOException(e.getMessage());
throw new IOException(e.toString());
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/megan/main/Megan6.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static void main(String[] args) {

} catch (Throwable th) {
//catch any exceptions and the like that propagate up to the top level
if (!th.getMessage().equals("Help")) {
if (!"Help".equals(th.getMessage())) {
System.err.println("MEGAN fatal error:" + "\n" + th);
Basic.caught(th);
System.exit(1);
Expand Down
28 changes: 14 additions & 14 deletions src/megan/ms/server/RequestHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ static RequestHandler getHelp(String url) {
}
throw new IOException("Resource not found: ms/help.html");
} catch (IOException ex) {
return reportError(c, p, ex.getMessage());
return reportError(c, p, ex.toString());
}
};
}
Expand All @@ -80,7 +80,7 @@ static RequestHandler getVersion() {
checkKnownParameters(p);
return MeganServer.Version.getBytes();
} catch (IOException ex) {
return reportError(c, p, ex.getMessage());
return reportError(c, p, ex.toString());
}
};
}
Expand Down Expand Up @@ -108,7 +108,7 @@ static RequestHandler getListDataset(Database database) {
}
return StringUtils.toString(list, "\n").getBytes();
} catch (IOException ex) {
return reportError(c, p, ex.getMessage());
return reportError(c, p, ex.toString());
}
};
}
Expand All @@ -125,7 +125,7 @@ static RequestHandler getNumberOfReads(Database database) {
}
return StringUtils.toString(list, " ").getBytes();
} catch (IOException ex) {
return reportError(c, p, ex.getMessage());
return reportError(c, p, ex.toString());
}
};
}
Expand All @@ -142,7 +142,7 @@ static RequestHandler getNumberOfMatches(Database database) {
}
return StringUtils.toString(list, " ").getBytes();
} catch (IOException ex) {
return reportError(c, p, ex.getMessage());
return reportError(c, p, ex.toString());
}
};
}
Expand All @@ -159,7 +159,7 @@ static RequestHandler getClassifications(Database database) {
}
return StringUtils.toString(list, "\n").getBytes();
} catch (IOException ex) {
return reportError(c, p, ex.getMessage());
return reportError(c, p, ex.toString());
}
};
}
Expand All @@ -186,7 +186,7 @@ static RequestHandler getAuxiliaryData(Database database) {
}
return StringUtils.toString(list, "\n").getBytes();
} catch (IOException ex) {
return reportError(c, p, ex.getMessage());
return reportError(c, p, ex.toString());
}
};
}
Expand Down Expand Up @@ -214,7 +214,7 @@ static RequestHandler getFileUid(Database database) {
}
return StringUtils.toString(list, "\n").getBytes();
} catch (IOException ex) {
return reportError(c, p, ex.getMessage());
return reportError(c, p, ex.toString());
}
};
}
Expand Down Expand Up @@ -243,7 +243,7 @@ static RequestHandler getClassificationBlock(Database database) {
return StringUtils.toString(list, "\n").getBytes();
}
} catch (IOException ex) {
return reportError(c, p, ex.getMessage());
return reportError(c, p, ex.toString());
}
};
}
Expand Down Expand Up @@ -274,7 +274,7 @@ static RequestHandler getClassSize(Database database) {
}
return StringUtils.toString(list, "\n").getBytes();
} catch (IOException ex) {
return reportError(c, p, ex.getMessage());
return reportError(c, p, ex.toString());
}
};
}
Expand Down Expand Up @@ -304,7 +304,7 @@ static RequestHandler getRead(Database database) {
return ReadBlockMS.writeToString(database.getRead(fileName, readId, format.isMatches()), format.isReadIds(), format.isHeaders(), format.isSequences(), format.isMatches()).getBytes();
}
} catch (IOException ex) {
return reportError(c, p, ex.getMessage());
return reportError(c, p, ex.toString());
}
};
}
Expand Down Expand Up @@ -337,7 +337,7 @@ static RequestHandler getReads(Database database,int defaultReadsPerPage) {
final ReadIteratorPagination.Page page = database.getReads(fileName, format, pageSize);
return getReads(c, binary, page);
} catch (IOException ex) {
return reportError(c, p, ex.getMessage());
return reportError(c, p, ex.toString());
}
};
}
Expand All @@ -364,7 +364,7 @@ static RequestHandler getReadsForMultipleClassIdsIterator(Database database,int
final ReadIteratorPagination.Page page = database.getReadsForMultipleClassIds(fileName, classification, classIds, format, pageSize);
return getReads(c, binary, page);
} catch (IOException ex) {
return reportError(c, p, ex.getMessage());
return reportError(c, p, ex.toString());
}
};
}
Expand All @@ -382,7 +382,7 @@ static RequestHandler getNextPage(Database database) {
final ReadIteratorPagination.Page page = database.getNextPage(pageId, pageSize);
return getReads(c, binary, page);
} catch (IOException ex) {
return reportError(c, p, ex.getMessage());
return reportError(c, p, ex.toString());
}
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/megan/ms/server/RequestHandlerAdditional.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static RequestHandler getDownloadPage(Database database) {
final var file = database.getRecord(name).getFile();
return (DOWNLOAD_FILE_PREFIX + file).getBytes();
} catch (IOException ex) {
return RequestHandler.reportError(c, p, ex.getMessage());
return RequestHandler.reportError(c, p, ex.toString());
}
};
}
Expand Down
Loading