I have a Java application running groovy built-in scripts using GroovyClassLoader . Everything works fine until I hit an odd error while passing Java types to groovy script.
My problem is this: I pass java.util.Date as a parameter in a groovy script. I found that groovy java.util.Date has a fantastic clearTime () . However, when I try to call this function, I get this exception:
groovy.lang.MissingMethodException: No signature of method: java.util.Date.clearTime() is applicable for argument types: () values: []
I guess this is because I have a Java date, not a groovy date. Is there a way to convert between them.
I admit that I don't quite understand how groovy seems to be overriding jdk types. (Therefore, I donβt even know if this is the correct terminology to use here.) Please correct me if I am completely mistaken about what happens when you create java.util.Date inside groovy against when you pass one of the functions Java features.
source share