hellobigbean / gbench

Automatically exported from code.google.com/p/gbench
Apache License 2.0
0 stars 0 forks source link

NPE occurs when using @Benchmark with interceptor #4

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. run the following script:
{{{
interface BenchmarkRunnable {
    @Benchmark void run()
}
def task = [run:{ -> Thread.sleep(100) }] as BenchmarkRunnable    
task.run()
}}}

Original issue reported on code.google.com by nagaimas...@gmail.com on 20 Dec 2011 at 2:21

GoogleCodeExporter commented 9 years ago
It seems there isn't an AST transformation that works with subclasses. For 
example, Log fails with "no such property: log" error. 

But, yes, it should show a appropriate error message instead of NPE.

In Groovy 1.8, there is an abstract class named AbstractASTTransformation that 
has a method to check if the processing class node is interface.

Original comment by nagaimas...@gmail.com on 20 Dec 2011 at 3:29

GoogleCodeExporter commented 9 years ago

Original comment by nagaimas...@gmail.com on 19 Mar 2013 at 1:34