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
  • Loading branch information
jschuchart-spot committed Jul 5, 2024
1 parent b035cce commit d0e0ab1
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 d0e0ab1

Please sign in to comment.