File tree Expand file tree Collapse file tree 4 files changed +11
-13
lines changed
test/java/io/temporal/workflow Expand file tree Collapse file tree 4 files changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -237,13 +237,12 @@ public static ActivityExecutionContext getExecutionContext() {
237237 * try {
238238 * return someCall();
239239 * } catch (Exception e) {
240- * throw CheckedExceptionWrapper.throwWrapped (e);
240+ * throw Activity.wrap (e);
241241 * }
242242 * </pre>
243243 *
244- * If throwWrapped returned void it wouldn't be possible to write <code>
245- * throw CheckedExceptionWrapper.throwWrapped</code> and compiler would complain about missing
246- * return.
244+ * If wrap returned void it wouldn't be possible to write <code>
245+ * throw Activity.wrap</code> and compiler would complain about missing return.
247246 *
248247 * @return never returns as always throws.
249248 */
Original file line number Diff line number Diff line change @@ -187,12 +187,16 @@ private static <R> Promise<R> retryAsync(
187187
188188 private static RetryOptions getRetryOptionsSideEffect (String retryId , RetryOptions options ) {
189189 options = RetryOptions .newBuilder (options ).validateBuildWithDefaults ();
190+ long maximumIntervalMillis =
191+ options .getMaximumInterval () != null ? options .getMaximumInterval ().toMillis () : 0 ;
192+ long initialIntervalMillis =
193+ options .getInitialInterval () != null ? options .getInitialInterval ().toMillis () : 0 ;
190194 SerializableRetryOptions sOptions =
191195 new SerializableRetryOptions (
192- options . getInitialInterval (). toMillis () ,
196+ initialIntervalMillis ,
193197 options .getBackoffCoefficient (),
194198 options .getMaximumAttempts (),
195- options . getMaximumInterval (). toMillis () ,
199+ maximumIntervalMillis ,
196200 options .getDoNotRetry ());
197201 SerializableRetryOptions sRetryOptions =
198202 WorkflowInternal .mutableSideEffect (
Original file line number Diff line number Diff line change @@ -821,7 +821,7 @@ public static void retry(
821821 * try {
822822 * return someCall();
823823 * } catch (Exception e) {
824- * throw CheckedExceptionWrapper .wrap(e);
824+ * throw Workflow .wrap(e);
825825 * }
826826 * </pre>
827827 *
Original file line number Diff line number Diff line change @@ -713,12 +713,7 @@ public String execute(String taskList) {
713713 .setMaximumAttempts (3 )
714714 .build ();
715715 } else {
716- retryOptions =
717- RetryOptions .newBuilder ()
718- .setMaximumInterval (Duration .ofSeconds (1 ))
719- .setInitialInterval (Duration .ofSeconds (1 ))
720- .setMaximumAttempts (2 )
721- .build ();
716+ retryOptions = RetryOptions .newBuilder ().setMaximumAttempts (2 ).build ();
722717 }
723718 TestActivities activities = Workflow .newActivityStub (TestActivities .class , options .build ());
724719 Workflow .retry (retryOptions , Optional .of (Duration .ofDays (1 )), () -> activities .throwIO ());
You can’t perform that action at this time.
0 commit comments