changeset 80:d0a438249900

@Generated to include generator name, as per its Javadoc.
author shade
date Tue, 04 Jun 2013 15:12:48 +0400
parents f1383f50315b
children e82505a6179a
files jmh-core/src/main/java/org/openjdk/jmh/processor/internal/GenerateMicroBenchmarkProcessor.java
diffstat 1 files changed, 1 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/processor/internal/GenerateMicroBenchmarkProcessor.java	Tue Jun 04 15:01:31 2013 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/processor/internal/GenerateMicroBenchmarkProcessor.java	Tue Jun 04 15:12:48 2013 +0400
@@ -283,7 +283,7 @@
 
             generateImport(writer);
             // Write class header
-            writer.println(generateClassAnnotation(info.methodGroups.keySet()));
+            writer.println("@Generated(\"" + GenerateMicroBenchmarkProcessor.class.getCanonicalName() + "\")");
             writer.println("public final class " + info.generatedClassName + " {");
             writer.println();
             generatePadding(writer);
@@ -459,23 +459,6 @@
     }
 
 
-    /**
-     * Generate the annotation telling this class has been generated
-     *
-     * @param methods
-     * @return
-     */
-    private static String generateClassAnnotation(Set<String> methods) {
-        StringBuilder sb = new StringBuilder("@Generated({");
-        for (String method : methods) {
-            sb.append('"').append(method).append("\",");
-        }
-        sb.setCharAt(sb.length() - 1, '}');
-        sb.append(')');
-        return sb.toString();
-    }
-
-
     private TimeUnit findTimeUnit(MethodGroup methodGroup) {
         OutputTimeUnit ann = methodGroup.methods().iterator().next().getEnclosingElement().getAnnotation(OutputTimeUnit.class);;
         for (Element method : methodGroup.methods()) {