Skip to content

Commit

Permalink
Excavator: Upgrades Baseline to the latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
svc-excavator-bot committed Sep 25, 2019
1 parent b7eaf6e commit 47d114b
Show file tree
Hide file tree
Showing 23 changed files with 51 additions and 48 deletions.
1 change: 1 addition & 0 deletions .baseline/spotless/eclipse.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="80"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_string_concatenation" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ buildscript {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'com.netflix.nebula:gradle-dependency-lock-plugin:7.0.1'
classpath 'com.netflix.nebula:nebula-publishing-plugin:13.6.1'
classpath 'com.palantir.baseline:gradle-baseline-java:2.7.0'
classpath 'com.palantir.baseline:gradle-baseline-java:2.11.2'
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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Socket wrap(Socket socket) throws SocketException {
return socket;
}

@Override
public String toString() {
return "KeepAliveSslSocketFactory{delegate=" + delegate + '}';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public enum NeverRetryingBackoffStrategy implements BackoffStrategy {
INSTANCE;

@Override
public boolean backoff(int numFailedAttempts) {
public boolean backoff(int _numFailedAttempts) {
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public PathTemplateHeaderEnrichmentContract(Contract delegate) {
}

@Override
protected void processMetadata(Class<?> targetType, Method method, MethodMetadata metadata) {
protected void processMetadata(Class<?> _targetType, Method _method, MethodMetadata metadata) {
metadata.template()
.header(OkhttpTraceInterceptor.PATH_TEMPLATE_HEADER,
metadata.template().method() + " "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public enum PathTemplateHeaderRewriter implements RequestInterceptor {
INSTANCE;

@Override
public void apply(RequestTemplate template) {
public void apply(RequestTemplate _template) {
// nop
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public SlashEncodingContract(Contract delegate) {
}

@Override
protected void processMetadata(Class<?> targetType, Method method, MethodMetadata metadata) {
protected void processMetadata(Class<?> _targetType, Method _method, MethodMetadata metadata) {
metadata.template().decodeSlash(false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ public void testAuthenticatedProxy() throws Exception {
private static ProxySelector createProxySelector(String host, int port) {
return new ProxySelector() {
@Override
public List<Proxy> select(URI uri) {
public List<Proxy> select(URI _uri) {
InetSocketAddress addr = new InetSocketAddress(host, port);
return ImmutableList.of(new Proxy(Proxy.Type.HTTP, addr));
}

@Override
public void connectFailed(URI uri, SocketAddress sa, IOException ioe) {}
public void connectFailed(URI _uri, SocketAddress _sa, IOException _ioe) {}
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,12 @@ private void runTwoRequestsInParallel() {
ExecutorService executor = Executors.newFixedThreadPool(2);
CompletableFuture<?> first = CompletableFuture.runAsync(() -> {
Tracer.initTrace(Optional.of(true), "first");
OpenSpan ignored = Tracer.startSpan("");
Tracer.startSpan("");
service.string();
}, executor);
CompletableFuture<?> second = CompletableFuture.runAsync(() -> {
Tracer.initTrace(Optional.of(true), "second");
OpenSpan ignored = Tracer.startSpan("");
Tracer.startSpan("");
service.string();
}, executor);
first.join();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

public class GuavaTestServer extends Application<Configuration> {
@Override
public final void run(Configuration config, final Environment env) throws Exception {
public final void run(Configuration _config, final Environment env) throws Exception {
env.jersey().register(ConjureJerseyFeature.INSTANCE);
env.jersey().register(new JacksonMessageBodyProvider(ObjectMappers.newServerObjectMapper()));
env.jersey().register(new TestResource());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

public class Java8TestServer extends Application<Configuration> {
@Override
public final void run(Configuration config, final Environment env) throws Exception {
public final void run(Configuration _config, final Environment env) throws Exception {
env.jersey().register(ConjureJerseyFeature.INSTANCE);
env.jersey().register(new JacksonMessageBodyProvider(ObjectMappers.newServerObjectMapper()));
env.jersey().register(new EmptyOptionalTo204ExceptionMapper());
Expand All @@ -61,7 +61,7 @@ public final void run(Configuration config, final Environment env) throws Except
@Provider
private static final class EmptyOptionalTo204ExceptionMapper implements ExceptionMapper<EmptyOptionalException> {
@Override
public Response toResponse(EmptyOptionalException exception) {
public Response toResponse(EmptyOptionalException _exception) {
return Response.noContent().build();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void initialize(Bootstrap<ServiceConfigTestAppConfig> bootstrap) {
}

@Override
public void run(ServiceConfigTestAppConfig configuration, Environment environment) throws Exception {
public void run(ServiceConfigTestAppConfig _configuration, Environment environment) throws Exception {
environment.jersey().register(new Resource());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public interface Service {

public static class Server extends Application<Configuration> {
@Override
public final void run(Configuration config, final Environment env) throws Exception {
public final void run(Configuration _config, final Environment env) throws Exception {
env.jersey().register(resource);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ final class AsyncSerializableErrorCallAdapterFactory extends CallAdapter.Factory
private AsyncSerializableErrorCallAdapterFactory() {}

@Override
public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) {
public CallAdapter<?, ?> get(Type returnType, Annotation[] _annotations, Retrofit _retrofit) {
Type outerType = getRawType(returnType);
if (outerType != CompletableFuture.class && outerType != ListenableFuture.class) {
return null;
Expand Down Expand Up @@ -91,15 +91,15 @@ public boolean cancel(boolean mayInterruptIfRunning) {
}

@Override
public void onResponse(Call<R> call, Response<R> response) {
public void onResponse(Call<R> _call, Response<R> response) {
boolean futureWasCancelled = !set(response.body());
if (futureWasCancelled) {
close(response);
}
}

@Override
public void onFailure(Call<R> call, Throwable throwable) {
public void onFailure(Call<R> _call, Throwable throwable) {
// TODO(rfink): Would be good to not leak okhttp internals here
if (throwable instanceof IoRemoteException) {
setException(((IoRemoteException) throwable).getWrappedException());
Expand Down Expand Up @@ -157,15 +157,15 @@ public boolean cancel(boolean mayInterruptIfRunning) {

call.enqueue(new Callback<R>() {
@Override
public void onResponse(Call<R> call, Response<R> response) {
public void onResponse(Call<R> _call, Response<R> response) {
boolean futureWasCancelled = !future.complete(response.body());
if (futureWasCancelled) {
close(response);
}
}

@Override
public void onFailure(Call<R> call, Throwable throwable) {
public void onFailure(Call<R> _call, Throwable throwable) {
// TODO(rfink): Would be good to not leak okhttp internals here
if (throwable instanceof IoRemoteException) {
future.completeExceptionally(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public final class OptionalObjectToStringConverterFactory extends Converter.Fact
private OptionalObjectToStringConverterFactory() {}

@Override
public Converter<?, String> stringConverter(Type type, Annotation[] annotations, Retrofit retrofit) {
public Converter<?, String> stringConverter(Type type, Annotation[] annotations, Retrofit _retrofit) {
Optional<?> pathQueryAnnotation = ImmutableList.copyOf(annotations)
.stream()
.map(Annotation::annotationType)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,12 +399,12 @@ public void async_retrofit_call_should_throw_RemoteException_for_server_serializ
retrofit2.Call<String> call = service.getRelative();
call.enqueue(new retrofit2.Callback<String>() {
@Override
public void onResponse(Call<String> call, Response<String> response) {
public void onResponse(Call<String> _call, Response<String> _response) {
failBecauseExceptionWasNotThrown(RemoteException.class);
}

@Override
public void onFailure(Call<String> call, Throwable throwable) {
public void onFailure(Call<String> _call, Throwable throwable) {
assertThat(throwable).isInstanceOf(RemoteException.class);
assertThat(((RemoteException) throwable).getError()).isEqualTo(ERROR);
assertionsPassed.countDown(); // if you delete this countdown latch then this test will vacuously pass.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,12 @@ public void testQosError_performsFailover_forAsynchronousOperation(
CompletableFuture<String> future = new CompletableFuture<>();
proxy.get().enqueue(new Callback<String>() {
@Override
public void onResponse(Call<String> call, Response<String> response) {
public void onResponse(Call<String> _call, Response<String> response) {
future.complete(response.body());
}

@Override
public void onFailure(Call<String> call, Throwable throwable) {
public void onFailure(Call<String> _call, Throwable throwable) {
future.completeExceptionally(throwable);
}
});
Expand Down Expand Up @@ -215,12 +215,12 @@ public void testQosError_performsRetryWithOneNode_forAsynchronousOperation() thr
CompletableFuture<String> future = new CompletableFuture<>();
anotherProxy.get().enqueue(new Callback<String>() {
@Override
public void onResponse(Call<String> call, Response<String> response) {
public void onResponse(Call<String> _call, Response<String> response) {
future.complete(response.body());
}

@Override
public void onFailure(Call<String> call, Throwable throwable) {
public void onFailure(Call<String> _call, Throwable throwable) {
future.completeExceptionally(throwable);
}
});
Expand All @@ -247,12 +247,12 @@ public void testQosError_performsRetryWithOneNodeAndCache_forAsynchronousOperati
CompletableFuture<String> future = new CompletableFuture<>();
anotherProxy.get().enqueue(new Callback<String>() {
@Override
public void onResponse(Call<String> call, Response<String> response) {
public void onResponse(Call<String> _call, Response<String> response) {
future.complete(response.body());
}

@Override
public void onFailure(Call<String> call, Throwable throwable) {
public void onFailure(Call<String> _call, Throwable throwable) {
future.completeExceptionally(throwable);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ public void testAuthenticatedProxy() throws Exception {
private static ProxySelector createProxySelector(String host, int port) {
return new ProxySelector() {
@Override
public List<Proxy> select(URI uri) {
public List<Proxy> select(URI _uri) {
InetSocketAddress addr = new InetSocketAddress(host, port);
return ImmutableList.of(new Proxy(Proxy.Type.HTTP, addr));
}

@Override
public void connectFailed(URI uri, SocketAddress sa, IOException ioe) {}
public void connectFailed(URI _uri, SocketAddress _sa, IOException _ioe) {}
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@RunWith(Parameterized.class)
public class AutoDeserializeTest {
private static final Logger log = LoggerFactory.getLogger(AutoDeserializeTest.class);
static {
LoggerFactory.getLogger(AutoDeserializeTest.class);
}

@ClassRule
public static final DropwizardAppRule<Configuration> serverUnderTestRule = new DropwizardAppRule<>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void initialize(Bootstrap<Configuration> bootstrap) {
}

@Override
public void run(Configuration configuration, Environment environment) {
public void run(Configuration _configuration, Environment environment) {
environment.jersey()
.register(
Reflection.newProxy(AutoDeserializeService.class, new EchoResourceInvocationHandler()));
Expand All @@ -59,7 +59,7 @@ public void run(Configuration configuration, Environment environment) {
*/
static class EchoResourceInvocationHandler extends AbstractInvocationHandler {
@Override
protected Object handleInvocation(Object proxy, Method method, Object[] args) {
protected Object handleInvocation(Object _proxy, Method method, Object[] args) {
Preconditions.checkArgument(args.length == 1, "Expected single argument. Method: %s", method);
return args[0];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public final class Pkcs1ReadersTests {
public void testReadPrivateKeyFailsIfNoProvidersPresent() throws IOException {
Assume.assumeFalse(ServiceLoader.load(Pkcs1Reader.class).iterator().hasNext());

assertThatThrownBy(() -> Pkcs1Readers.getInstance())
assertThatThrownBy(Pkcs1Readers::getInstance)
.isInstanceOf(IllegalStateException.class)
.hasMessageContaining("No Pkcs1Reader services were present");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void canUnregister() {
String track = UUID.randomUUID().toString();
leakDetector.register(track, Optional.empty());
leakDetector.unregister(track);
track = null;

System.gc();
leakDetector.register("trigger", Optional.empty());
assertThat(leaks).isEmpty();
Expand Down
Loading

0 comments on commit 47d114b

Please sign in to comment.