Skip to content

Commit c7ed80c

Browse files
authored
Fix errorprone and compiler warnings (#496)
* Fix errorprone and compiler warnings Signed-off-by: Tihomir Surdilovic <tihomir@temporal.io> * update - fail build on any issues Signed-off-by: Tihomir Surdilovic <tihomir@temporal.io> --------- Signed-off-by: Tihomir Surdilovic <tihomir@temporal.io>
1 parent 62fac2a commit c7ed80c

23 files changed

+77
-69
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,4 +142,5 @@ More info on each sample:
142142
- [**Hello**](/springboot/src/main/java/io/temporal/samples/springboot/hello): Invoke simple "Hello" workflow from a GET endpoint
143143
- [**SDK Metrics**](/springboot/src/main/java/io/temporal/samples/springboot/metrics): Learn how to set up SDK Metrics
144144
- [**Synchronous Update**](/springboot/src/main/java/io/temporal/samples/springboot/update): Learn how to use Synchronous Update feature with this purchase sample
145-
145+
- [**Kafka Request / Reply**](/springboot/src/main/java/io/temporal/samples/springboot/kafka): Sample showing possible integration with event streaming platforms such as Kafka
146+

build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ subprojects {
1515
sourceCompatibility = JavaVersion.VERSION_1_8
1616
targetCompatibility = JavaVersion.VERSION_1_8
1717
}
18+
19+
compileJava {
20+
options.compilerArgs << "-Werror"
21+
}
22+
1823
ext {
1924
otelVersion = '1.27.0'
2025
otelVersionAlpha = "${otelVersion}-alpha"

core/build.gradle

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,7 @@ dependencies {
4646

4747
dependencies {
4848
errorproneJavac('com.google.errorprone:javac:9+181-r4173-1')
49-
if (JavaVersion.current().isJava11Compatible()) {
50-
errorprone('com.google.errorprone:error_prone_core:2.20.0')
51-
} else {
52-
errorprone('com.google.errorprone:error_prone_core:2.20.0')
53-
}
49+
errorprone('com.google.errorprone:error_prone_core:2.20.0')
5450
}
5551
}
5652

core/src/main/java/io/temporal/samples/hello/HelloActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public static void main(String[] args) {
150150
*/
151151
worker.registerWorkflowImplementationTypes(GreetingWorkflowImpl.class);
152152

153-
/**
153+
/*
154154
* Register our Activity Types with the Worker. Since Activities are stateless and thread-safe,
155155
* the Activity Type is a shared instance.
156156
*/

core/src/main/java/io/temporal/samples/hello/HelloActivityExclusiveChoice.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public interface OrderFruitsActivities {
107107
// Define the workflow implementation. It implements our orderFruit workflow method
108108
public static class PurchaseFruitsWorkflowImpl implements PurchaseFruitsWorkflow {
109109

110-
/**
110+
/*
111111
* Define the OrderActivities stub. Activity stubs implements activity interfaces and proxy
112112
* calls to it to Temporal activity invocations. Since Temporal activities are reentrant, a
113113
* single activity stub can be used for multiple activity invocations.
@@ -208,7 +208,7 @@ public static void main(String[] args) {
208208
*/
209209
worker.registerWorkflowImplementationTypes(PurchaseFruitsWorkflowImpl.class);
210210

211-
/**
211+
/*
212212
* Register our Activity Types with the Worker. Since Activities are stateless and thread-safe,
213213
* the Activity Type is a shared instance.
214214
*/

core/src/main/java/io/temporal/samples/hello/HelloActivityRetry.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public static void main(String[] args) {
185185
*/
186186
worker.registerWorkflowImplementationTypes(GreetingWorkflowImpl.class);
187187

188-
/**
188+
/*
189189
* Register our Activity Types with the Worker. Since Activities are stateless and thread-safe,
190190
* the Activity Type is a shared instance.
191191
*/

core/src/main/java/io/temporal/samples/hello/HelloAsync.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public interface GreetingActivities {
8383
// Define the workflow implementation which implements our getGreeting workflow method.
8484
public static class GreetingWorkflowImpl implements GreetingWorkflow {
8585

86-
/**
86+
/*
8787
* Define the GreetingActivities stub. Activity stubs are proxies for activity invocations that
8888
* are executed outside of the workflow thread on the activity worker, that can be on a
8989
* different host. Temporal is going to dispatch the activity results back to the workflow and
@@ -155,7 +155,7 @@ public static void main(String[] args) {
155155
*/
156156
worker.registerWorkflowImplementationTypes(GreetingWorkflowImpl.class);
157157

158-
/**
158+
/*
159159
* Register our Activity Types with the Worker. Since Activities are stateless and thread-safe,
160160
* the Activity Type is a shared instance.
161161
*/

core/src/main/java/io/temporal/samples/hello/HelloAsyncActivityCompletion.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public interface GreetingActivities {
8484
// Define the workflow implementation which implements the getGreeting workflow method.
8585
public static class GreetingWorkflowImpl implements GreetingWorkflow {
8686

87-
/**
87+
/*
8888
* Define the GreetingActivities stub. Activity stubs are proxies for activity invocations that
8989
* are executed outside of the workflow thread on the activity worker, that can be on a
9090
* different host. Temporal is going to dispatch the activity results back to the workflow and
@@ -112,7 +112,7 @@ public String getGreeting(String name) {
112112
*/
113113
static class GreetingActivitiesImpl implements GreetingActivities {
114114

115-
/**
115+
/*
116116
* ActivityCompletionClient is used to asynchronously complete activities. In this example we
117117
* will use this client alongside with {@link
118118
* io.temporal.activity.ActivityExecutionContext#doNotCompleteOnReturn()} which means our
@@ -134,7 +134,7 @@ public String composeGreeting(String greeting, String name) {
134134
// Set a correlation token that can be used to complete the activity asynchronously
135135
byte[] taskToken = context.getTaskToken();
136136

137-
/**
137+
/*
138138
* For the example we will use a {@link java.util.concurrent.ForkJoinPool} to execute our
139139
* activity. In real-life applications this could be any service. The composeGreetingAsync
140140
* method is the one that will actually complete workflow action execution.
@@ -165,37 +165,37 @@ public static void main(String[] args) throws ExecutionException, InterruptedExc
165165
// Get a Workflow service stub.
166166
WorkflowServiceStubs service = WorkflowServiceStubs.newLocalServiceStubs();
167167

168-
/**
168+
/*
169169
* Get a Workflow service client which can be used to start, Signal, and Query Workflow
170170
* Executions.
171171
*/
172172
WorkflowClient client = WorkflowClient.newInstance(service);
173173

174-
/**
174+
/*
175175
* Define the workflow factory. It is used to create workflow workers for a specific task queue.
176176
*/
177177
WorkerFactory factory = WorkerFactory.newInstance(client);
178178

179-
/**
179+
/*
180180
* Define the workflow worker. Workflow workers listen to a defined task queue and process
181181
* workflows and activities.
182182
*/
183183
Worker worker = factory.newWorker(TASK_QUEUE);
184184

185-
/**
185+
/*
186186
* Register our Workflow Types with the Worker. Workflow Types must be known to the Worker at
187187
* runtime in order for it to poll for Workflow Tasks.
188188
*/
189189
worker.registerWorkflowImplementationTypes(GreetingWorkflowImpl.class);
190190

191-
/**
191+
/*
192192
* Register our Activity Types with the Worker. Since Activities are stateless and thread-safe,
193193
* the Activity Type is a shared instance.
194194
*/
195195
ActivityCompletionClient completionClient = client.newActivityCompletionClient();
196196
worker.registerActivitiesImplementations(new GreetingActivitiesImpl(completionClient));
197197

198-
/**
198+
/*
199199
* Start all the Workers registered for a specific Task Queue. The Workers then start polling
200200
* for Workflow Tasks and Activity Tasks.
201201
*/
@@ -210,7 +210,7 @@ public static void main(String[] args) throws ExecutionException, InterruptedExc
210210
.setTaskQueue(TASK_QUEUE)
211211
.build());
212212

213-
/**
213+
/*
214214
* Here we use {@link io.temporal.client.WorkflowClient} to execute our workflow asynchronously.
215215
* It gives us back a {@link java.util.concurrent.CompletableFuture}. We can then call its get
216216
* method to block and wait until a result is available.

core/src/main/java/io/temporal/samples/hello/HelloAsyncLambda.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public interface GreetingActivities {
8383
// Define the workflow implementation which implements our getGreeting workflow method.
8484
public static class GreetingWorkflowImpl implements GreetingWorkflow {
8585

86-
/**
86+
/*
8787
* Define the GreetingActivities stub. Activity stubs are proxies for activity invocations that
8888
* are executed outside of the workflow thread on the activity worker, that can be on a
8989
* different host. Temporal is going to dispatch the activity results back to the workflow and
@@ -173,7 +173,7 @@ public static void main(String[] args) {
173173
*/
174174
worker.registerWorkflowImplementationTypes(GreetingWorkflowImpl.class);
175175

176-
/**
176+
/*
177177
* Register our Activity Types with the Worker. Since Activities are stateless and thread-safe,
178178
* the Activity Type is a shared instance.
179179
*/

core/src/main/java/io/temporal/samples/hello/HelloDetachedCancellationScope.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,36 +153,36 @@ public static void main(String[] args) throws InterruptedException {
153153
// Get a Workflow service stub.
154154
WorkflowServiceStubs service = WorkflowServiceStubs.newLocalServiceStubs();
155155

156-
/**
156+
/*
157157
* Get a Workflow service client which can be used to start, Signal, and Query Workflow
158158
* Executions.
159159
*/
160160
WorkflowClient client = WorkflowClient.newInstance(service);
161161

162-
/**
162+
/*
163163
* Define the workflow factory. It is used to create workflow workers for a specific task queue.
164164
*/
165165
WorkerFactory factory = WorkerFactory.newInstance(client);
166166

167-
/**
167+
/*
168168
* Define the workflow worker. Workflow workers listen to a defined task queue and process
169169
* workflows and activities.
170170
*/
171171
Worker worker = factory.newWorker(TASK_QUEUE);
172172

173-
/**
173+
/*
174174
* Register our Workflow Types with the Worker. Workflow Types must be known to the Worker at
175175
* runtime.
176176
*/
177177
worker.registerWorkflowImplementationTypes(GreetingWorkflowImpl.class);
178178

179-
/**
179+
/*
180180
* Register our Activity Types with the Worker. Since Activities are stateless and thread-safe,
181181
* the Activity Type is a shared instance.
182182
*/
183183
worker.registerActivitiesImplementations(new GreetingActivitiesImpl());
184184

185-
/**
185+
/*
186186
* Start all the Workers that are in this process. The Workers will then start polling for
187187
* Workflow Tasks and Activity Tasks.
188188
*/

0 commit comments

Comments
 (0)