diff --git a/packages/jsii-java-runtime/pom.xml.t.js b/packages/jsii-java-runtime/pom.xml.t.js
index ddf1ef65fc..ba5aad4a17 100644
--- a/packages/jsii-java-runtime/pom.xml.t.js
+++ b/packages/jsii-java-runtime/pom.xml.t.js
@@ -51,7 +51,6 @@ process.stdout.write(`
UTF-8
[3.0.2,3.1.0)
- [27.0.1-jre,27.1)
[2.9.8,2.10.0)
[1.3.2,1.4.0)
[5.4.1,5.5.0)
@@ -73,13 +72,6 @@ process.stdout.write(`
\${jackson.version}
-
-
- com.google.guava
- guava
- \${guava.version}
-
-
com.google.code.findbugs
diff --git a/packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiEngine.java b/packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiEngine.java
index c957574a31..09b568896a 100644
--- a/packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiEngine.java
+++ b/packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiEngine.java
@@ -8,8 +8,9 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
-import com.google.common.base.Throwables;
+import java.io.PrintWriter;
+import java.io.StringWriter;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@@ -388,7 +389,11 @@ private Object invokeMethod(final Object obj, final Method method, final Object.
try {
return method.invoke(obj, args);
} catch (Exception e) {
- this.log("Error while invoking %s with %s: %s", method, Arrays.toString(args), Throwables.getStackTraceAsString(e));
+ final StringWriter sw = new StringWriter();
+ try (final PrintWriter pw = new PrintWriter(sw)) {
+ e.printStackTrace(pw);
+ }
+ this.log("Error while invoking %s with %s: %s", method, Arrays.toString(args), sw.toString());
throw e;
}
} catch (InvocationTargetException e) {
diff --git a/packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiObjectMapper.java b/packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiObjectMapper.java
index c3e59799cd..6e4c025bab 100644
--- a/packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiObjectMapper.java
+++ b/packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiObjectMapper.java
@@ -26,7 +26,6 @@
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.type.MapLikeType;
import com.fasterxml.jackson.databind.type.MapType;
-import com.google.common.annotations.VisibleForTesting;
/**
* Provides a correctly configured JSON processor for handling JSII requests and responses.
@@ -88,7 +87,6 @@ private JsiiObjectMapper() {
this(JsiiEngine.getInstance());
}
- @VisibleForTesting
JsiiObjectMapper(final JsiiEngine jsiiEngine) {
this.jsiiEngine = jsiiEngine;
@@ -105,7 +103,6 @@ private JsiiObjectMapper() {
this.objectMapper.registerModule(module);
}
- @VisibleForTesting
ObjectMapper getObjectMapper() {
return this.objectMapper;
}
diff --git a/packages/jsii-java-runtime/project/src/test/java/software/amazon/jsii/JsiiObjectMapperTest.java b/packages/jsii-java-runtime/project/src/test/java/software/amazon/jsii/JsiiObjectMapperTest.java
index c12f129e6d..fd5fe1d028 100644
--- a/packages/jsii-java-runtime/project/src/test/java/software/amazon/jsii/JsiiObjectMapperTest.java
+++ b/packages/jsii-java-runtime/project/src/test/java/software/amazon/jsii/JsiiObjectMapperTest.java
@@ -4,12 +4,15 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
import java.time.Instant;
import java.util.List;
+import java.util.stream.Collectors;
import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.common.base.Charsets;
-import com.google.common.io.Resources;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
@@ -38,18 +41,21 @@ public void testDeserialization() throws Exception {
when((TestEnum) jsiiEngine.findEnumValue("module.Enum#value")).thenReturn(TestEnum.DUMMY);
- final String json =
- Resources.toString(Resources.getResource(this.getClass(), "complex-callback.json"), Charsets.UTF_8);
- final TestCallback callback = subject.treeToValue(subject.readTree(json), TestCallback.class);
-
- assertEquals("CallbackID", callback.getCbid());
- assertNotNull(callback.getInvoke());
- if (callback.getCbid() != null) {
- assertEquals("methodName", callback.getInvoke().getMethod());
- assertEquals(1337, callback.getInvoke().getArgs().get(0));
- assertEquals(mockObject1, callback.getInvoke().getArgs().get(1));
- assertEquals(Instant.ofEpochMilli(1553624863569L), callback.getInvoke().getArgs().get(2));
- assertEquals(TestEnum.DUMMY, callback.getInvoke().getArgs().get(3));
+ try (final InputStream stream = this.getClass().getResourceAsStream("complex-callback.json");
+ final InputStreamReader reader = new InputStreamReader(stream, StandardCharsets.UTF_8);
+ final BufferedReader buffered = new BufferedReader(reader)) {
+ final String json = buffered.lines().collect(Collectors.joining("\n"));
+ final TestCallback callback = subject.treeToValue(subject.readTree(json), TestCallback.class);
+
+ assertEquals("CallbackID", callback.getCbid());
+ assertNotNull(callback.getInvoke());
+ if (callback.getCbid() != null) {
+ assertEquals("methodName", callback.getInvoke().getMethod());
+ assertEquals(1337, callback.getInvoke().getArgs().get(0));
+ assertEquals(mockObject1, callback.getInvoke().getArgs().get(1));
+ assertEquals(Instant.ofEpochMilli(1553624863569L), callback.getInvoke().getArgs().get(2));
+ assertEquals(TestEnum.DUMMY, callback.getInvoke().getArgs().get(3));
+ }
}
}