From 3046707b7300788a7af293fedc192bc37600bd32 Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Thu, 3 Oct 2019 13:25:40 +0100 Subject: [PATCH] Excavator: Upgrades Baseline to the latest version (#294) * Excavator: Upgrades Baseline to the latest version * ./gradlew classes testClasses -PerrorProneApply * One more fix --- .baseline/checkstyle/checkstyle.xml | 2 +- build.gradle | 2 +- .../java/com/palantir/tracing/TracingBenchmark.java | 2 +- .../test/java/com/palantir/tracing/TracingDemos.java | 8 ++++---- .../tracing/jersey/TraceEnrichingFilterTest.java | 2 +- .../palantir/tracing/servlet/LeakedTraceFilter.java | 2 +- .../tracing/servlet/LeakedTraceFilterTest.java | 10 +++++----- .../com/palantir/tracing/TestTracingExtensionDemo.java | 2 +- .../java/com/palantir/tracing/AsyncSpanObserver.java | 2 +- tracing/src/main/java/com/palantir/tracing/Trace.java | 4 ++-- tracing/src/main/java/com/palantir/tracing/Tracer.java | 2 +- 11 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.baseline/checkstyle/checkstyle.xml b/.baseline/checkstyle/checkstyle.xml index 268ebe3fc..f541b63e2 100644 --- a/.baseline/checkstyle/checkstyle.xml +++ b/.baseline/checkstyle/checkstyle.xml @@ -469,7 +469,7 @@ <module name="NestedTryDepth"/> <!-- Java Coding Guide: Try/catch blocks: never nested --> <module name="NonEmptyAtclauseDescription"/> <!-- Java Style Guide: At-clauses --> <module name="ParameterName"> <!-- Java Style Guide: Parameter names --> - <property name="format" value="^[a-z][a-zA-Z0-9]+$"/> + <property name="format" value="^_?[a-z][a-zA-Z0-9]+$"/> <message key="name.invalidPattern" value="Parameter name ''{0}'' must match pattern ''{1}''."/> </module> <module name="SingleLineJavadoc"/> <!-- Java Style Guide: General form --> diff --git a/build.gradle b/build.gradle index 6827df364..6441e96dc 100644 --- a/build.gradle +++ b/build.gradle @@ -27,7 +27,7 @@ buildscript { classpath 'com.github.jengelman.gradle.plugins:shadow:5.1.0' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' classpath 'com.netflix.nebula:nebula-publishing-plugin:13.6.1' - classpath 'com.palantir.baseline:gradle-baseline-java:2.8.1' + classpath 'com.palantir.baseline:gradle-baseline-java:2.10.1' classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.12.2' classpath 'gradle.plugin.org.inferred:gradle-processors:3.1.0' classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.12.4' diff --git a/tracing-benchmarks/src/jmh/java/com/palantir/tracing/TracingBenchmark.java b/tracing-benchmarks/src/jmh/java/com/palantir/tracing/TracingBenchmark.java index 189fa73c2..5fc8df2ab 100644 --- a/tracing-benchmarks/src/jmh/java/com/palantir/tracing/TracingBenchmark.java +++ b/tracing-benchmarks/src/jmh/java/com/palantir/tracing/TracingBenchmark.java @@ -107,7 +107,7 @@ private static Runnable wrapWithSpan(String operation, Runnable next) { }; } - public static void main(String[] unused) throws Exception { + public static void main(String[] _args) throws Exception { Options opt = new OptionsBuilder() .include(TracingBenchmark.class.getSimpleName()) .addProfiler(GCProfiler.class) diff --git a/tracing-demos/src/test/java/com/palantir/tracing/TracingDemos.java b/tracing-demos/src/test/java/com/palantir/tracing/TracingDemos.java index 8ef0e36b5..151c921a6 100644 --- a/tracing-demos/src/test/java/com/palantir/tracing/TracingDemos.java +++ b/tracing-demos/src/test/java/com/palantir/tracing/TracingDemos.java @@ -80,7 +80,7 @@ void async_future() throws InterruptedException { Futures.addCallback(future, new FutureCallback<Object>() { @Override - public void onSuccess(Object unused) { + public void onSuccess(Object _value) { assertThat(Tracer.hasTraceId()).isFalse(); try (CloseableSpan tracer = span.completeAndStartChild("success" + i)) { assertThat(Tracer.getTraceId()).isEqualTo(traceId); @@ -90,7 +90,7 @@ public void onSuccess(Object unused) { } @Override - public void onFailure(Throwable unused) { + public void onFailure(Throwable _throwable) { Assertions.fail(); } }, executorService); @@ -209,12 +209,12 @@ void transformed_future() throws InterruptedException { }, executor) .addCallback(new FutureCallback<Object>() { @Override - public void onSuccess(Object unused) { + public void onSuccess(Object _value) { foo.complete(); } @Override - public void onFailure(Throwable unused) { + public void onFailure(Throwable _throwable) { foo.complete(); } }, executor); diff --git a/tracing-jersey/src/test/java/com/palantir/tracing/jersey/TraceEnrichingFilterTest.java b/tracing-jersey/src/test/java/com/palantir/tracing/jersey/TraceEnrichingFilterTest.java index 104b84385..810d993c1 100644 --- a/tracing-jersey/src/test/java/com/palantir/tracing/jersey/TraceEnrichingFilterTest.java +++ b/tracing-jersey/src/test/java/com/palantir/tracing/jersey/TraceEnrichingFilterTest.java @@ -242,7 +242,7 @@ public void testFilter_setsMdcIfTraceIdHeaderIsNotePresent() throws Exception { public static class TracingTestServer extends Application<Configuration> { @Override - public final void run(Configuration unused, final Environment env) throws Exception { + public final void run(Configuration _value, final Environment env) throws Exception { env.jersey().register(new TraceEnrichingFilter()); env.jersey().register(new TracingTestResource()); } diff --git a/tracing-servlet/src/main/java/com/palantir/tracing/servlet/LeakedTraceFilter.java b/tracing-servlet/src/main/java/com/palantir/tracing/servlet/LeakedTraceFilter.java index 9cce3b204..c94b8f33b 100644 --- a/tracing-servlet/src/main/java/com/palantir/tracing/servlet/LeakedTraceFilter.java +++ b/tracing-servlet/src/main/java/com/palantir/tracing/servlet/LeakedTraceFilter.java @@ -42,7 +42,7 @@ public final class LeakedTraceFilter implements Filter { private static final Logger log = LoggerFactory.getLogger(LeakedTraceFilter.class); @Override - public void init(FilterConfig unused) { + public void init(FilterConfig _value) { // nop } diff --git a/tracing-servlet/src/test/java/com/palantir/tracing/servlet/LeakedTraceFilterTest.java b/tracing-servlet/src/test/java/com/palantir/tracing/servlet/LeakedTraceFilterTest.java index c128993a3..0d008fcda 100644 --- a/tracing-servlet/src/test/java/com/palantir/tracing/servlet/LeakedTraceFilterTest.java +++ b/tracing-servlet/src/test/java/com/palantir/tracing/servlet/LeakedTraceFilterTest.java @@ -93,10 +93,10 @@ public void testFilter_aroundLeakyOperation() { public static class TracingTestServer extends Application<Configuration> { @Override - public final void run(Configuration unusedConfig, final Environment env) { + public final void run(Configuration _config, final Environment env) { env.servlets().addFilter("previousRequestLeaked", new Filter() { @Override - public void init(FilterConfig unused) { } + public void init(FilterConfig _value) { } @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) @@ -115,7 +115,7 @@ public void destroy() { } // Register a filter to help us orchestrate test cases env.servlets().addFilter("testFilter", new Filter() { @Override - public void init(FilterConfig unused) {} + public void init(FilterConfig _value) {} @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) @@ -139,7 +139,7 @@ public void destroy() {} env.servlets().addServlet("alwaysLeaks", new HttpServlet() { @Override - protected void service(HttpServletRequest unused, HttpServletResponse resp) { + protected void service(HttpServletRequest _value, HttpServletResponse resp) { Tracer.fastStartSpan("leaky"); resp.addHeader("Leaky-Invoked", "true"); } @@ -147,7 +147,7 @@ protected void service(HttpServletRequest unused, HttpServletResponse resp) { env.servlets().addServlet("reportingServlet", new HttpServlet() { @Override - protected void service(HttpServletRequest unused, HttpServletResponse resp) { + protected void service(HttpServletRequest _value, HttpServletResponse resp) { resp.addHeader("Servlet-Has-Trace", Boolean.toString(Tracer.hasTraceId())); } }).addMapping("/standard", "/previous-request-leaked"); diff --git a/tracing-test-utils/src/test/java/com/palantir/tracing/TestTracingExtensionDemo.java b/tracing-test-utils/src/test/java/com/palantir/tracing/TestTracingExtensionDemo.java index 2fa1f734b..d68ff5434 100644 --- a/tracing-test-utils/src/test/java/com/palantir/tracing/TestTracingExtensionDemo.java +++ b/tracing-test-utils/src/test/java/com/palantir/tracing/TestTracingExtensionDemo.java @@ -67,7 +67,7 @@ void handles_trace_with_multiple_root_spans() throws InterruptedException { @ParameterizedTest(name = "foo {index} bar {arguments}") @ValueSource(ints = {1, 2, 3}) @TestTracing(snapshot = true) - void handles_trace_with_single_root_span(int unused) throws InterruptedException { + void handles_trace_with_single_root_span(int _value) throws InterruptedException { prod_code(); } diff --git a/tracing/src/main/java/com/palantir/tracing/AsyncSpanObserver.java b/tracing/src/main/java/com/palantir/tracing/AsyncSpanObserver.java index 19af6cc1e..3494170f5 100644 --- a/tracing/src/main/java/com/palantir/tracing/AsyncSpanObserver.java +++ b/tracing/src/main/java/com/palantir/tracing/AsyncSpanObserver.java @@ -64,7 +64,7 @@ public final void consume(final Span span) { Futures.addCallback(future, new FutureCallback<Span>() { @Override - public void onSuccess(Span unused) { + public void onSuccess(Span _value) { numInflights.decrementAndGet(); } diff --git a/tracing/src/main/java/com/palantir/tracing/Trace.java b/tracing/src/main/java/com/palantir/tracing/Trace.java index aac1cd2f5..53242ff8d 100644 --- a/tracing/src/main/java/com/palantir/tracing/Trace.java +++ b/tracing/src/main/java/com/palantir/tracing/Trace.java @@ -233,12 +233,12 @@ private Unsampled(String traceId) { } @Override - void fastStartSpan(String unusedOperation, String parentSpanId, SpanType unusedType) { + void fastStartSpan(String _operation, String parentSpanId, SpanType _type) { startSpan(Optional.of(parentSpanId)); } @Override - void fastStartSpan(String unusedOperation, SpanType unusedType) { + void fastStartSpan(String _operation, SpanType _type) { numberOfSpans++; } diff --git a/tracing/src/main/java/com/palantir/tracing/Tracer.java b/tracing/src/main/java/com/palantir/tracing/Tracer.java index 315f71d86..6fb2fab54 100644 --- a/tracing/src/main/java/com/palantir/tracing/Tracer.java +++ b/tracing/src/main/java/com/palantir/tracing/Tracer.java @@ -285,7 +285,7 @@ public CloseableSpan childSpan(String operationName, SpanType type) { } @Override - public DetachedSpan childDetachedSpan(String unusedOperation, SpanType unusedType) { + public DetachedSpan childDetachedSpan(String _operation, SpanType _type) { return this; }