Skip to content

Commit ba8c98f

Browse files
committed
Java 11 support
1 parent 31a9c39 commit ba8c98f

File tree

6 files changed

+16
-13
lines changed

6 files changed

+16
-13
lines changed

build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ java {
5151

5252
dependencies {
5353
errorproneJavac('com.google.errorprone:javac:9+181-r4173-1')
54-
errorprone('com.google.errorprone:error_prone_core:2.3.3')
54+
errorprone('com.google.errorprone:error_prone_core:2.3.4')
5555

5656
compile group: 'com.uber.tchannel', name: 'tchannel-core', version: '0.8.5'
5757
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
@@ -61,6 +61,7 @@ dependencies {
6161
compile group: 'com.google.guava', name: 'guava', version: '28.1-jre'
6262
compile group: 'com.cronutils', name: 'cron-utils', version: '9.0.0'
6363
compile group: 'io.micrometer', name: 'micrometer-core', version: '1.1.2'
64+
compile group: 'javax.annotation', name: 'javax.annotation-api', version: '1.3.2'
6465

6566
testCompile group: 'junit', name: 'junit', version: '4.12'
6667
testCompile group: 'com.googlecode.junit-toolbox', name: 'junit-toolbox', version: '2.4'

docker/buildkite/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
FROM openjdk:8-alpine
1+
FROM adoptopenjdk/openjdk11:alpine
22

33
# Apache Thrift version
44
ENV APACHE_THRIFT_VERSION=0.9.3
55

66
# Install dependencies using apk
77
RUN apk update && apk add --virtual wget ca-certificates wget && apk add --virtual build-dependencies build-base gcc
88
# Git is needed in order to update the dls submodule
9-
RUN apk add --virtual git
9+
RUN apk add git libstdc++
1010

1111
# Compile source
1212
RUN set -ex ;\
@@ -22,4 +22,4 @@ RUN set -ex ;\
2222
RUN apk del build-dependencies wget && rm -rf /var/cache/apk/*
2323

2424
RUN mkdir /cadence-java-client
25-
WORKDIR /cadence-java-client
25+
WORKDIR /cadence-java-client

src/main/java/com/uber/cadence/internal/sync/POJOActivityTaskHandler.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,13 @@ public Result handle(
189189
isLocalActivity);
190190
}
191191
if (metricsRateLimiter.tryAcquire(1)) {
192-
if (isLocalActivity) {
193-
metricsScope.gauge(MetricsType.LOCAL_ACTIVITY_ACTIVE_THREAD_COUNT).update(Thread.activeCount());
194-
} else {
195-
metricsScope.gauge(MetricsType.ACTIVITY_ACTIVE_THREAD_COUNT).update(Thread.activeCount());
196-
}
192+
if (isLocalActivity) {
193+
metricsScope
194+
.gauge(MetricsType.LOCAL_ACTIVITY_ACTIVE_THREAD_COUNT)
195+
.update(Thread.activeCount());
196+
} else {
197+
metricsScope.gauge(MetricsType.ACTIVITY_ACTIVE_THREAD_COUNT).update(Thread.activeCount());
198+
}
197199
}
198200
return activity.execute(activityTask, metricsScope);
199201
}

src/main/java/com/uber/cadence/internal/testservice/DecisionTaskToken.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ final class DecisionTaskToken {
3333

3434
DecisionTaskToken(ExecutionId executionId, int historySize) {
3535
this.executionId = Objects.requireNonNull(executionId);
36-
this.historySize = Objects.requireNonNull(historySize);
36+
this.historySize = historySize;
3737
}
3838

3939
ExecutionId getExecutionId() {

src/test/java/com/uber/cadence/converter/JsonDataConverterTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ public void testException() {
260260
assertNotNull(causeFromConverted);
261261
assertEquals(DataConverterException.class, causeFromConverted.getClass());
262262
assertNotNull(causeFromConverted.getCause());
263-
assertEquals(StackOverflowError.class, causeFromConverted.getCause().getClass());
263+
assertEquals(IllegalArgumentException.class, causeFromConverted.getCause().getClass());
264264

265265
assertNotNull(causeFromConverted.getSuppressed());
266266
assertEquals(1, causeFromConverted.getSuppressed().length);

src/test/java/com/uber/cadence/workflow/WorkflowTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@ public void testUntypedAsyncStartWithTimeout() throws Exception {
965965
WorkflowStub workflowStub =
966966
workflowClient.newUntypedWorkflowStub(
967967
"TestWorkflow1::execute", newWorkflowOptionsBuilder(taskList).build());
968-
Long timeout = new Long(200);
968+
Long timeout = Long.valueOf(200);
969969
CompletableFuture<WorkflowExecution> future =
970970
workflowStub.startAsyncWithTimeout(timeout, TimeUnit.MILLISECONDS, taskList);
971971
testUntypedAndStackTraceHelper(workflowStub, future.get());
@@ -3309,7 +3309,7 @@ public void testSignalWorkflowAsyncWithTimeout() throws Exception {
33093309
CompletableFuture<WorkflowExecution> future = workflowStub.startAsync(taskList);
33103310
future.get();
33113311

3312-
Long timeout = new Long(200);
3312+
Long timeout = Long.valueOf(200);
33133313
String testSignalInput = "hello";
33143314
CompletableFuture<String> resultFuture =
33153315
workflowStub

0 commit comments

Comments
 (0)