Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0.5, 3.0.6
-
None
-
Windows 10 Pro
Description
If a method is called with an argument having null value, beforeInvoke throws a NullPointerException. Here is an example:
class Foo {
String say(String s)Unknown macro: { return s }}
Foo foo = new Foo()
def tracer = new TracingInterceptor()
def proxyMetaClass = ProxyMetaClass.getInstance(Foo.class)
proxyMetaClass.interceptor = tracer
foo.metaClass = proxyMetaClassdef s
foo.say(s)
This will cause a crash because s is null. I believe inside writeInfo() method of TracingInterceptor, it has something like argument.getClass().
In the example above, if we change foo.say(s) to foo.say(s as String) it would pass the beforeInvoke but still fails afterward. If we actual set s to a non-null value, e.g.
def s = 'Hello'
the trace would work.