Skip to content

Commit 00ecb71

Browse files
committed
Remove throws clauses for unchecked exceptions
1 parent 3d381de commit 00ecb71

9 files changed

Lines changed: 68 additions & 133 deletions

File tree

temporal-sdk/src/main/java/io/temporal/client/ActivityClient.java

Lines changed: 34 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ static ActivityClient newInstance(WorkflowServiceStubs stubs, ActivityClientOpti
6666
* @throws ActivityAlreadyStartedException if an activity with the same ID is already running
6767
*/
6868
<I> ActivityHandle<Void> start(
69-
Class<I> activityInterface, Functions.Proc1<I> activity, StartActivityOptions options)
70-
throws ActivityAlreadyStartedException;
69+
Class<I> activityInterface, Functions.Proc1<I> activity, StartActivityOptions options);
7170

7271
/**
7372
* Starts a standalone activity using a typed interface and an unbound method reference with one
@@ -86,8 +85,7 @@ <I, A1> ActivityHandle<Void> start(
8685
Class<I> activityInterface,
8786
Functions.Proc2<I, A1> activity,
8887
StartActivityOptions options,
89-
A1 arg1)
90-
throws ActivityAlreadyStartedException;
88+
A1 arg1);
9189

9290
/**
9391
* Starts a standalone activity using a typed interface and an unbound method reference with two
@@ -109,8 +107,7 @@ <I, A1, A2> ActivityHandle<Void> start(
109107
Functions.Proc3<I, A1, A2> activity,
110108
StartActivityOptions options,
111109
A1 arg1,
112-
A2 arg2)
113-
throws ActivityAlreadyStartedException;
110+
A2 arg2);
114111

115112
/**
116113
* Starts a standalone activity using a typed interface and an unbound method reference with three
@@ -135,8 +132,7 @@ <I, A1, A2, A3> ActivityHandle<Void> start(
135132
StartActivityOptions options,
136133
A1 arg1,
137134
A2 arg2,
138-
A3 arg3)
139-
throws ActivityAlreadyStartedException;
135+
A3 arg3);
140136

141137
/**
142138
* Starts a standalone activity using a typed interface and an unbound method reference with four
@@ -164,8 +160,7 @@ <I, A1, A2, A3, A4> ActivityHandle<Void> start(
164160
A1 arg1,
165161
A2 arg2,
166162
A3 arg3,
167-
A4 arg4)
168-
throws ActivityAlreadyStartedException;
163+
A4 arg4);
169164

170165
/**
171166
* Starts a standalone activity using a typed interface and an unbound method reference with five
@@ -196,8 +191,7 @@ <I, A1, A2, A3, A4, A5> ActivityHandle<Void> start(
196191
A2 arg2,
197192
A3 arg3,
198193
A4 arg4,
199-
A5 arg5)
200-
throws ActivityAlreadyStartedException;
194+
A5 arg5);
201195

202196
/**
203197
* Starts a standalone activity using a typed interface and an unbound method reference with six
@@ -231,8 +225,7 @@ <I, A1, A2, A3, A4, A5, A6> ActivityHandle<Void> start(
231225
A3 arg3,
232226
A4 arg4,
233227
A5 arg5,
234-
A6 arg6)
235-
throws ActivityAlreadyStartedException;
228+
A6 arg6);
236229

237230
/**
238231
* Starts a standalone activity using a typed interface and an unbound method reference with no
@@ -247,8 +240,7 @@ <I, A1, A2, A3, A4, A5, A6> ActivityHandle<Void> start(
247240
* @throws ActivityAlreadyStartedException if an activity with the same ID is already running
248241
*/
249242
<I, R> ActivityHandle<R> start(
250-
Class<I> activityInterface, Functions.Func1<I, R> activity, StartActivityOptions options)
251-
throws ActivityAlreadyStartedException;
243+
Class<I> activityInterface, Functions.Func1<I, R> activity, StartActivityOptions options);
252244

253245
/**
254246
* Starts a standalone activity using a typed interface and an unbound method reference with one
@@ -268,8 +260,7 @@ <I, A1, R> ActivityHandle<R> start(
268260
Class<I> activityInterface,
269261
Functions.Func2<I, A1, R> activity,
270262
StartActivityOptions options,
271-
A1 arg1)
272-
throws ActivityAlreadyStartedException;
263+
A1 arg1);
273264

274265
/**
275266
* Starts a standalone activity using a typed interface and an unbound method reference with two
@@ -292,8 +283,7 @@ <I, A1, A2, R> ActivityHandle<R> start(
292283
Functions.Func3<I, A1, A2, R> activity,
293284
StartActivityOptions options,
294285
A1 arg1,
295-
A2 arg2)
296-
throws ActivityAlreadyStartedException;
286+
A2 arg2);
297287

298288
/**
299289
* Starts a standalone activity using a typed interface and an unbound method reference with three
@@ -319,8 +309,7 @@ <I, A1, A2, A3, R> ActivityHandle<R> start(
319309
StartActivityOptions options,
320310
A1 arg1,
321311
A2 arg2,
322-
A3 arg3)
323-
throws ActivityAlreadyStartedException;
312+
A3 arg3);
324313

325314
/**
326315
* Starts a standalone activity using a typed interface and an unbound method reference with four
@@ -349,8 +338,7 @@ <I, A1, A2, A3, A4, R> ActivityHandle<R> start(
349338
A1 arg1,
350339
A2 arg2,
351340
A3 arg3,
352-
A4 arg4)
353-
throws ActivityAlreadyStartedException;
341+
A4 arg4);
354342

355343
/**
356344
* Starts a standalone activity using a typed interface and an unbound method reference with five
@@ -382,8 +370,7 @@ <I, A1, A2, A3, A4, A5, R> ActivityHandle<R> start(
382370
A2 arg2,
383371
A3 arg3,
384372
A4 arg4,
385-
A5 arg5)
386-
throws ActivityAlreadyStartedException;
373+
A5 arg5);
387374

388375
/**
389376
* Starts a standalone activity using a typed interface and an unbound method reference with six
@@ -418,8 +405,7 @@ <I, A1, A2, A3, A4, A5, A6, R> ActivityHandle<R> start(
418405
A3 arg3,
419406
A4 arg4,
420407
A5 arg5,
421-
A6 arg6)
422-
throws ActivityAlreadyStartedException;
408+
A6 arg6);
423409

424410
/**
425411
* Starts a standalone activity using a typed interface and an unbound method reference with no
@@ -432,8 +418,7 @@ <I, A1, A2, A3, A4, A5, A6, R> ActivityHandle<R> start(
432418
* @throws ActivityFailedException if the activity failed, timed out, or was cancelled
433419
*/
434420
default <I> void execute(
435-
Class<I> activityInterface, Functions.Proc1<I> activity, StartActivityOptions options)
436-
throws ActivityFailedException {
421+
Class<I> activityInterface, Functions.Proc1<I> activity, StartActivityOptions options) {
437422
start(activityInterface, activity, options).getResult();
438423
}
439424

@@ -453,8 +438,7 @@ default <I, A1> void execute(
453438
Class<I> activityInterface,
454439
Functions.Proc2<I, A1> activity,
455440
StartActivityOptions options,
456-
A1 arg1)
457-
throws ActivityFailedException {
441+
A1 arg1) {
458442
start(activityInterface, activity, options, arg1).getResult();
459443
}
460444

@@ -477,8 +461,7 @@ default <I, A1, A2> void execute(
477461
Functions.Proc3<I, A1, A2> activity,
478462
StartActivityOptions options,
479463
A1 arg1,
480-
A2 arg2)
481-
throws ActivityFailedException {
464+
A2 arg2) {
482465
start(activityInterface, activity, options, arg1, arg2).getResult();
483466
}
484467

@@ -504,8 +487,7 @@ default <I, A1, A2, A3> void execute(
504487
StartActivityOptions options,
505488
A1 arg1,
506489
A2 arg2,
507-
A3 arg3)
508-
throws ActivityFailedException {
490+
A3 arg3) {
509491
start(activityInterface, activity, options, arg1, arg2, arg3).getResult();
510492
}
511493

@@ -534,8 +516,7 @@ default <I, A1, A2, A3, A4> void execute(
534516
A1 arg1,
535517
A2 arg2,
536518
A3 arg3,
537-
A4 arg4)
538-
throws ActivityFailedException {
519+
A4 arg4) {
539520
start(activityInterface, activity, options, arg1, arg2, arg3, arg4).getResult();
540521
}
541522

@@ -567,8 +548,7 @@ default <I, A1, A2, A3, A4, A5> void execute(
567548
A2 arg2,
568549
A3 arg3,
569550
A4 arg4,
570-
A5 arg5)
571-
throws ActivityFailedException {
551+
A5 arg5) {
572552
start(activityInterface, activity, options, arg1, arg2, arg3, arg4, arg5).getResult();
573553
}
574554

@@ -603,8 +583,7 @@ default <I, A1, A2, A3, A4, A5, A6> void execute(
603583
A3 arg3,
604584
A4 arg4,
605585
A5 arg5,
606-
A6 arg6)
607-
throws ActivityFailedException {
586+
A6 arg6) {
608587
start(activityInterface, activity, options, arg1, arg2, arg3, arg4, arg5, arg6).getResult();
609588
}
610589

@@ -621,8 +600,7 @@ default <I, A1, A2, A3, A4, A5, A6> void execute(
621600
* @throws ActivityFailedException if the activity failed, timed out, or was cancelled
622601
*/
623602
default <I, R> R execute(
624-
Class<I> activityInterface, Functions.Func1<I, R> activity, StartActivityOptions options)
625-
throws ActivityFailedException {
603+
Class<I> activityInterface, Functions.Func1<I, R> activity, StartActivityOptions options) {
626604
return start(activityInterface, activity, options).getResult();
627605
}
628606

@@ -644,8 +622,7 @@ default <I, A1, R> R execute(
644622
Class<I> activityInterface,
645623
Functions.Func2<I, A1, R> activity,
646624
StartActivityOptions options,
647-
A1 arg1)
648-
throws ActivityFailedException {
625+
A1 arg1) {
649626
return start(activityInterface, activity, options, arg1).getResult();
650627
}
651628

@@ -670,8 +647,7 @@ default <I, A1, A2, R> R execute(
670647
Functions.Func3<I, A1, A2, R> activity,
671648
StartActivityOptions options,
672649
A1 arg1,
673-
A2 arg2)
674-
throws ActivityFailedException {
650+
A2 arg2) {
675651
return start(activityInterface, activity, options, arg1, arg2).getResult();
676652
}
677653

@@ -699,8 +675,7 @@ default <I, A1, A2, A3, R> R execute(
699675
StartActivityOptions options,
700676
A1 arg1,
701677
A2 arg2,
702-
A3 arg3)
703-
throws ActivityFailedException {
678+
A3 arg3) {
704679
return start(activityInterface, activity, options, arg1, arg2, arg3).getResult();
705680
}
706681

@@ -731,8 +706,7 @@ default <I, A1, A2, A3, A4, R> R execute(
731706
A1 arg1,
732707
A2 arg2,
733708
A3 arg3,
734-
A4 arg4)
735-
throws ActivityFailedException {
709+
A4 arg4) {
736710
return start(activityInterface, activity, options, arg1, arg2, arg3, arg4).getResult();
737711
}
738712

@@ -766,8 +740,7 @@ default <I, A1, A2, A3, A4, A5, R> R execute(
766740
A2 arg2,
767741
A3 arg3,
768742
A4 arg4,
769-
A5 arg5)
770-
throws ActivityFailedException {
743+
A5 arg5) {
771744
return start(activityInterface, activity, options, arg1, arg2, arg3, arg4, arg5).getResult();
772745
}
773746

@@ -804,8 +777,7 @@ default <I, A1, A2, A3, A4, A5, A6, R> R execute(
804777
A3 arg3,
805778
A4 arg4,
806779
A5 arg5,
807-
A6 arg6)
808-
throws ActivityFailedException {
780+
A6 arg6) {
809781
return start(activityInterface, activity, options, arg1, arg2, arg3, arg4, arg5, arg6)
810782
.getResult();
811783
}
@@ -1191,8 +1163,7 @@ default <I, A1, A2, A3, A4, A5, A6, R> CompletableFuture<R> executeAsync(
11911163
* @throws ActivityAlreadyStartedException if an activity with the same ID is already running
11921164
*/
11931165
UntypedActivityHandle start(
1194-
String activityType, StartActivityOptions options, @Nullable Object... args)
1195-
throws ActivityAlreadyStartedException;
1166+
String activityType, StartActivityOptions options, @Nullable Object... args);
11961167

11971168
/**
11981169
* Starts a standalone activity by type name and returns a typed handle.
@@ -1209,8 +1180,7 @@ <R> ActivityHandle<R> start(
12091180
String activityType,
12101181
Class<R> resultClass,
12111182
StartActivityOptions options,
1212-
@Nullable Object... args)
1213-
throws ActivityAlreadyStartedException;
1183+
@Nullable Object... args);
12141184

12151185
/**
12161186
* Starts a standalone activity by type name and returns a typed handle for generic result types.
@@ -1229,8 +1199,7 @@ <R> ActivityHandle<R> start(
12291199
Class<R> resultClass,
12301200
Type resultType,
12311201
StartActivityOptions options,
1232-
@Nullable Object... args)
1233-
throws ActivityAlreadyStartedException;
1202+
@Nullable Object... args);
12341203

12351204
/**
12361205
* Starts a standalone activity and blocks until it completes, discarding the result.
@@ -1240,8 +1209,7 @@ <R> ActivityHandle<R> start(
12401209
* @param args activity arguments
12411210
* @throws ActivityFailedException if the activity failed, timed out, or was cancelled
12421211
*/
1243-
void execute(String activityType, StartActivityOptions options, @Nullable Object... args)
1244-
throws ActivityFailedException;
1212+
void execute(String activityType, StartActivityOptions options, @Nullable Object... args);
12451213

12461214
/**
12471215
* Starts a standalone activity and blocks until it completes, returning the typed result.
@@ -1258,8 +1226,7 @@ <R> R execute(
12581226
String activityType,
12591227
Class<R> resultClass,
12601228
StartActivityOptions options,
1261-
@Nullable Object... args)
1262-
throws ActivityFailedException;
1229+
@Nullable Object... args);
12631230

12641231
/**
12651232
* Starts a standalone activity and blocks until it completes, for generic result types.
@@ -1278,8 +1245,7 @@ <R> R execute(
12781245
Class<R> resultClass,
12791246
Type resultType,
12801247
StartActivityOptions options,
1281-
@Nullable Object... args)
1282-
throws ActivityFailedException;
1248+
@Nullable Object... args);
12831249

12841250
/**
12851251
* Starts a standalone activity and returns a future that completes when the activity does,

0 commit comments

Comments
 (0)