Skip to content

Commit

Permalink
fix: NoClassDefFoundError:
Browse files Browse the repository at this point in the history
org/apache/commons/lang/exception/ExceptionUtils in IJ 2023.3 EAP

Fixes #1191

Signed-off-by: azerr <[email protected]>
  • Loading branch information
angelozerr committed Oct 3, 2023
1 parent af5c507 commit fbb8651
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@
import com.redhat.devtools.intellij.lsp4ij.console.explorer.LanguageServerTreeNode;
import com.redhat.devtools.intellij.lsp4ij.settings.ServerTrace;
import com.redhat.devtools.intellij.lsp4ij.settings.UserDefinedLanguageServerSettings;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;
import javax.swing.tree.DefaultMutableTreeNode;
import java.awt.*;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.HashSet;
import java.util.Set;

Expand Down Expand Up @@ -218,7 +219,7 @@ public void run() {
}
ServerTrace newServerTrace = settings.getServerTrace();
if (newServerTrace != null && !newServerTrace.equals(serverTraceComboBox.getSelectedItem())) {
serverTraceComboBox.setSelectedItem(newServerTrace);
serverTraceComboBox.setSelectedItem(newServerTrace);
}
}
};
Expand Down Expand Up @@ -249,7 +250,7 @@ public void showMessage(String message) {
}

public void showError(Throwable exception) {
String stacktrace = ExceptionUtils.getStackTrace(exception);
String stacktrace = getStackTrace(exception);
consoleView.print(stacktrace, ConsoleViewContentType.ERROR_OUTPUT);
}

Expand Down Expand Up @@ -304,4 +305,12 @@ public void dispose() {
private boolean isDisposed() {
return disposed || project.isDisposed();
}


private static String getStackTrace(Throwable throwable) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw, true);
throwable.printStackTrace(pw);
return sw.getBuffer().toString();
}
}

0 comments on commit fbb8651

Please sign in to comment.