Skip to content

Commit 55dd0b0

Browse files
authored
Updated google formater version to 1.5 (#144)
1 parent adfc1bd commit 55dd0b0

13 files changed

+46
-30
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ apply plugin: 'maven-publish'
2424
apply plugin: 'com.github.sherter.google-java-format'
2525

2626
googleJavaFormat {
27-
toolVersion '1.3'
27+
toolVersion '1.5'
2828
include '**/*.java'
2929
exclude '**/generated-sources/*'
3030
}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,10 @@ public T read(JsonReader jsonReader) throws IOException {
242242
gson.getDelegateAdapter(
243243
ThrowableTypeAdapterFactory.this, TypeToken.get(classType));
244244
StackTraceElement[] stackTrace = parseStackTrace(object);
245-
// This is important. Initially I tried configuring ExclusionStrategy to not deserialize the stackTrace field.
246-
// But it left it null, which caused Thread.setStackTrace implementation to become silent noop.
245+
// This is important. Initially I tried configuring ExclusionStrategy to not
246+
// deserialize the stackTrace field.
247+
// But it left it null, which caused Thread.setStackTrace implementation to become
248+
// silent noop.
247249
object.add("stackTrace", new JsonArray());
248250
Throwable result = (Throwable) adapter.fromJsonTree(object);
249251
result.setStackTrace(stackTrace);

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@
7676
*/
7777
public class WorkflowExecutionUtils {
7878

79-
8079
/**
81-
* Indentation for history and decisions pretty printing.
82-
* Do not change it from 2 spaces. The gson pretty printer has it hardcoded and changing it
83-
* breaks the indentation of exception stack traces.
80+
* Indentation for history and decisions pretty printing. Do not change it from 2 spaces. The gson
81+
* pretty printer has it hardcoded and changing it breaks the indentation of exception stack
82+
* traces.
8483
*/
8584
private static final String INDENTATION = " ";
85+
8686
private static RetryOptions retryParameters =
8787
new RetryOptions.Builder()
8888
.setBackoffCoefficient(2)
@@ -400,8 +400,10 @@ public static String getFailureCause(HistoryEvent historyEvent) {
400400
.getStartChildWorkflowExecutionFailedEventAttributes()
401401
.getCause()
402402
.toString();
403-
// } else if (historyEvent.getEventType() == EventType.SignalExternalWorkflowExecutionFailed) {
404-
// failureCause = historyEvent.getSignalExternalWorkflowExecutionFailedEventAttributes().getCause();
403+
// } else if (historyEvent.getEventType() ==
404+
// EventType.SignalExternalWorkflowExecutionFailed) {
405+
// failureCause =
406+
// historyEvent.getSignalExternalWorkflowExecutionFailedEventAttributes().getCause();
405407
} else {
406408
failureCause = "Cannot extract failure cause from " + historyEvent.getEventType();
407409
}

src/main/java/com/uber/cadence/internal/replay/ActivityDecisionContext.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ Consumer<Exception> scheduleActivityTask(
9292
attributes.setScheduleToStartTimeoutSeconds(
9393
(int) parameters.getScheduleToStartTimeoutSeconds());
9494
attributes.setStartToCloseTimeoutSeconds((int) parameters.getStartToCloseTimeoutSeconds());
95-
// attributes.setTaskPriority(InternalUtils.taskPriorityToString(parameters.getTaskPriority()));
95+
//
96+
// attributes.setTaskPriority(InternalUtils.taskPriorityToString(parameters.getTaskPriority()));
9697
String activityId = parameters.getActivityId();
9798
if (activityId == null) {
9899
activityId = String.valueOf(decisions.getNextId());
@@ -123,7 +124,8 @@ void handleActivityTaskCanceled(HistoryEvent event) {
123124
if (scheduled != null) {
124125
BiConsumer<byte[], Exception> completionHandle = scheduled.getCompletionCallback();
125126
// It is OK to fail with subclass of CancellationException when cancellation requested.
126-
// It allows passing information about cancellation (details in this case) to the surrounding doCatch block
127+
// It allows passing information about cancellation (details in this case) to the
128+
// surrounding doCatch block
127129
completionHandle.accept(null, e);
128130
}
129131
}

src/main/java/com/uber/cadence/internal/replay/ReplayDecider.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -348,12 +348,13 @@ private void decideImpl(Functions.Proc query) throws Throwable {
348348
// Buffer events until the next DecisionTaskStarted and then process them
349349
// setting current time to the time of DecisionTaskStarted event
350350
HistoryHelper.EventsIterator eventsIterator = historyHelper.getEvents();
351-
// Processes history in batches. One batch per decision. The idea is to push all events to a workflow
352-
// before running event loop. This way it can make decisions based on the complete information
353-
// instead of a partial one. For example if workflow waits on two activities to proceed and takes
354-
// different action if one of them is not ready it would behave differently if both activities
355-
// are completed before the event loop or if the event loop runs after every activity event.
356-
// Looks ahead to the DecisionTaskStarted event to get current time before calling eventLoop.
351+
// Processes history in batches. One batch per decision. The idea is to push all events to a
352+
// workflow before running event loop. This way it can make decisions based on the complete
353+
// information instead of a partial one. For example if workflow waits on two activities to
354+
// proceed and takes different action if one of them is not ready it would behave
355+
// differently if both activities are completed before the event loop or if the event loop
356+
// runs after every activity event. Looks ahead to the DecisionTaskStarted event to get
357+
// current time before calling eventLoop.
357358
do {
358359
List<HistoryEvent> decisionCompletionToStartEvents = new ArrayList<>();
359360
while (eventsIterator.hasNext()) {

src/main/java/com/uber/cadence/internal/replay/ReplayDecisionTaskHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ public DecisionTaskHandler.Result handleDecisionTask(
5454
return handleDecisionTaskImpl(decisionTaskIterator);
5555
} catch (Throwable e) {
5656
PollForDecisionTaskResponse decisionTask = decisionTaskIterator.getDecisionTask();
57-
// Only fail decision on first attempt, subsequent failure on the same decision task will timeout.
58-
// This is to avoid spin on the failed decision task.
57+
// Only fail decision on first attempt, subsequent failure on the same decision task will
58+
// timeout. This is to avoid spin on the failed decision task.
5959
if (decisionTask.getAttempt() > 0) {
6060
if (e instanceof Error) {
6161
throw (Error) e;

src/main/java/com/uber/cadence/internal/replay/WorkflowContext.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,20 @@ void setContinueAsNewOnCompletion(ContinueAsNewWorkflowExecutionParameters conti
7979

8080
// TODO: Implement as soon as WorkflowExecutionStartedEventAttributes have these fields added.
8181
//// WorkflowExecution getParentWorkflowExecution() {
82-
// WorkflowExecutionStartedEventAttributes attributes = getWorkflowStartedEventAttributes();
82+
// WorkflowExecutionStartedEventAttributes attributes =
83+
// getWorkflowStartedEventAttributes();
8384
// return attributes.getParentWorkflowExecution();
8485
// }
8586

8687
//// com.uber.cadence.ChildPolicy getChildPolicy() {
87-
// WorkflowExecutionStartedEventAttributes attributes = getWorkflowStartedEventAttributes();
88+
// WorkflowExecutionStartedEventAttributes attributes =
89+
// getWorkflowStartedEventAttributes();
8890
// return ChildPolicy.fromValue(attributes.getChildPolicy());
8991
// }
9092

9193
//// String getContinuedExecutionRunId() {
92-
// WorkflowExecutionStartedEventAttributes attributes = getWorkflowStartedEventAttributes();
94+
// WorkflowExecutionStartedEventAttributes attributes =
95+
// getWorkflowStartedEventAttributes();
9396
// return attributes.getContinuedExecutionRunId();
9497
// }
9598

src/main/java/com/uber/cadence/internal/replay/WorkflowDecisionContext.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ Consumer<Exception> startChildWorkflow(
132132
(int) parameters.getTaskStartToCloseTimeoutSeconds());
133133
}
134134
if (parameters.getChildPolicy() == null) {
135-
// TODO: Child policy from a parent as soon as it is available in the WorkflowExecutionStarted event
135+
// TODO: Child policy from a parent as soon as it is available in the WorkflowExecutionStarted
136+
// event
136137
// Or when server accepts null
137138
// attributes.setChildPolicy(workflowContext.getChildPolicy());
138139
attributes.setChildPolicy(ChildPolicy.TERMINATE);

src/main/java/com/uber/cadence/internal/sync/ActivityExecutionContextImpl.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class ActivityExecutionContextImpl implements ActivityExecutionContext {
6767
*/
6868
@Override
6969
public void recordActivityHeartbeat(Object details) throws ActivityCompletionException {
70-
//TODO: call service with the specified minimal interval (through @ActivityExecutionOptions)
70+
// TODO: call service with the specified minimal interval (through @ActivityExecutionOptions)
7171
// allowing more frequent calls of this method.
7272
RecordActivityTaskHeartbeatRequest r = new RecordActivityTaskHeartbeatRequest();
7373
r.setTaskToken(task.getTaskToken());
@@ -90,7 +90,8 @@ public void recordActivityHeartbeat(Object details) throws ActivityCompletionExc
9090
+ " of Workflow="
9191
+ task.getWorkflowExecution(),
9292
e);
93-
// Not rethrowing to not fail activity implementation on intermittent connection or Cadence errors.
93+
// Not rethrowing to not fail activity implementation on intermittent connection or Cadence
94+
// errors.
9495
}
9596
}
9697

src/main/java/com/uber/cadence/internal/sync/SyncDecisionContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ private <T> Promise<T> executeActivityOnce(
125125
private Promise<byte[]> executeActivityOnce(String name, ActivityOptions options, byte[] input) {
126126
CompletablePromise<byte[]> result = Workflow.newPromise();
127127
ExecuteActivityParameters parameters = new ExecuteActivityParameters();
128-
//TODO: Real task list
128+
// TODO: Real task list
129129
String taskList = options.getTaskList();
130130
if (taskList == null) {
131131
taskList = context.getTaskList();

0 commit comments

Comments
 (0)