Skip to content
Merged
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
14 changes: 5 additions & 9 deletions zap/src/main/java/org/zaproxy/zap/ZAP.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,6 @@ private static void setCustomErrStream() {

@Override
public void println(String x) {
// Suppress Nashorn removal warnings, too verbose (a warn each time is
// used).
if ("Warning: Nashorn engine is planned to be removed from a future JDK release"
.equals(x)) {
return;
}
if (x != null && x.startsWith("Multiplexing LAF")) {
return;
}
Expand Down Expand Up @@ -160,7 +154,7 @@ static final class UncaughtExceptionLogger implements Thread.UncaughtExceptionHa
@SuppressWarnings("removal")
public void uncaughtException(Thread t, Throwable e) {
if (!(e instanceof ThreadDeath)) {
updateStats();
updateStats(e);

if (loggerConfigured || isLoggerConfigured()) {
LOGGER.error("Exception in thread \"{}\"", t.getName(), e);
Expand All @@ -172,9 +166,11 @@ public void uncaughtException(Thread t, Throwable e) {
}
}

private static void updateStats() {
private static void updateStats(Throwable e) {
try {
Stats.incCounter("stats.error.core.uncaught");
String baseKey = "stats.error.core.uncaught";
Stats.incCounter(baseKey);
Stats.incCounter(baseKey + "." + e.getClass().getSimpleName());
} catch (Throwable ignore) {
// Already handling an earlier error...
}
Expand Down
Loading