changeset 446:2ebe23110222

All JMH annotations should be visible at runtime.
author shade
date Fri, 28 Feb 2014 21:34:43 +0400
parents ebbe41586e3e
children 2f8dd5417a07
files jmh-core/src/main/java/org/openjdk/jmh/annotations/AuxCounters.java jmh-core/src/main/java/org/openjdk/jmh/annotations/BenchmarkMode.java jmh-core/src/main/java/org/openjdk/jmh/annotations/CompilerControl.java jmh-core/src/main/java/org/openjdk/jmh/annotations/Fork.java jmh-core/src/main/java/org/openjdk/jmh/annotations/GenerateMicroBenchmark.java jmh-core/src/main/java/org/openjdk/jmh/annotations/Group.java jmh-core/src/main/java/org/openjdk/jmh/annotations/GroupThreads.java jmh-core/src/main/java/org/openjdk/jmh/annotations/Measurement.java jmh-core/src/main/java/org/openjdk/jmh/annotations/OperationsPerInvocation.java jmh-core/src/main/java/org/openjdk/jmh/annotations/OutputTimeUnit.java jmh-core/src/main/java/org/openjdk/jmh/annotations/Param.java jmh-core/src/main/java/org/openjdk/jmh/annotations/State.java jmh-core/src/main/java/org/openjdk/jmh/annotations/Threads.java
diffstat 13 files changed, 27 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/annotations/AuxCounters.java	Fri Feb 28 17:04:38 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/annotations/AuxCounters.java	Fri Feb 28 21:34:43 2014 +0400
@@ -24,6 +24,11 @@
  */
 package org.openjdk.jmh.annotations;
 
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
 /**
  * THIS IS AN EXPERIMENTAL API.
  *  (That means it can be modified, deprecated and removed in future)
@@ -47,5 +52,7 @@
  * <p>
  * NOTE: This functionality is not available for all {@link BenchmarkMode}-s.
  */
+@Target(ElementType.TYPE)
+@Retention(RetentionPolicy.RUNTIME)
 public @interface AuxCounters {
 }
--- a/jmh-core/src/main/java/org/openjdk/jmh/annotations/BenchmarkMode.java	Fri Feb 28 17:04:38 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/annotations/BenchmarkMode.java	Fri Feb 28 21:34:43 2014 +0400
@@ -24,12 +24,18 @@
  */
 package org.openjdk.jmh.annotations;
 
+import java.lang.annotation.ElementType;
 import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
 
 /**
  * Annotations declares the default mode in which benchmark should be run.
  */
 @Inherited
+@Target({ElementType.METHOD, ElementType.TYPE})
+@Retention(RetentionPolicy.RUNTIME)
 public @interface BenchmarkMode {
 
     Mode[] value();
--- a/jmh-core/src/main/java/org/openjdk/jmh/annotations/CompilerControl.java	Fri Feb 28 17:04:38 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/annotations/CompilerControl.java	Fri Feb 28 21:34:43 2014 +0400
@@ -40,8 +40,8 @@
  * Also, these control annotations might get freely ignored by the compiler,
  * reduced to no-ops, or otherwise invalidated. Be cautious.
  */
+@Target({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.TYPE})
 @Retention(RetentionPolicy.RUNTIME)
-@Target({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.TYPE})
 public @interface CompilerControl {
 
     /**
--- a/jmh-core/src/main/java/org/openjdk/jmh/annotations/Fork.java	Fri Feb 28 17:04:38 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/annotations/Fork.java	Fri Feb 28 21:34:43 2014 +0400
@@ -37,9 +37,9 @@
  *
  * @author sergey.kuksenko@oracle.com
  */
+@Inherited
 @Target({ElementType.METHOD,ElementType.TYPE})
 @Retention(RetentionPolicy.RUNTIME)
-@Inherited
 public @interface Fork {
 
     public static final int BLANK_FORKS = -1;
--- a/jmh-core/src/main/java/org/openjdk/jmh/annotations/GenerateMicroBenchmark.java	Fri Feb 28 17:04:38 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/annotations/GenerateMicroBenchmark.java	Fri Feb 28 21:34:43 2014 +0400
@@ -75,7 +75,7 @@
  * @author Sergey Kuksenko
  */
 @Target(ElementType.METHOD)
-@Retention(RetentionPolicy.SOURCE)
+@Retention(RetentionPolicy.RUNTIME)
 public @interface GenerateMicroBenchmark {
 
 }
--- a/jmh-core/src/main/java/org/openjdk/jmh/annotations/Group.java	Fri Feb 28 17:04:38 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/annotations/Group.java	Fri Feb 28 21:34:43 2014 +0400
@@ -37,7 +37,7 @@
  * The results of each method is labelled by source method name.
  */
 @Target(ElementType.METHOD)
-@Retention(RetentionPolicy.SOURCE)
+@Retention(RetentionPolicy.RUNTIME)
 public @interface Group {
 
     /**
--- a/jmh-core/src/main/java/org/openjdk/jmh/annotations/GroupThreads.java	Fri Feb 28 17:04:38 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/annotations/GroupThreads.java	Fri Feb 28 21:34:43 2014 +0400
@@ -34,9 +34,9 @@
  * This annotation describes the default amount of threads
  * for particular subgroup. See {@link Group} for more details.
  */
+@Inherited
 @Target({ElementType.METHOD,ElementType.TYPE})
 @Retention(RetentionPolicy.RUNTIME)
-@Inherited
 public @interface GroupThreads {
 
     /** Number of threads in this subgroup. */
--- a/jmh-core/src/main/java/org/openjdk/jmh/annotations/Measurement.java	Fri Feb 28 17:04:38 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/annotations/Measurement.java	Fri Feb 28 21:34:43 2014 +0400
@@ -38,9 +38,9 @@
  *
  * @author sergey.kuksenko@oracle.com
  */
+@Inherited
 @Target({ElementType.METHOD,ElementType.TYPE})
 @Retention(RetentionPolicy.RUNTIME)
-@Inherited
 public @interface Measurement {
 
     public static final int BLANK_ITERATIONS = -1;
--- a/jmh-core/src/main/java/org/openjdk/jmh/annotations/OperationsPerInvocation.java	Fri Feb 28 17:04:38 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/annotations/OperationsPerInvocation.java	Fri Feb 28 21:34:43 2014 +0400
@@ -43,10 +43,9 @@
  * }
  * </pre></blockquote></p>
  */
-
+@Inherited
 @Target({ElementType.METHOD,ElementType.TYPE})
-@Retention(RetentionPolicy.SOURCE)
-@Inherited
+@Retention(RetentionPolicy.RUNTIME)
 public @interface OperationsPerInvocation {
 
     /**
--- a/jmh-core/src/main/java/org/openjdk/jmh/annotations/OutputTimeUnit.java	Fri Feb 28 17:04:38 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/annotations/OutputTimeUnit.java	Fri Feb 28 21:34:43 2014 +0400
@@ -36,9 +36,9 @@
  *
  * @author sergey.kuksenko@oracle.com
  */
+@Inherited
 @Target({ElementType.METHOD,ElementType.TYPE})
-@Retention(RetentionPolicy.SOURCE)
-@Inherited
+@Retention(RetentionPolicy.RUNTIME)
 public @interface OutputTimeUnit {
 
     /**
--- a/jmh-core/src/main/java/org/openjdk/jmh/annotations/Param.java	Fri Feb 28 17:04:38 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/annotations/Param.java	Fri Feb 28 21:34:43 2014 +0400
@@ -46,9 +46,9 @@
  * When multiple {@link Param}-s are needed for the benchmark run,
  * JMH will compute the outer product of all the parameters in the run.
  */
+@Inherited
 @Target({ElementType.FIELD})
-@Retention(RetentionPolicy.SOURCE)
-@Inherited
+@Retention(RetentionPolicy.RUNTIME)
 public @interface Param {
 
     public static final String BLANK_ARGS = "blank_blank_blank_2014";
--- a/jmh-core/src/main/java/org/openjdk/jmh/annotations/State.java	Fri Feb 28 17:04:38 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/annotations/State.java	Fri Feb 28 21:34:43 2014 +0400
@@ -38,9 +38,9 @@
  * <p />
  *
  */
+@Inherited
 @Target(ElementType.TYPE)
 @Retention(RetentionPolicy.RUNTIME)
-@Inherited
 public @interface State {
 
     /**
--- a/jmh-core/src/main/java/org/openjdk/jmh/annotations/Threads.java	Fri Feb 28 17:04:38 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/annotations/Threads.java	Fri Feb 28 21:34:43 2014 +0400
@@ -37,9 +37,9 @@
  *
  * @author sergey.kuksenko@oracle.com
  */
+@Inherited
 @Target({ElementType.METHOD,ElementType.TYPE})
 @Retention(RetentionPolicy.RUNTIME)
-@Inherited
 public @interface Threads {
 
     /**