diff --git a/temporal-sdk/src/main/java/io/temporal/worker/WorkerOptions.java b/temporal-sdk/src/main/java/io/temporal/worker/WorkerOptions.java index b0e979406..2c85b3e76 100644 --- a/temporal-sdk/src/main/java/io/temporal/worker/WorkerOptions.java +++ b/temporal-sdk/src/main/java/io/temporal/worker/WorkerOptions.java @@ -579,7 +579,7 @@ && compare(that.maxTaskQueueActivitiesPerSecond, maxTaskQueueActivitiesPerSecond && Objects.equals(stickyQueueScheduleToStartTimeout, that.stickyQueueScheduleToStartTimeout) && disableEagerExecution == that.disableEagerExecution && useBuildIdForVersioning == that.useBuildIdForVersioning - && buildId.equals(that.buildId); + && Objects.equals(that.buildId, buildId); } @Override diff --git a/temporal-sdk/src/test/java/io/temporal/worker/WorkerOptionsTest.java b/temporal-sdk/src/test/java/io/temporal/worker/WorkerOptionsTest.java index 1d3aae17e..934e014cd 100644 --- a/temporal-sdk/src/test/java/io/temporal/worker/WorkerOptionsTest.java +++ b/temporal-sdk/src/test/java/io/temporal/worker/WorkerOptionsTest.java @@ -40,4 +40,11 @@ private void verifyBuild(WorkerOptions options) { assertEquals(10, options.getMaxConcurrentActivityExecutionSize()); assertEquals(11, options.getMaxConcurrentLocalActivityExecutionSize()); } + + @Test + public void verifyWorkerOptionsEquality() { + WorkerOptions w1 = WorkerOptions.newBuilder().build(); + WorkerOptions w2 = WorkerOptions.newBuilder().build(); + assertEquals(w1, w2); + } }