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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.23.1</version>
<version>2.25.4</version>
</dependency>

<dependency>
Expand Down
43 changes: 41 additions & 2 deletions src/main/java/com/compomics/util/exceptions/ExceptionHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,53 @@ public ExceptionHandler() {
public synchronized void catchException(Exception e) {

if (!ignoreExceptions && !exceptionCaught.contains(getExceptionType(e))) {

e.printStackTrace();
exceptionCaught.add(getExceptionType(e));

// @TODO: remove once the underlying Nimbus look and feel bug is fixed.
// On recent JDKs the Nimbus look and feel can throw a benign
// ClassCastException ("ColorUIResource cannot be cast to Boolean" in
// NimbusStyle.isOpaque) while building chart popup menus. It does not
// affect functionality, so it is logged above but not shown to the user.
if (isBenignLookAndFeelException(e)) {
return;
}

notifyUser(e);

}
}

/**
* Indicates whether the given exception is the known benign look and feel
* ClassCastException thrown while rendering (e.g. "ColorUIResource cannot be
* cast to Boolean" in NimbusStyle). Such exceptions do not affect
* functionality and should not be reported to the user.
*
* @param e the exception to inspect
*
* @return true if the exception is a benign look and feel rendering exception
*/
private static boolean isBenignLookAndFeelException(Exception e) {

if (!(e instanceof ClassCastException)) {
return false;
}

for (StackTraceElement element : e.getStackTrace()) {

String className = element.getClassName();

if (className.startsWith("javax.swing.plaf.nimbus.")
|| className.startsWith("javax.swing.plaf.synth.")) {
return true;
}
}

return false;
}

/**
* Notifies the user that an exception was caught.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,18 @@ public enum AdvocateType {
* The MSFragger search engine.
*/
public static final Advocate msFragger = new Advocate(37, "MSFragger", AdvocateType.search_engine, new java.awt.Color(128, 128, 0));
/**
* The InstaNovo de novo sequencing algorithm.
*/
public static final Advocate instanovo = new Advocate(38, "InstaNovo", AdvocateType.sequencing_algorithm, new Color(95, 158, 160));
/**
* The InstaNovo+ de novo sequencing algorithm.
*/
public static final Advocate instanovoPlus = new Advocate(39, "InstaNovo+", AdvocateType.sequencing_algorithm, new Color(123, 104, 238));
/**
* The InstaNovo predictions refined with InstaNovo+ de novo sequencing algorithm.
*/
public static final Advocate instanovoRefined = new Advocate(40, "InstaNovo with refinement", AdvocateType.sequencing_algorithm, new Color(72, 209, 204));
/**
* Advocate type for mzId files where no software is annotated.
*/
Expand Down Expand Up @@ -311,7 +323,7 @@ public String toString() {
* @return the implemented advocates in an array
*/
public static Advocate[] values() {
Advocate[] result = new Advocate[40 + userAdvocates.size()];
Advocate[] result = new Advocate[43 + userAdvocates.size()];
int i = 0;
result[i] = peptideShaker;
result[++i] = onyaseEngine;
Expand Down Expand Up @@ -353,6 +365,9 @@ public static Advocate[] values() {
result[++i] = coss;
result[++i] = sage;
result[++i] = msFragger;
result[++i] = instanovo;
result[++i] = instanovoPlus;
result[++i] = instanovoRefined;

for (Advocate advocate : userAdvocates.values()) {
result[++i] = advocate;
Expand Down Expand Up @@ -489,6 +504,8 @@ public String getPmid() {
return "37819886";
} else if (this == msFragger) {
return "28394336";
} else if (this == instanovo || this == instanovoPlus || this == instanovoRefined) {
return null;
} else {
return null;
}
Expand Down
Loading