Skip to content

Commit 0f5a543

Browse files
authored
fail build on warnings and fix existing issues (#157)
1 parent ce87dbf commit 0f5a543

File tree

5 files changed

+14
-15
lines changed

5 files changed

+14
-15
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ compileJava {
5757
dependsOn 'googleJavaFormat'
5858
options.encoding = 'UTF-8'
5959
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" << "-XepExcludedPaths:" +
60-
".*/generated-sources/.*"
60+
".*/generated-sources/.*" << "-Werror"
6161
}
6262

6363
license {
@@ -68,7 +68,7 @@ license {
6868
compileTestJava {
6969
options.encoding = 'UTF-8'
7070
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" << "-XepExcludedPaths:" +
71-
".*/generated-sources/.*"
71+
".*/generated-sources/.*" << "-Werror"
7272
}
7373

7474
if (JavaVersion.current().isJava8Compatible()) {

src/main/java/com/uber/cadence/converter/JsonDataConverter.java

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
package com.uber.cadence.converter;
1919

20+
import com.google.common.collect.ImmutableSet;
2021
import com.google.gson.Gson;
2122
import com.google.gson.GsonBuilder;
2223
import com.google.gson.JsonArray;
@@ -33,8 +34,6 @@
3334
import java.io.PrintWriter;
3435
import java.io.StringWriter;
3536
import java.nio.charset.StandardCharsets;
36-
import java.util.HashSet;
37-
import java.util.Set;
3837
import java.util.function.Function;
3938
import java.util.regex.Matcher;
4039
import java.util.regex.Pattern;
@@ -66,15 +65,10 @@ public final class JsonDataConverter implements DataConverter {
6665
* Stop emitting stack trace after this line. Makes serialized stack traces more readable and
6766
* compact as it omits most of framework level code.
6867
*/
69-
private static final Set<String> CUTOFF_METHOD_NAMES =
70-
new HashSet<String>() {
71-
{
72-
add(
73-
"com.uber.cadence.internal.worker.POJOActivityImplementationFactory$POJOActivityImplementation.execute");
74-
add(
75-
"com.uber.cadence.internal.sync.POJODecisionTaskHandler$POJOWorkflowImplementation.execute");
76-
}
77-
};
68+
private static final ImmutableSet<String> CUTOFF_METHOD_NAMES =
69+
ImmutableSet.of(
70+
"com.uber.cadence.internal.worker.POJOActivityImplementationFactory$POJOActivityImplementation.execute",
71+
"com.uber.cadence.internal.sync.POJODecisionTaskHandler$POJOWorkflowImplementation.execute");
7872

7973
private static final DataConverter INSTANCE = new JsonDataConverter();
8074
private static final byte[] EMPTY_BLOB = new byte[0];

src/main/java/com/uber/cadence/internal/worker/ActivityWorker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public void resumePolling() {
148148
}
149149
}
150150

151-
private class MeasurableActivityTask {
151+
private static class MeasurableActivityTask {
152152
PollForActivityTaskResponse task;
153153
Stopwatch sw;
154154

src/main/java/com/uber/cadence/serviceclient/WorkflowServiceTChannel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ public WorkflowServiceTChannel(String host, int port, ClientOptions options) {
322322
ArrayList<InetSocketAddress> peers = new ArrayList<>();
323323
peers.add(new InetSocketAddress(address, port));
324324
this.subChannel = tChannel.makeSubChannel(options.getServiceName()).setPeers(peers);
325-
log.info("Initialized TChannel: " + this.subChannel.toString());
325+
log.info("Initialized TChannel for service " + this.subChannel.getServiceName());
326326
} catch (UnknownHostException e) {
327327
tChannel.shutdown();
328328
throw new RuntimeException("Unable to get name of host " + host, e);

src/test/java/com/uber/cadence/internal/sync/Tracer.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,9 @@ public void setExpected(String... expected) {
7070
public void assertExpected() {
7171
Assert.assertEquals(expected, trace);
7272
}
73+
74+
@Override
75+
public String toString() {
76+
return "expected " + String.join(",", expected) + " trace " + String.join(",", trace);
77+
}
7378
}

0 commit comments

Comments
 (0)