From df1d5187132da04ce172f2fa19d07d263b202ce9 Mon Sep 17 00:00:00 2001 From: Quinn Klassen Date: Mon, 18 Nov 2024 10:41:05 -0800 Subject: [PATCH] Fix type assertion --- .../metadata/POJOWorkflowInterfaceMetadata.java | 12 +++++------- .../metadata/POJOWorkflowInterfaceMetadataTest.java | 1 - 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/temporal-sdk/src/main/java/io/temporal/common/metadata/POJOWorkflowInterfaceMetadata.java b/temporal-sdk/src/main/java/io/temporal/common/metadata/POJOWorkflowInterfaceMetadata.java index 3e0947386..b003ceabd 100644 --- a/temporal-sdk/src/main/java/io/temporal/common/metadata/POJOWorkflowInterfaceMetadata.java +++ b/temporal-sdk/src/main/java/io/temporal/common/metadata/POJOWorkflowInterfaceMetadata.java @@ -210,17 +210,15 @@ private static POJOWorkflowInterfaceMetadata newInstanceInternal( + methodMetadata.getWorkflowMethod().getName() + "\""); } - if (Arrays.equals( - update.getWorkflowMethod().getGenericParameterTypes(), - methodMetadata.getWorkflowMethod().getGenericParameterTypes()) - || update.getWorkflowMethod().getGenericReturnType() - == methodMetadata.getWorkflowMethod().getGenericReturnType()) { + if (!Arrays.equals( + update.getWorkflowMethod().getGenericParameterTypes(), + methodMetadata.getWorkflowMethod().getGenericParameterTypes())) { throw new IllegalArgumentException( "Update method \"" + update.getWorkflowMethod().getName() - + "\" and validator method \"" + + "\" and Validator method \"" + methodMetadata.getWorkflowMethod().getName() - + "\" have the same signature"); + + "\" do not have the same parameters"); } } } diff --git a/temporal-sdk/src/test/java/io/temporal/common/metadata/POJOWorkflowInterfaceMetadataTest.java b/temporal-sdk/src/test/java/io/temporal/common/metadata/POJOWorkflowInterfaceMetadataTest.java index 39f367405..59b2ea3e9 100644 --- a/temporal-sdk/src/test/java/io/temporal/common/metadata/POJOWorkflowInterfaceMetadataTest.java +++ b/temporal-sdk/src/test/java/io/temporal/common/metadata/POJOWorkflowInterfaceMetadataTest.java @@ -215,7 +215,6 @@ private Class generateWorkflowInterfaceWithQueryMethod( public void workflowInterfaceWithUpdateValidator() { POJOWorkflowInterfaceMetadata metadata = POJOWorkflowInterfaceMetadata.newInstance(GUpdate.class); - System.out.println(metadata); } @Test