Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Commit

Permalink
Update errorprone and lombok and fix warnings and errors (#270)
Browse files Browse the repository at this point in the history
* Update errorprone and lombok plugin

Signed-off-by: Prithvi Raj <p.r@uber.com>

* Update errorprone and lombok and fix warnings and errors

- Update errorprone to 2.1.1
- Update lombok to 1.16.18
- Disable the InstanceOfAndCastMatchWrongType and NestedInstanceOfConditions checks to ensure compatibility with lombok. See google/error-prone#750

Signed-off-by: Prithvi Raj <p.r@uber.com>

* Remove unused import

Signed-off-by: Prithvi Raj <p.r@uber.com>
  • Loading branch information
vprithvi authored and yurishkuro committed Oct 18, 2017
1 parent 20573d0 commit bcd32cb
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 7 deletions.
10 changes: 7 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
id "com.github.hierynomus.license" version "0.14.0"
id 'com.github.sherter.google-java-format' version '0.3.2'
id "com.github.johnrengelman.shadow" version "2.0.1"
id "net.ltgt.errorprone" version "0.0.10"
id "net.ltgt.errorprone" version "0.0.12"
id 'ru.vyarus.animalsniffer' version '1.3.0'
id 'io.codearte.nexus-staging' version '0.11.0'
}
Expand Down Expand Up @@ -126,7 +126,7 @@ subprojects {
}

dependencies {
compileOnly 'org.projectlombok:lombok:1.16.12'
compileOnly 'org.projectlombok:lombok:1.16.18'
compileOnly 'org.codehaus.mojo:animal-sniffer-annotations:1.15'
}

Expand Down Expand Up @@ -165,8 +165,12 @@ task printVersion {
configure(subprojects.findAll {it.name != 'jaeger-thrift'}) {
apply plugin: 'net.ltgt.errorprone'
dependencies {
errorprone 'com.google.errorprone:error_prone_core:2.0.15'
errorprone 'com.google.errorprone:error_prone_core:2.1.1'
}
tasks.withType(JavaCompile) {
// These are disabled because of a bug with errorprone. See https://github.com/google/error-prone/issues/750
options.compilerArgs += [ '-Xep:NestedInstanceOfConditions:OFF', '-Xep:InstanceOfAndCastMatchWrongType:OFF' ]
}
}

def getVersionForBuild() {
Expand Down
2 changes: 1 addition & 1 deletion jaeger-core/src/main/java/com/uber/jaeger/Tracer.java
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ private SpanContext createNewContext(String debugId) {

byte flags = 0;
if (debugId != null) {
flags |= SpanContext.flagSampled | SpanContext.flagDebug;
flags = (byte) (flags | SpanContext.flagSampled | SpanContext.flagDebug);
tags.put(Constants.DEBUG_ID_HEADER_KEY, debugId);
metrics.traceStartedSampled.inc(1);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

import com.uber.jaeger.Constants;
import java.util.Map;

import org.junit.After;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand All @@ -30,6 +32,7 @@ public class GuaranteedThroughputSamplerTest {

private GuaranteedThroughputSampler undertest;

@After
public void tearDown() {
undertest.close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.ExecutionException;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import org.apache.log4j.BasicConfigurator;
Expand Down Expand Up @@ -117,8 +118,8 @@ protected void configure() {
.register(JacksonFeature.class);
}

public void shutdown() {
server.shutdown();
public void shutdown() throws ExecutionException, InterruptedException {
server.shutdown().get();
}

public Tracer getTracer() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.uber.jaeger.crossdock.resources.behavior.TraceBehavior;
import com.uber.tchannel.api.TChannel;
import com.uber.tchannel.tracing.TracingContext;
import io.netty.channel.ChannelFuture;
import io.opentracing.Span;
import io.opentracing.Tracer;
import java.util.EmptyStackException;
Expand Down Expand Up @@ -45,7 +46,10 @@ public TChannel getChannel() {

public void start() throws InterruptedException {
// listen for incoming connections
server.listen().channel().closeFuture();
ChannelFuture serverFuture = server.listen().awaitUninterruptibly();
if (!serverFuture.isSuccess()) {
throw new RuntimeException("Server future unsuccessful");
}
}

public void shutdown() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ protected Application configure() {
return resourceConfig;
}

@Override
@After
public void tearDown() throws Exception {
super.tearDown();
Expand Down

0 comments on commit bcd32cb

Please sign in to comment.