Abstract classes annotation processing
Aleksey Shipilev
aleksey.shipilev at oracle.com
Fri Jan 10 14:15:52 PST 2014
On 07/08/2013 10:47 PM, Aleksey Shipilev wrote:
> On 07/08/2013 10:17 PM, Aleksey Shipilev wrote:
>> Hi Julien,
>>
>> On 07/08/2013 09:47 PM, Julien Nicoulaud wrote:
>>> It seems JMH's annotation processor does not look into super classes for
>>> annotations. It would be great to support that, as it would allow to have
>>> "pseudo-parameterized" tests, for example something like this:
>>> https://gist.github.com/nicoulaj/5950889
>>
>> Hm, the premise was to allow this behavior (I even remember building the
>> integration tests for cases like these). I had drafted the quick
>> integration tests for your issue, and it is a bug. Let me see if it is
>> easily fixable.
>
> It is not easily fixable, because we lack the way to walk the class
> hierarchy down from the superclass.
...half a year later: there is a hacky way to achieve this: we can
process *all* the classes trying to figure out what benchmarks are
actually needed. I committed the new implementation here:
http://hg.openjdk.java.net/code-tools/jmh/rev/6c1661cc20e8
See the example:
http://hg.openjdk.java.net/code-tools/jmh/file/tip/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_24_Inheritance.java
More extensive testing would be appreciated!
-Aleksey.
More information about the jmh-dev
mailing list