Skip to content

Commit 8f9f37d

Browse files
committed
Validate if method has no arguments before invoking without arguments
Signed-off-by: Vinícius Moraes Lopes <[email protected]>
1 parent b91c9d7 commit 8f9f37d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

api/src/main/java/io/serverlessworkflow/serialization/SerializeHelper.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ public class SerializeHelper {
2323
public static void serializeOneOf(JsonGenerator jgen, Object item) throws IOException {
2424
try {
2525
for (Method m : item.getClass().getDeclaredMethods()) {
26+
if (m.getParameterCount() > 0) {
27+
continue;
28+
}
2629
Object value = m.invoke(item);
2730
if (value != null) {
2831
jgen.writeObject(value);

0 commit comments

Comments
 (0)