Skip to content

Commit 7dd8476

Browse files
authored
Fix all javadoc warnings (#410)
1 parent 5b28096 commit 7dd8476

File tree

9 files changed

+49
-53
lines changed

9 files changed

+49
-53
lines changed

src/main/java/com/uber/cadence/client/ActivityWorkerShutdownException.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
package com.uber.cadence.client;
1919

2020
import com.uber.cadence.activity.ActivityTask;
21-
import com.uber.cadence.worker.Worker;
2221
import java.util.concurrent.TimeUnit;
2322

2423
/**
25-
* Indicates that {@link Worker.Factory#shutdown()} or {@link Worker.Factory#shutdownNow()} was
26-
* called. It is OK to ignore the exception to let activity to complete. It assumes that {@link
24+
* Indicates that {@link com.uber.cadence.worker.Worker.Factory#shutdown()} or {@link
25+
* com.uber.cadence.worker.Worker.Factory#shutdownNow()} was called. It is OK to ignore the
26+
* exception to let activity to complete. It assumes that {@link
2727
* com.uber.cadence.worker.Worker.Factory#awaitTermination(long, TimeUnit)} is called with a timeout
2828
* larger than the activity execution time.
2929
*/

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
/**
3838
* Implements conversion through GSON JSON processor. To extend use {@link
39-
* JsonDataConverter(Function)} constructor. Thrift structures are converted using {@link
39+
* #JsonDataConverter(Function)} constructor. Thrift structures are converted using {@link
4040
* TJSONProtocol}. When using thrift only one argument of a method is expected.
4141
*
4242
* @author fateev

src/main/java/com/uber/cadence/internal/common/WorkflowExecutionUtils.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ private void getNextPage() {
643643
*
644644
* @param showWorkflowTasks when set to false workflow task events (decider events) are not
645645
* included
646-
* @history Workflow instance history
646+
* @param history Workflow instance history
647647
*/
648648
public static String prettyPrintHistory(History history, boolean showWorkflowTasks) {
649649
return prettyPrintHistory(history.getEvents().iterator(), showWorkflowTasks);

src/main/java/com/uber/cadence/testing/TestWorkflowEnvironment.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ Worker newWorker(
169169
*/
170170
String getDiagnostics();
171171

172-
/** Calls {@link #shutdownNow()} and {@link#awaitTermination(long, TimeUnit)}. */
172+
/** Calls {@link #shutdownNow()} and {@link #awaitTermination(long, TimeUnit)}. */
173173
void close();
174174

175175
Worker.Factory getWorkerFactory();

src/main/java/com/uber/cadence/workflow/CancellationScope.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public interface CancellationScope extends Runnable {
5050
/**
5151
* Is scope was asked to cancel through {@link #cancel()} or by a parent scope.
5252
*
53-
* @return
53+
* @return whether request is cancelled or not.
5454
*/
5555
boolean isCancelRequested();
5656

src/main/java/com/uber/cadence/workflow/CompletablePromise.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public interface CompletablePromise<V> extends Promise<V> {
5656
* </code></pre>
5757
*
5858
* @param source promise that is being watched.
59-
* @return
59+
* @return false if source already completed, otherwise return true or null
6060
*/
6161
boolean completeFrom(Promise<V> source);
6262
}

src/main/java/com/uber/cadence/workflow/Promise.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
package com.uber.cadence.workflow;
1919

2020
import com.uber.cadence.internal.sync.WorkflowInternal;
21-
import com.uber.cadence.workflow.Functions.Func2;
2221
import java.util.Collection;
2322
import java.util.List;
2423
import java.util.concurrent.TimeUnit;
@@ -40,8 +39,8 @@
4039
* <li>Promise doesn't directly supports cancellation. Use {@link CancellationScope} to cancel and
4140
* handle cancellations. The pattern is that a cancelled operation completes its Promise with
4241
* {@link java.util.concurrent.CancellationException} when cancelled.
43-
* <li>{@link #handle(Func2)} and similar callback operations do not allow blocking calls inside
44-
* functions
42+
* <li>{@link #handle(Functions.Func2)} and similar callback operations do not allow blocking
43+
* calls inside functions
4544
* </ul>
4645
*/
4746
public interface Promise<V> {

src/main/java/com/uber/cadence/workflow/Saga.java

-3
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@ public <A1, A2> void addCompensation(Functions.Func2<A1, A2, ?> operation, A1 ar
267267
* Add compensation operation for saga.
268268
*
269269
* @param operation to be executed during compensation.
270-
* @param operation to be executed during compensation.
271270
* @param arg1 first operation function parameter
272271
* @param arg2 second operation function parameter
273272
* @param arg3 third operation function parameter
@@ -281,7 +280,6 @@ public <A1, A2, A3> void addCompensation(
281280
* Add compensation operation for saga.
282281
*
283282
* @param operation to be executed during compensation.
284-
* @param operation to be executed during compensation.
285283
* @param arg1 first operation function parameter
286284
* @param arg2 second operation function parameter
287285
* @param arg3 third operation function parameter
@@ -296,7 +294,6 @@ public <A1, A2, A3, A4> void addCompensation(
296294
* Add compensation operation for saga.
297295
*
298296
* @param operation to be executed during compensation.
299-
* @param operation to be executed during compensation.
300297
* @param arg1 first operation function parameter
301298
* @param arg2 second operation function parameter
302299
* @param arg3 third operation function parameter

src/main/java/com/uber/cadence/workflow/Workflow.java

+39-39
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424
import com.uber.cadence.internal.sync.WorkflowInternal;
2525
import com.uber.cadence.worker.WorkerOptions;
2626
import com.uber.cadence.workflow.Functions.Func;
27-
import com.uber.cadence.workflow.Functions.Func1;
28-
import com.uber.cadence.workflow.Functions.Func2;
29-
import com.uber.cadence.workflow.Functions.Proc;
3027
import com.uber.m3.tally.Scope;
3128
import java.lang.reflect.Type;
3229
import java.time.Duration;
@@ -156,18 +153,18 @@
156153
* methods allow you to invoke any activity asynchronously. The call returns a {@link Promise}
157154
* result immediately. {@link Promise} is similar to both {@link java.util.concurrent.Future} and
158155
* {@link java.util.concurrent.CompletionStage}. The {@link Promise#get()} blocks until a result is
159-
* available. It also exposes the {@link Promise#thenApply(Func1)} and {@link Promise#handle(Func2)}
160-
* methods. See the {@link Promise} documentation for technical details about differences with
161-
* {@link java.util.concurrent.Future}.
156+
* available. It also exposes the {@link Promise#thenApply(Functions.Func1)} and {@link
157+
* Promise#handle(Functions.Func2)} methods. See the {@link Promise} documentation for technical
158+
* details about differences with {@link java.util.concurrent.Future}.
162159
*
163160
* <p>To convert a synchronous call
164161
*
165162
* <pre><code>
166163
* String localName = activities.download(sourceBucket, sourceFile);
167164
* </code></pre>
168165
*
169-
* to asynchronous style, the method reference is passed to {@link Async#function(Func)} or {@link
170-
* Async#procedure(Proc)} followed by activity arguments:
166+
* to asynchronous style, the method reference is passed to {@link Async#function(Functions.Func)}
167+
* or {@link Async#procedure(Functions.Proc)} followed by activity arguments:
171168
*
172169
* <pre><code>
173170
* Promise<String> localNamePromise = Async.function(activities::download, sourceBucket, sourceFile);
@@ -243,13 +240,14 @@
243240
*
244241
* <p>The first call to the child workflow stub must always be to a method annotated with
245242
* {@literal @}{@link WorkflowMethod}. Similarly to activities, a call can be synchronous or
246-
* asynchronous using {@link Async#function(Func)} or {@link Async#procedure(Proc)}. The synchronous
247-
* call blocks until a child workflow completes. The asynchronous call returns a {@link Promise}
248-
* that can be used to wait for the completion. After an async call returns the stub, it can be used
249-
* to send signals to the child by calling methods annotated with {@literal @}{@link SignalMethod}.
250-
* Querying a child workflow by calling methods annotated with {@literal @}{@link QueryMethod} from
251-
* within workflow code is not supported. However, queries can be done from activities using the
252-
* {@link com.uber.cadence.client.WorkflowClient} provided stub.
243+
* asynchronous using {@link Async#function(Functions.Func)} or {@link
244+
* Async#procedure(Functions.Proc)}. The synchronous call blocks until a child workflow completes.
245+
* The asynchronous call returns a {@link Promise} that can be used to wait for the completion.
246+
* After an async call returns the stub, it can be used to send signals to the child by calling
247+
* methods annotated with {@literal @}{@link SignalMethod}. Querying a child workflow by calling
248+
* methods annotated with {@literal @}{@link QueryMethod} from within workflow code is not
249+
* supported. However, queries can be done from activities using the {@link
250+
* com.uber.cadence.client.WorkflowClient} provided stub.
253251
*
254252
* <pre><code>
255253
* public interface GreetingChild {
@@ -338,8 +336,8 @@
338336
* for this.
339337
* <li>Only use {@link #currentTimeMillis()} to get the current time inside a workflow.
340338
* <li>Do not use native Java {@link Thread} or any other multi-threaded classes like {@link
341-
* java.util.concurrent.ThreadPoolExecutor}. Use {@link Async#function(Func)} or {@link
342-
* Async#procedure(Proc)} to execute code asynchronously.
339+
* java.util.concurrent.ThreadPoolExecutor}. Use {@link Async#function(Functions.Func)} or
340+
* {@link Async#procedure(Functions.Proc)} to execute code asynchronously.
343341
* <li>Don't use any synchronization, locks, and other standard Java blocking concurrency-related
344342
* classes besides those provided by the Workflow class. There is no need in explicit
345343
* synchronization because multi-threaded code inside a workflow is executed one thread at a
@@ -904,7 +902,7 @@ public static boolean isReplaying() {
904902
* @param resultClass type of the side effect
905903
* @param func function that returns side effect value
906904
* @return value of the side effect
907-
* @see #mutableSideEffect(String, Class, BiPredicate, Func)
905+
* @see #mutableSideEffect(String, Class, BiPredicate, Functions.Func)
908906
*/
909907
public static <R> R sideEffect(Class<R> resultClass, Func<R> func) {
910908
return WorkflowInternal.sideEffect(resultClass, resultClass, func);
@@ -959,21 +957,22 @@ public static <R> R sideEffect(Class<R> resultClass, Func<R> func) {
959957
* @param resultType type of the side effect. Differs from resultClass for generic types.
960958
* @param func function that returns side effect value
961959
* @return value of the side effect
962-
* @see #mutableSideEffect(String, Class, BiPredicate, Func)
960+
* @see #mutableSideEffect(String, Class, BiPredicate, Functions.Func)
963961
*/
964962
public static <R> R sideEffect(Class<R> resultClass, Type resultType, Func<R> func) {
965963
return WorkflowInternal.sideEffect(resultClass, resultType, func);
966964
}
967965

968966
/**
969-
* {@code mutableSideEffect} is similar to {@link #sideEffect(Class, Func)} in allowing calls of
970-
* non-deterministic functions from workflow code.
967+
* {@code mutableSideEffect} is similar to {@link #sideEffect(Class, Functions.Func)} in allowing
968+
* calls of non-deterministic functions from workflow code.
971969
*
972-
* <p>The difference between {@code mutableSideEffect} and {@link #sideEffect(Class, Func)} is
973-
* that every new {@code sideEffect} call in non-replay mode results in a new marker event
974-
* recorded into the history. However, {@code mutableSideEffect} only records a new marker if a
975-
* value has changed. During the replay, {@code mutableSideEffect} will not execute the function
976-
* again, but it will return the exact same value as it was returning during the non-replay run.
970+
* <p>The difference between {@code mutableSideEffect} and {@link #sideEffect(Class,
971+
* Functions.Func)} is that every new {@code sideEffect} call in non-replay mode results in a new
972+
* marker event recorded into the history. However, {@code mutableSideEffect} only records a new
973+
* marker if a value has changed. During the replay, {@code mutableSideEffect} will not execute
974+
* the function again, but it will return the exact same value as it was returning during the
975+
* non-replay run.
977976
*
978977
* <p>One good use case of {@code mutableSideEffect} is to access a dynamically changing config
979978
* without breaking determinism. Even if called very frequently the config value is recorded only
@@ -991,22 +990,23 @@ public static <R> R sideEffect(Class<R> resultClass, Type resultType, Func<R> fu
991990
* for the first value.
992991
* @param resultClass class of the side effect
993992
* @param func function that produces a value. This function can contain non deterministic code.
994-
* @see #sideEffect(Class, Func)
993+
* @see #sideEffect(Class, Functions.Func)
995994
*/
996995
public static <R> R mutableSideEffect(
997996
String id, Class<R> resultClass, BiPredicate<R, R> updated, Func<R> func) {
998997
return WorkflowInternal.mutableSideEffect(id, resultClass, resultClass, updated, func);
999998
}
1000999

10011000
/**
1002-
* {@code mutableSideEffect} is similar to {@link #sideEffect(Class, Func)} in allowing calls of
1003-
* non-deterministic functions from workflow code.
1001+
* {@code mutableSideEffect} is similar to {@link #sideEffect(Class, Functions.Func)} in allowing
1002+
* calls of non-deterministic functions from workflow code.
10041003
*
1005-
* <p>The difference between {@code mutableSideEffect} and {@link #sideEffect(Class, Func)} is
1006-
* that every new {@code sideEffect} call in non-replay mode results in a new marker event
1007-
* recorded into the history. However, {@code mutableSideEffect} only records a new marker if a
1008-
* value has changed. During the replay, {@code mutableSideEffect} will not execute the function
1009-
* again, but it will return the exact same value as it was returning during the non-replay run.
1004+
* <p>The difference between {@code mutableSideEffect} and {@link #sideEffect(Class,
1005+
* Functions.Func)} is that every new {@code sideEffect} call in non-replay mode results in a new
1006+
* marker event recorded into the history. However, {@code mutableSideEffect} only records a new
1007+
* marker if a value has changed. During the replay, {@code mutableSideEffect} will not execute
1008+
* the function again, but it will return the exact same value as it was returning during the
1009+
* non-replay run.
10101010
*
10111011
* <p>One good use case of {@code mutableSideEffect} is to access a dynamically changing config
10121012
* without breaking determinism. Even if called very frequently the config value is recorded only
@@ -1025,7 +1025,7 @@ public static <R> R mutableSideEffect(
10251025
* @param resultClass class of the side effect
10261026
* @param resultType type of the side effect. Differs from resultClass for generic types.
10271027
* @param func function that produces a value. This function can contain non deterministic code.
1028-
* @see #sideEffect(Class, Func)
1028+
* @see #sideEffect(Class, Functions.Func)
10291029
*/
10301030
public static <R> R mutableSideEffect(
10311031
String id, Class<R> resultClass, Type resultType, BiPredicate<R, R> updated, Func<R> func) {
@@ -1134,8 +1134,8 @@ public static Scope getMetricsScope() {
11341134
}
11351135

11361136
/**
1137-
* Get logger to use inside workflow. Logs in replay mode are omitted unless {@param
1138-
* enableLoggingInReplay} is set to true in {@link WorkerOptions} when a worker starts up.
1137+
* Get logger to use inside workflow. Logs in replay mode are omitted unless enableLoggingInReplay
1138+
* is set to true in {@link WorkerOptions} when a worker starts up.
11391139
*
11401140
* @param clazz class name to appear in logging.
11411141
* @return logger to use in workflow logic.
@@ -1145,8 +1145,8 @@ public static Logger getLogger(Class<?> clazz) {
11451145
}
11461146

11471147
/**
1148-
* Get logger to use inside workflow. Logs in replay mode are omitted unless {@param
1149-
* enableLoggingInReplay} is set to true in {@link WorkerOptions} when a worker starts up.
1148+
* Get logger to use inside workflow. Logs in replay mode are omitted unless enableLoggingInReplay
1149+
* is set to true in {@link WorkerOptions} when a worker starts up.
11501150
*
11511151
* @param name name to appear in logging.
11521152
* @return logger to use in workflow logic.

0 commit comments

Comments
 (0)