Skip to content

Commit

Permalink
Fixing handling of product element names in scala 2.12
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Schuchart <[email protected]>
  • Loading branch information
jschuchart-spot committed Jul 5, 2024
1 parent 0d5957b commit bab6ec6
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ package object flytekitscala {
} catch {
case _: Throwable =>
// fall back to java's way, less reliable and with limitations
product.getClass.getDeclaredFields.map(_.getName).toList
val methodNames = product.getClass.getDeclaredMethods.map(_.getName)
product.getClass.getDeclaredFields
.map(_.getName)
.filter(methodNames.contains)
.toList
}
}
}

0 comments on commit bab6ec6

Please sign in to comment.