Main.groovy
static void setThreadLocalProperty(String key, Object val) { Class target = null // redacted
def setter = Reflections.findMethod('setThreadLocalProperty', target, String, Object)
Reflections.invokeMethod(setter, target, key, val) // semantic highlights as DGM
}
Reflections.groovy
import java.lang.reflect.*
class Reflections {
static Method findMethod(String methodName, Class<?> targetClass, Class<?>... paramTypes) {
}
static Object invokeMethod(Method method, Object target, Object... params) {
}
}
Main.groovy
Reflections.groovy