diff --git a/build.gradle b/build.gradle index 6056486bf..211573848 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,10 @@ +// Run 'gradle checkUpdates' to find out which dependencies have newer versions + plugins { id 'net.minecrell.licenser' version '0.4.1' - id 'com.github.sherter.google-java-format' version '0.8' - id "net.ltgt.errorprone" version "0.6" + id 'com.github.sherter.google-java-format' version '0.9' + id "net.ltgt.errorprone" version "1.2.1" + id 'name.remal.check-updates' version '1.0.201' } apply plugin: 'java' @@ -27,16 +30,16 @@ repositories { } dependencies { - implementation group: 'io.temporal', name: 'temporal-sdk', version: '0.25.0-SNAPSHOT' - implementation group: 'commons-configuration', name: 'commons-configuration', version: '1.9' + implementation group: 'io.temporal', name: 'temporal-sdk', version: '0.26.0-SNAPSHOT' + implementation group: 'commons-configuration', name: 'commons-configuration', version: '1.10' implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3' - testImplementation group: 'junit', name: 'junit', version: '4.12' + testImplementation group: 'junit', name: 'junit', version: '4.13' testImplementation group: 'org.mockito', name: 'mockito-all', version: '1.10.19' - testImplementation group: 'org.powermock', name: 'powermock-api-mockito', version: '1.7.3' + testImplementation group: 'org.powermock', name: 'powermock-api-mockito', version: '1.7.4' errorproneJavac("com.google.errorprone:javac:9+181-r4173-1") - errorprone("com.google.errorprone:error_prone_core:2.3.1") + errorprone("com.google.errorprone:error_prone_core:2.4.0") } compileJava { diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index cc4fdc293..490fda857 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a4b442974..bb8b2fc26 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew.bat b/gradlew.bat index 24467a141..9109989e3 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" diff --git a/src/main/java/io/temporal/samples/bookingsaga/TripBookingActivities.java b/src/main/java/io/temporal/samples/bookingsaga/TripBookingActivities.java index 40e2b7909..ce02c963d 100644 --- a/src/main/java/io/temporal/samples/bookingsaga/TripBookingActivities.java +++ b/src/main/java/io/temporal/samples/bookingsaga/TripBookingActivities.java @@ -25,24 +25,32 @@ public interface TripBookingActivities { /** + * Request a car rental reservation. + * * @param name customer name * @return reservationID */ String reserveCar(String name); /** + * Request a flight reservation. + * * @param name customer name * @return reservationID */ String bookFlight(String name); /** + * Request a hotel reservation. + * * @param name customer name * @return reservationID */ String bookHotel(String name); /** + * Cancel a flight reservation. + * * @param name customer name * @param reservationID id returned by bookFlight * @return cancellationConfirmationID @@ -50,6 +58,8 @@ public interface TripBookingActivities { String cancelFlight(String reservationID, String name); /** + * Cancel a hotel reservation. + * * @param name customer name * @param reservationID id returned by bookHotel * @return cancellationConfirmationID @@ -57,6 +67,8 @@ public interface TripBookingActivities { String cancelHotel(String reservationID, String name); /** + * Cancel a car rental reservation. + * * @param name customer name * @param reservationID id returned by reserveCar * @return cancellationConfirmationID diff --git a/src/main/java/io/temporal/samples/hello/HelloActivity.java b/src/main/java/io/temporal/samples/hello/HelloActivity.java index d8e22644e..837c90754 100644 --- a/src/main/java/io/temporal/samples/hello/HelloActivity.java +++ b/src/main/java/io/temporal/samples/hello/HelloActivity.java @@ -43,7 +43,6 @@ public class HelloActivity { /** Workflow interface has to have at least one method annotated with @WorkflowMethod. */ @WorkflowInterface public interface GreetingWorkflow { - /** @return greeting string */ @WorkflowMethod String getGreeting(String name); } diff --git a/src/main/java/io/temporal/samples/hello/HelloActivityRetry.java b/src/main/java/io/temporal/samples/hello/HelloActivityRetry.java index 8c87649b2..843e3793b 100644 --- a/src/main/java/io/temporal/samples/hello/HelloActivityRetry.java +++ b/src/main/java/io/temporal/samples/hello/HelloActivityRetry.java @@ -43,7 +43,6 @@ public class HelloActivityRetry { @WorkflowInterface public interface GreetingWorkflow { - /** @return greeting string */ @WorkflowMethod String getGreeting(String name); } diff --git a/src/main/java/io/temporal/samples/hello/HelloAsyncActivityCompletion.java b/src/main/java/io/temporal/samples/hello/HelloAsyncActivityCompletion.java index 15451e3ae..1d4df0264 100644 --- a/src/main/java/io/temporal/samples/hello/HelloAsyncActivityCompletion.java +++ b/src/main/java/io/temporal/samples/hello/HelloAsyncActivityCompletion.java @@ -47,7 +47,6 @@ public class HelloAsyncActivityCompletion { @WorkflowInterface public interface GreetingWorkflow { - /** @return greeting string */ @WorkflowMethod String getGreeting(String name); } diff --git a/src/main/java/io/temporal/samples/hello/HelloAsyncLambda.java b/src/main/java/io/temporal/samples/hello/HelloAsyncLambda.java index c9a574685..ba63a7ada 100644 --- a/src/main/java/io/temporal/samples/hello/HelloAsyncLambda.java +++ b/src/main/java/io/temporal/samples/hello/HelloAsyncLambda.java @@ -43,7 +43,6 @@ public class HelloAsyncLambda { @WorkflowInterface public interface GreetingWorkflow { - /** @return greeting string */ @WorkflowMethod String getGreeting(String name); } diff --git a/src/main/java/io/temporal/samples/hello/HelloChild.java b/src/main/java/io/temporal/samples/hello/HelloChild.java index 3a198f1c1..f1c1b8adf 100644 --- a/src/main/java/io/temporal/samples/hello/HelloChild.java +++ b/src/main/java/io/temporal/samples/hello/HelloChild.java @@ -40,7 +40,6 @@ public class HelloChild { /** The parent workflow interface. */ @WorkflowInterface public interface GreetingWorkflow { - /** @return greeting string */ @WorkflowMethod String getGreeting(String name); } diff --git a/src/main/java/io/temporal/samples/hello/HelloCron.java b/src/main/java/io/temporal/samples/hello/HelloCron.java index be4893969..398cf6375 100644 --- a/src/main/java/io/temporal/samples/hello/HelloCron.java +++ b/src/main/java/io/temporal/samples/hello/HelloCron.java @@ -67,12 +67,6 @@ public static class GreetingWorkflowImpl implements GreetingWorkflow { GreetingActivities.class, ActivityOptions.newBuilder().setScheduleToCloseTimeout(Duration.ofSeconds(10)).build()); - /** - * Stub used to terminate this workflow run and create the next one with the same ID atomically. - */ - private final GreetingWorkflow continueAsNew = - Workflow.newContinueAsNewStub(GreetingWorkflow.class); - @Override public void greet(String name) { activities.greet("Hello " + name + "!"); diff --git a/src/main/java/io/temporal/samples/hello/HelloSearchAttributes.java b/src/main/java/io/temporal/samples/hello/HelloSearchAttributes.java index 30461da8e..0e551a67a 100644 --- a/src/main/java/io/temporal/samples/hello/HelloSearchAttributes.java +++ b/src/main/java/io/temporal/samples/hello/HelloSearchAttributes.java @@ -38,7 +38,8 @@ import io.temporal.workflowservice.v1.DescribeWorkflowExecutionResponse; import java.text.SimpleDateFormat; import java.time.Duration; -import java.util.Date; +import java.time.LocalDateTime; +import java.time.ZoneId; import java.util.HashMap; import java.util.Map; import java.util.UUID; @@ -53,7 +54,6 @@ public class HelloSearchAttributes { /** Workflow interface has to have at least one method annotated with @WorkflowMethod. */ @WorkflowInterface public interface GreetingWorkflow { - /** @return greeting string */ @WorkflowMethod String getGreeting(String name); } @@ -161,7 +161,8 @@ private static Map generateSearchAttributes() { // CustomDatetimeField takes times encoded in the RFC 3339 format. private static String generateDateTimeFieldValue() { - return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX").format(new Date()); + return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX") + .format(LocalDateTime.now(ZoneId.systemDefault())); } // example for extract value from search attributes diff --git a/src/main/java/io/temporal/samples/hello/HelloSignal.java b/src/main/java/io/temporal/samples/hello/HelloSignal.java index 240897920..dc46d47b4 100644 --- a/src/main/java/io/temporal/samples/hello/HelloSignal.java +++ b/src/main/java/io/temporal/samples/hello/HelloSignal.java @@ -45,8 +45,8 @@ public class HelloSignal { @WorkflowInterface public interface GreetingWorkflow { /** - * @return list of greeting strings that were received through the waitForNameMethod. This - * method will block until the number of greetings specified are received. + * list of greeting strings that were received through the waitForNameMethod. This method will + * block until the number of greetings specified are received. */ @WorkflowMethod List getGreetings(); diff --git a/src/main/java/io/temporal/samples/updatabletimer/UpdatableTimer.java b/src/main/java/io/temporal/samples/updatabletimer/UpdatableTimer.java index 847e826de..06451e9dc 100644 --- a/src/main/java/io/temporal/samples/updatabletimer/UpdatableTimer.java +++ b/src/main/java/io/temporal/samples/updatabletimer/UpdatableTimer.java @@ -21,7 +21,9 @@ import io.temporal.workflow.Workflow; import java.time.Duration; -import java.util.Date; +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.ZoneId; import org.slf4j.Logger; public final class UpdatableTimer { @@ -32,7 +34,9 @@ public final class UpdatableTimer { private boolean wakeUpTimeUpdated; public void sleepUntil(long wakeUpTime) { - logger.info("sleepUntil: " + new Date(wakeUpTime)); + Instant wakeUpInstant = Instant.ofEpochMilli(wakeUpTime); + LocalDateTime date = wakeUpInstant.atZone(ZoneId.systemDefault()).toLocalDateTime(); + logger.info("sleepUntil: " + date); this.wakeUpTime = wakeUpTime; while (true) { wakeUpTimeUpdated = false;