diff --git a/build.gradle b/build.gradle index e18914bf9..43475e0b2 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath 'com.palantir.baseline:gradle-baseline-java:4.188.0' + classpath 'com.palantir.baseline:gradle-baseline-java:4.189.0' classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:2.12.0' classpath 'com.palantir.gradle.externalpublish:gradle-external-publish-plugin:1.11.0' classpath 'com.palantir.gradle.gitversion:gradle-git-version:2.0.0' diff --git a/tritium-lib/src/main/java/com/palantir/tritium/io/InstrumentedStreams.java b/tritium-lib/src/main/java/com/palantir/tritium/io/InstrumentedStreams.java index c9175ecfc..bc62d451c 100644 --- a/tritium-lib/src/main/java/com/palantir/tritium/io/InstrumentedStreams.java +++ b/tritium-lib/src/main/java/com/palantir/tritium/io/InstrumentedStreams.java @@ -34,7 +34,7 @@ private InstrumentedStreams() {} * @return instrumented input stream */ public static InputStream input( - InputStream in, TaggedMetricRegistry metrics, @Safe @CompileTimeConstant String type) { + InputStream in, TaggedMetricRegistry metrics, @Safe @CompileTimeConstant final String type) { return new InstrumentedInputStream(in, IoStreamMetrics.of(metrics).read(type)); } @@ -46,7 +46,7 @@ public static InputStream input( * @return instrumented output stream */ public static OutputStream output( - OutputStream out, TaggedMetricRegistry metrics, @Safe @CompileTimeConstant String type) { + OutputStream out, TaggedMetricRegistry metrics, @Safe @CompileTimeConstant final String type) { return new InstrumentedOutputStream(out, IoStreamMetrics.of(metrics).write(type)); } } diff --git a/tritium-lib/src/main/java/com/palantir/tritium/proxy/InvocationEventProxy.java b/tritium-lib/src/main/java/com/palantir/tritium/proxy/InvocationEventProxy.java index 9edd77864..65da7c745 100644 --- a/tritium-lib/src/main/java/com/palantir/tritium/proxy/InvocationEventProxy.java +++ b/tritium-lib/src/main/java/com/palantir/tritium/proxy/InvocationEventProxy.java @@ -31,6 +31,7 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.List; +import java.util.Objects; import javax.annotation.Nullable; abstract class InvocationEventProxy implements InvocationHandler { @@ -81,7 +82,7 @@ public final Object invoke(Object proxy, Method method, @Nullable Object[] nulla Object result = method.invoke(getDelegate(), arguments); return handleOnSuccess(context, result); } catch (InvocationTargetException ite) { - throw handleOnFailure(context, ite.getCause()); + throw handleOnFailure(context, Objects.requireNonNullElse(ite.getCause(), ite)); } catch (IllegalAccessException | RuntimeException | Error t) { throw handleOnFailure(context, t); }