Skip to content

Commit 229dd2c

Browse files
authored
Java 11 support (#609)
Make client to be Java 11 compatible. Use Java 11 to compile Java 8 code and release Java 8 bytecode to prepare for future migartion.
1 parent a49f141 commit 229dd2c

File tree

6 files changed

+10
-9
lines changed

6 files changed

+10
-9
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This doc is intended for contributors to `cadence-java-client` (hopefully that's
66

77
## Development Environment
88

9-
* Java 8.
9+
* Java 11 (currently, we use Java 11 to compile Java 8 code).
1010
* Thrift 0.9.3
1111
* Gradle build tool
1212
* Docker

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/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
@@ -972,7 +972,7 @@ public void testUntypedAsyncStartWithTimeout() throws Exception {
972972
WorkflowStub workflowStub =
973973
workflowClient.newUntypedWorkflowStub(
974974
"TestWorkflow1::execute", newWorkflowOptionsBuilder(taskList).build());
975-
Long timeout = new Long(200);
975+
Long timeout = Long.valueOf(200);
976976
CompletableFuture<WorkflowExecution> future =
977977
workflowStub.startAsyncWithTimeout(timeout, TimeUnit.MILLISECONDS, taskList);
978978
testUntypedAndStackTraceHelper(workflowStub, future.get());
@@ -3386,7 +3386,7 @@ public void testSignalWorkflowAsyncWithTimeout() throws Exception {
33863386
CompletableFuture<WorkflowExecution> future = workflowStub.startAsync(taskList);
33873387
future.get();
33883388

3389-
Long timeout = new Long(200);
3389+
Long timeout = Long.valueOf(200);
33903390
String testSignalInput = "hello";
33913391
CompletableFuture<String> resultFuture =
33923392
workflowStub

0 commit comments

Comments
 (0)