From 2109c3150bf77701bf936ca1e7f829f630e9eeee Mon Sep 17 00:00:00 2001 From: jqyp Date: Wed, 8 Jul 2020 17:19:39 +0300 Subject: [PATCH] Fix bug with odd title of issues. This closes #39 --- .../spotbugs/core/ErrorReportSubmitterImpl.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/jetbrains/plugins/spotbugs/core/ErrorReportSubmitterImpl.java b/src/main/java/org/jetbrains/plugins/spotbugs/core/ErrorReportSubmitterImpl.java index 006766c1..cba427ed 100644 --- a/src/main/java/org/jetbrains/plugins/spotbugs/core/ErrorReportSubmitterImpl.java +++ b/src/main/java/org/jetbrains/plugins/spotbugs/core/ErrorReportSubmitterImpl.java @@ -19,6 +19,8 @@ */ package org.jetbrains.plugins.spotbugs.core; +import com.intellij.diagnostic.AbstractMessage; +import com.intellij.diagnostic.IdeaReportingEvent; import com.intellij.ide.BrowserUtil; import com.intellij.openapi.diagnostic.*; import com.intellij.openapi.ide.CopyPasteManager; @@ -203,8 +205,15 @@ private static Error createError(@NotNull final IdeaLoggingEvent event) { if (StringUtil.isEmptyOrSpaces(message) || "null".equals(message)) { message = null; } - final Throwable throwable = event.getThrowable(); - if (message == null && throwable == null) { + final Throwable throwable; + // event is a com.intellij.diagnostic.IdeaReportingEvent.TextBasedThrowable + // This is a wrapper and is only providing the original stack trace via 'printStackTrace(...)', + // but not via 'getStackTrace()'. + // + // So, we workaround this by retrieving the original exception from the data property + if (event instanceof IdeaReportingEvent && event.getData() instanceof AbstractMessage) { + throwable = ((AbstractMessage) event.getData()).getThrowable(); + } else { return null; } final String fullError;