changeset 808:fdd7e7779ee7

generators: rename "reflective", "reflect" to "reflection".
author shade
date Mon, 09 Jun 2014 22:14:20 +0400
parents a93864b5991f
children 2d6da9f60cdd
files jmh-core-ct/src/test/java/org/openjdk/jmh/ct/CompileTest.java jmh-core-it/pom.xml jmh-generator-asm/src/main/java/org/openjdk/jmh/generators/asm/ClassInfoRepo.java jmh-generator-bytecode/src/main/java/org/openjdk/jmh/generators/bytecode/JmhBytecodeGenerator.java jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflection/RFClassInfo.java jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflection/RFConstructorInfo.java jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflection/RFFieldInfo.java jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflection/RFGeneratorSource.java jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflection/RFMethodInfo.java jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflection/RFParameterInfo.java jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflective/RFClassInfo.java jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflective/RFConstructorInfo.java jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflective/RFFieldInfo.java jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflective/RFGeneratorSource.java jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflective/RFMethodInfo.java jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflective/RFParameterInfo.java
diffstat 16 files changed, 583 insertions(+), 583 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core-ct/src/test/java/org/openjdk/jmh/ct/CompileTest.java	Mon Jun 09 22:09:42 2014 +0400
+++ b/jmh-core-ct/src/test/java/org/openjdk/jmh/ct/CompileTest.java	Mon Jun 09 22:14:20 2014 +0400
@@ -29,7 +29,7 @@
 import org.openjdk.jmh.generators.core.BenchmarkGenerator;
 import org.openjdk.jmh.generators.core.GeneratorDestination;
 import org.openjdk.jmh.generators.core.MetadataInfo;
-import org.openjdk.jmh.generators.reflective.RFGeneratorSource;
+import org.openjdk.jmh.generators.reflection.RFGeneratorSource;
 
 import javax.tools.Diagnostic;
 import javax.tools.DiagnosticCollector;
--- a/jmh-core-it/pom.xml	Mon Jun 09 22:09:42 2014 +0400
+++ b/jmh-core-it/pom.xml	Mon Jun 09 22:14:20 2014 +0400
@@ -216,7 +216,7 @@
         </profile>
 
         <profile>
-            <id>reflect</id>
+            <id>reflection</id>
             <dependencies>
                 <dependency>
                     <groupId>org.openjdk.jmh</groupId>
--- a/jmh-generator-asm/src/main/java/org/openjdk/jmh/generators/asm/ClassInfoRepo.java	Mon Jun 09 22:09:42 2014 +0400
+++ b/jmh-generator-asm/src/main/java/org/openjdk/jmh/generators/asm/ClassInfoRepo.java	Mon Jun 09 22:14:20 2014 +0400
@@ -25,7 +25,7 @@
 package org.openjdk.jmh.generators.asm;
 
 import org.openjdk.jmh.generators.core.ClassInfo;
-import org.openjdk.jmh.generators.reflective.RFGeneratorSource;
+import org.openjdk.jmh.generators.reflection.RFGeneratorSource;
 
 import java.util.Collection;
 import java.util.HashMap;
--- a/jmh-generator-bytecode/src/main/java/org/openjdk/jmh/generators/bytecode/JmhBytecodeGenerator.java	Mon Jun 09 22:09:42 2014 +0400
+++ b/jmh-generator-bytecode/src/main/java/org/openjdk/jmh/generators/bytecode/JmhBytecodeGenerator.java	Mon Jun 09 22:14:20 2014 +0400
@@ -29,7 +29,7 @@
 import org.openjdk.jmh.generators.core.FileSystemDestination;
 import org.openjdk.jmh.generators.core.GeneratorSource;
 import org.openjdk.jmh.generators.core.SourceError;
-import org.openjdk.jmh.generators.reflective.RFGeneratorSource;
+import org.openjdk.jmh.generators.reflection.RFGeneratorSource;
 import org.openjdk.jmh.util.FileUtils;
 
 import java.io.File;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflection/RFClassInfo.java	Mon Jun 09 22:14:20 2014 +0400
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.generators.reflection;
+
+import org.openjdk.jmh.generators.core.ClassInfo;
+import org.openjdk.jmh.generators.core.FieldInfo;
+import org.openjdk.jmh.generators.core.MethodInfo;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.Collection;
+
+class RFClassInfo implements ClassInfo {
+    private final Class<?> klass;
+
+    public RFClassInfo(Class<?> klass) {
+        this.klass = klass;
+    }
+
+    @Override
+    public String getPackageName() {
+        if (klass.getDeclaringClass() != null) {
+            return klass.getDeclaringClass().getPackage().getName();
+        } else {
+            return klass.getPackage().getName();
+        }
+    }
+
+    @Override
+    public String getName() {
+        String name = klass.getSimpleName();
+        if (name.contains("$")) {
+            return name.substring(name.lastIndexOf("$"));
+        } else {
+            return name;
+        }
+    }
+
+    @Override
+    public String getQualifiedName() {
+        String name = klass.getCanonicalName();
+        if (name == null) {
+            name = klass.getName();
+        }
+        if (name.contains("$")) {
+            return name.replace("$", ".");
+        } else {
+            return name;
+        }
+    }
+
+    @Override
+    public Collection<FieldInfo> getFields() {
+        Collection<FieldInfo> fis = new ArrayList<FieldInfo>();
+        for (Field f : klass.getDeclaredFields()) {
+            fis.add(new RFFieldInfo(this, f));
+        }
+        return fis;
+    }
+
+    @Override
+    public Collection<MethodInfo> getConstructors() {
+        Collection<MethodInfo> mis = new ArrayList<MethodInfo>();
+        for (Constructor m : klass.getDeclaredConstructors()) {
+            mis.add(new RFConstructorInfo(this, m));
+        }
+        return mis;
+    }
+
+    @Override
+    public Collection<MethodInfo> getMethods() {
+        Collection<MethodInfo> mis = new ArrayList<MethodInfo>();
+        for (Method m : klass.getDeclaredMethods()) {
+            mis.add(new RFMethodInfo(this, m));
+        }
+        return mis;
+    }
+
+    @Override
+    public ClassInfo getSuperClass() {
+        if (klass.getSuperclass() != null) {
+            return new RFClassInfo(klass.getSuperclass());
+        } else {
+            return null;
+        }
+    }
+
+    @Override
+    public ClassInfo getDeclaringClass() {
+        if (klass.getDeclaringClass() != null) {
+            return new RFClassInfo(klass.getDeclaringClass());
+        } else {
+            return null;
+        }
+    }
+
+    @Override
+    public <T extends Annotation> T getAnnotation(Class<T> annClass) {
+        return klass.getAnnotation(annClass);
+    }
+
+    @Override
+    public boolean isAbstract() {
+        return Modifier.isAbstract(klass.getModifiers());
+    }
+
+    @Override
+    public boolean isPublic() {
+        return Modifier.isPublic(klass.getModifiers());
+    }
+
+    @Override
+    public boolean isStrictFP() {
+        return Modifier.isStrict(klass.getModifiers());
+    }
+
+    @Override
+    public boolean isFinal() {
+        return Modifier.isFinal(klass.getModifiers());
+    }
+
+    @Override
+    public boolean isInner() {
+        // LOL, Reflection: http://mail.openjdk.java.net/pipermail/core-libs-dev/2014-February/025246.html
+        return klass.isAnonymousClass() ||
+               klass.isLocalClass() ||
+                       (klass.isMemberClass() && !Modifier.isStatic(klass.getModifiers()));
+    }
+
+    @Override
+    public boolean isEnum() {
+        return klass.isEnum();
+    }
+
+    @Override
+    public Collection<String> getEnumConstants() {
+        Collection<String> res = new ArrayList<String>();
+        for (Object cnst : klass.getEnumConstants()) {
+            res.add(cnst.toString());
+        }
+        return res;
+    }
+
+    @Override
+    public String toString() {
+        return getQualifiedName();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflection/RFConstructorInfo.java	Mon Jun 09 22:14:20 2014 +0400
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.generators.reflection;
+
+import org.openjdk.jmh.generators.core.ClassInfo;
+import org.openjdk.jmh.generators.core.MethodInfo;
+import org.openjdk.jmh.generators.core.ParameterInfo;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.Collection;
+
+class RFConstructorInfo implements MethodInfo {
+
+    private final RFClassInfo declaringClass;
+    private final Constructor m;
+
+    public RFConstructorInfo(RFClassInfo declaringClass, Constructor m) {
+        this.declaringClass = declaringClass;
+        this.m = m;
+    }
+
+    @Override
+    public ClassInfo getDeclaringClass() {
+        return declaringClass;
+    }
+
+    @Override
+    public String getName() {
+        return m.getName();
+    }
+
+    @Override
+    public String getQualifiedName() {
+        return declaringClass.getQualifiedName() + "." + m.getName();
+    }
+
+    @Override
+    public String getReturnType() {
+        throw new IllegalStateException("Asking the return type for constructor");
+    }
+
+    @Override
+    public Collection<ParameterInfo> getParameters() {
+        Collection<ParameterInfo> pis = new ArrayList<ParameterInfo>();
+        for (Class<?> cl : m.getParameterTypes()) {
+            pis.add(new RFParameterInfo(cl));
+        }
+        return pis;
+    }
+
+    @Override
+    public <T extends Annotation> T getAnnotation(Class<T> annClass) {
+        throw new IllegalStateException("Asking annotations for constructor");
+    }
+
+    @Override
+    public boolean isPublic() {
+        return Modifier.isPublic(m.getModifiers());
+    }
+
+    @Override
+    public boolean isAbstract() {
+        return Modifier.isAbstract(m.getModifiers());
+    }
+
+    @Override
+    public boolean isSynchronized() {
+        return Modifier.isSynchronized(m.getModifiers());
+    }
+
+    @Override
+    public boolean isStrictFP() {
+        return Modifier.isStrict(m.getModifiers());
+    }
+
+    @Override
+    public boolean isStatic() {
+        return Modifier.isStatic(m.getModifiers());
+    }
+
+    @Override
+    public int compareTo(MethodInfo o) {
+        return getQualifiedName().compareTo(o.getQualifiedName());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflection/RFFieldInfo.java	Mon Jun 09 22:14:20 2014 +0400
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.generators.reflection;
+
+import org.openjdk.jmh.generators.core.ClassInfo;
+import org.openjdk.jmh.generators.core.FieldInfo;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+
+class RFFieldInfo implements FieldInfo {
+    private final ClassInfo declaringClass;
+    private final Field f;
+
+    public RFFieldInfo(ClassInfo declaringClass, Field f) {
+        this.declaringClass = declaringClass;
+        this.f = f;
+    }
+
+    @Override
+    public ClassInfo getDeclaringClass() {
+        return declaringClass;
+    }
+
+    @Override
+    public String getName() {
+        return f.getName();
+    }
+
+    @Override
+    public ClassInfo getType() {
+        return new RFClassInfo(f.getType());
+    }
+
+    @Override
+    public <T extends Annotation> T getAnnotation(Class<T> annClass) {
+        return f.getAnnotation(annClass);
+    }
+
+    @Override
+    public boolean isPublic() {
+        return Modifier.isPublic(f.getModifiers());
+    }
+
+    @Override
+    public boolean isStatic() {
+        return Modifier.isStatic(f.getModifiers());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflection/RFGeneratorSource.java	Mon Jun 09 22:14:20 2014 +0400
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.generators.reflection;
+
+import org.openjdk.jmh.generators.core.ClassInfo;
+import org.openjdk.jmh.generators.core.GeneratorSource;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+
+public class RFGeneratorSource implements GeneratorSource {
+
+    private final Collection<Class> classes;
+
+    public RFGeneratorSource() {
+        this.classes = new ArrayList<Class>();
+    }
+
+    @Override
+    public Collection<ClassInfo> getClasses() {
+        Collection<ClassInfo> cis = new ArrayList<ClassInfo>();
+        for (Class c : classes) {
+            cis.add(new RFClassInfo(c));
+        }
+        return cis;
+    }
+
+    public static ClassInfo resolveClass(Class<?> klass) {
+        return new RFClassInfo(klass);
+    }
+
+    @Override
+    public ClassInfo resolveClass(String className) {
+        String desc = className.replace('/', '.');
+        try {
+            return resolveClass(Class.forName(desc, false, Thread.currentThread().getContextClassLoader()));
+        } catch (ClassNotFoundException e) {
+            throw new IllegalStateException("Unable to resolve class: " + desc);
+        }
+    }
+
+    public void processClasses(Class... cs) {
+        processClasses(Arrays.asList(cs));
+    }
+
+    public void processClasses(Collection<Class> cs) {
+        classes.addAll(cs);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflection/RFMethodInfo.java	Mon Jun 09 22:14:20 2014 +0400
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.generators.reflection;
+
+import org.openjdk.jmh.generators.core.ClassInfo;
+import org.openjdk.jmh.generators.core.MethodInfo;
+import org.openjdk.jmh.generators.core.ParameterInfo;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.Collection;
+
+class RFMethodInfo implements MethodInfo {
+
+    private final RFClassInfo declaringClass;
+    private final Method m;
+
+    public RFMethodInfo(RFClassInfo declaringClass, Method m) {
+        this.declaringClass = declaringClass;
+        this.m = m;
+    }
+
+    @Override
+    public ClassInfo getDeclaringClass() {
+        return declaringClass;
+    }
+
+    @Override
+    public String getName() {
+        return m.getName();
+    }
+
+    @Override
+    public String getQualifiedName() {
+        return declaringClass.getQualifiedName() + "." + m.getName();
+    }
+
+    @Override
+    public String getReturnType() {
+        return m.getReturnType().getCanonicalName();
+    }
+
+    @Override
+    public Collection<ParameterInfo> getParameters() {
+        Collection<ParameterInfo> pis = new ArrayList<ParameterInfo>();
+        for (Class<?> cl : m.getParameterTypes()) {
+            pis.add(new RFParameterInfo(cl));
+        }
+        return pis;
+    }
+
+    @Override
+    public <T extends Annotation> T getAnnotation(Class<T> annClass) {
+        return m.getAnnotation(annClass);
+    }
+
+    @Override
+    public boolean isPublic() {
+        return Modifier.isPublic(m.getModifiers());
+    }
+
+    @Override
+    public boolean isAbstract() {
+        return Modifier.isAbstract(m.getModifiers());
+    }
+
+    @Override
+    public boolean isSynchronized() {
+        return Modifier.isSynchronized(m.getModifiers());
+    }
+
+    @Override
+    public boolean isStrictFP() {
+        return Modifier.isStrict(m.getModifiers());
+    }
+
+    @Override
+    public boolean isStatic() {
+        return Modifier.isStatic(m.getModifiers());
+    }
+
+    @Override
+    public int compareTo(MethodInfo o) {
+        return getQualifiedName().compareTo(o.getQualifiedName());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflection/RFParameterInfo.java	Mon Jun 09 22:14:20 2014 +0400
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.generators.reflection;
+
+import org.openjdk.jmh.generators.core.ClassInfo;
+import org.openjdk.jmh.generators.core.ParameterInfo;
+
+class RFParameterInfo implements ParameterInfo {
+    private final Class<?> cl;
+
+    public RFParameterInfo(Class<?> cl) {
+        this.cl = cl;
+    }
+
+    @Override
+    public ClassInfo getType() {
+        return new RFClassInfo(cl);
+    }
+}
--- a/jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflective/RFClassInfo.java	Mon Jun 09 22:09:42 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,174 +0,0 @@
-/*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jmh.generators.reflective;
-
-import org.openjdk.jmh.generators.core.ClassInfo;
-import org.openjdk.jmh.generators.core.FieldInfo;
-import org.openjdk.jmh.generators.core.MethodInfo;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.ArrayList;
-import java.util.Collection;
-
-class RFClassInfo implements ClassInfo {
-    private final Class<?> klass;
-
-    public RFClassInfo(Class<?> klass) {
-        this.klass = klass;
-    }
-
-    @Override
-    public String getPackageName() {
-        if (klass.getDeclaringClass() != null) {
-            return klass.getDeclaringClass().getPackage().getName();
-        } else {
-            return klass.getPackage().getName();
-        }
-    }
-
-    @Override
-    public String getName() {
-        String name = klass.getSimpleName();
-        if (name.contains("$")) {
-            return name.substring(name.lastIndexOf("$"));
-        } else {
-            return name;
-        }
-    }
-
-    @Override
-    public String getQualifiedName() {
-        String name = klass.getCanonicalName();
-        if (name == null) {
-            name = klass.getName();
-        }
-        if (name.contains("$")) {
-            return name.replace("$", ".");
-        } else {
-            return name;
-        }
-    }
-
-    @Override
-    public Collection<FieldInfo> getFields() {
-        Collection<FieldInfo> fis = new ArrayList<FieldInfo>();
-        for (Field f : klass.getDeclaredFields()) {
-            fis.add(new RFFieldInfo(this, f));
-        }
-        return fis;
-    }
-
-    @Override
-    public Collection<MethodInfo> getConstructors() {
-        Collection<MethodInfo> mis = new ArrayList<MethodInfo>();
-        for (Constructor m : klass.getDeclaredConstructors()) {
-            mis.add(new RFConstructorInfo(this, m));
-        }
-        return mis;
-    }
-
-    @Override
-    public Collection<MethodInfo> getMethods() {
-        Collection<MethodInfo> mis = new ArrayList<MethodInfo>();
-        for (Method m : klass.getDeclaredMethods()) {
-            mis.add(new RFMethodInfo(this, m));
-        }
-        return mis;
-    }
-
-    @Override
-    public ClassInfo getSuperClass() {
-        if (klass.getSuperclass() != null) {
-            return new RFClassInfo(klass.getSuperclass());
-        } else {
-            return null;
-        }
-    }
-
-    @Override
-    public ClassInfo getDeclaringClass() {
-        if (klass.getDeclaringClass() != null) {
-            return new RFClassInfo(klass.getDeclaringClass());
-        } else {
-            return null;
-        }
-    }
-
-    @Override
-    public <T extends Annotation> T getAnnotation(Class<T> annClass) {
-        return klass.getAnnotation(annClass);
-    }
-
-    @Override
-    public boolean isAbstract() {
-        return Modifier.isAbstract(klass.getModifiers());
-    }
-
-    @Override
-    public boolean isPublic() {
-        return Modifier.isPublic(klass.getModifiers());
-    }
-
-    @Override
-    public boolean isStrictFP() {
-        return Modifier.isStrict(klass.getModifiers());
-    }
-
-    @Override
-    public boolean isFinal() {
-        return Modifier.isFinal(klass.getModifiers());
-    }
-
-    @Override
-    public boolean isInner() {
-        // LOL, Reflection: http://mail.openjdk.java.net/pipermail/core-libs-dev/2014-February/025246.html
-        return klass.isAnonymousClass() ||
-               klass.isLocalClass() ||
-                       (klass.isMemberClass() && !Modifier.isStatic(klass.getModifiers()));
-    }
-
-    @Override
-    public boolean isEnum() {
-        return klass.isEnum();
-    }
-
-    @Override
-    public Collection<String> getEnumConstants() {
-        Collection<String> res = new ArrayList<String>();
-        for (Object cnst : klass.getEnumConstants()) {
-            res.add(cnst.toString());
-        }
-        return res;
-    }
-
-    @Override
-    public String toString() {
-        return getQualifiedName();
-    }
-}
--- a/jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflective/RFConstructorInfo.java	Mon Jun 09 22:09:42 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jmh.generators.reflective;
-
-import org.openjdk.jmh.generators.core.ClassInfo;
-import org.openjdk.jmh.generators.core.MethodInfo;
-import org.openjdk.jmh.generators.core.ParameterInfo;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Modifier;
-import java.util.ArrayList;
-import java.util.Collection;
-
-class RFConstructorInfo implements MethodInfo {
-
-    private final RFClassInfo declaringClass;
-    private final Constructor m;
-
-    public RFConstructorInfo(RFClassInfo declaringClass, Constructor m) {
-        this.declaringClass = declaringClass;
-        this.m = m;
-    }
-
-    @Override
-    public ClassInfo getDeclaringClass() {
-        return declaringClass;
-    }
-
-    @Override
-    public String getName() {
-        return m.getName();
-    }
-
-    @Override
-    public String getQualifiedName() {
-        return declaringClass.getQualifiedName() + "." + m.getName();
-    }
-
-    @Override
-    public String getReturnType() {
-        throw new IllegalStateException("Asking the return type for constructor");
-    }
-
-    @Override
-    public Collection<ParameterInfo> getParameters() {
-        Collection<ParameterInfo> pis = new ArrayList<ParameterInfo>();
-        for (Class<?> cl : m.getParameterTypes()) {
-            pis.add(new RFParameterInfo(cl));
-        }
-        return pis;
-    }
-
-    @Override
-    public <T extends Annotation> T getAnnotation(Class<T> annClass) {
-        throw new IllegalStateException("Asking annotations for constructor");
-    }
-
-    @Override
-    public boolean isPublic() {
-        return Modifier.isPublic(m.getModifiers());
-    }
-
-    @Override
-    public boolean isAbstract() {
-        return Modifier.isAbstract(m.getModifiers());
-    }
-
-    @Override
-    public boolean isSynchronized() {
-        return Modifier.isSynchronized(m.getModifiers());
-    }
-
-    @Override
-    public boolean isStrictFP() {
-        return Modifier.isStrict(m.getModifiers());
-    }
-
-    @Override
-    public boolean isStatic() {
-        return Modifier.isStatic(m.getModifiers());
-    }
-
-    @Override
-    public int compareTo(MethodInfo o) {
-        return getQualifiedName().compareTo(o.getQualifiedName());
-    }
-}
--- a/jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflective/RFFieldInfo.java	Mon Jun 09 22:09:42 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jmh.generators.reflective;
-
-import org.openjdk.jmh.generators.core.ClassInfo;
-import org.openjdk.jmh.generators.core.FieldInfo;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-
-class RFFieldInfo implements FieldInfo {
-    private final ClassInfo declaringClass;
-    private final Field f;
-
-    public RFFieldInfo(ClassInfo declaringClass, Field f) {
-        this.declaringClass = declaringClass;
-        this.f = f;
-    }
-
-    @Override
-    public ClassInfo getDeclaringClass() {
-        return declaringClass;
-    }
-
-    @Override
-    public String getName() {
-        return f.getName();
-    }
-
-    @Override
-    public ClassInfo getType() {
-        return new RFClassInfo(f.getType());
-    }
-
-    @Override
-    public <T extends Annotation> T getAnnotation(Class<T> annClass) {
-        return f.getAnnotation(annClass);
-    }
-
-    @Override
-    public boolean isPublic() {
-        return Modifier.isPublic(f.getModifiers());
-    }
-
-    @Override
-    public boolean isStatic() {
-        return Modifier.isStatic(f.getModifiers());
-    }
-}
--- a/jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflective/RFGeneratorSource.java	Mon Jun 09 22:09:42 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jmh.generators.reflective;
-
-import org.openjdk.jmh.generators.core.ClassInfo;
-import org.openjdk.jmh.generators.core.GeneratorSource;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-
-public class RFGeneratorSource implements GeneratorSource {
-
-    private final Collection<Class> classes;
-
-    public RFGeneratorSource() {
-        this.classes = new ArrayList<Class>();
-    }
-
-    @Override
-    public Collection<ClassInfo> getClasses() {
-        Collection<ClassInfo> cis = new ArrayList<ClassInfo>();
-        for (Class c : classes) {
-            cis.add(new RFClassInfo(c));
-        }
-        return cis;
-    }
-
-    public static ClassInfo resolveClass(Class<?> klass) {
-        return new RFClassInfo(klass);
-    }
-
-    @Override
-    public ClassInfo resolveClass(String className) {
-        String desc = className.replace('/', '.');
-        try {
-            return resolveClass(Class.forName(desc, false, Thread.currentThread().getContextClassLoader()));
-        } catch (ClassNotFoundException e) {
-            throw new IllegalStateException("Unable to resolve class: " + desc);
-        }
-    }
-
-    public void processClasses(Class... cs) {
-        processClasses(Arrays.asList(cs));
-    }
-
-    public void processClasses(Collection<Class> cs) {
-        classes.addAll(cs);
-    }
-}
--- a/jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflective/RFMethodInfo.java	Mon Jun 09 22:09:42 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jmh.generators.reflective;
-
-import org.openjdk.jmh.generators.core.ClassInfo;
-import org.openjdk.jmh.generators.core.MethodInfo;
-import org.openjdk.jmh.generators.core.ParameterInfo;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.ArrayList;
-import java.util.Collection;
-
-class RFMethodInfo implements MethodInfo {
-
-    private final RFClassInfo declaringClass;
-    private final Method m;
-
-    public RFMethodInfo(RFClassInfo declaringClass, Method m) {
-        this.declaringClass = declaringClass;
-        this.m = m;
-    }
-
-    @Override
-    public ClassInfo getDeclaringClass() {
-        return declaringClass;
-    }
-
-    @Override
-    public String getName() {
-        return m.getName();
-    }
-
-    @Override
-    public String getQualifiedName() {
-        return declaringClass.getQualifiedName() + "." + m.getName();
-    }
-
-    @Override
-    public String getReturnType() {
-        return m.getReturnType().getCanonicalName();
-    }
-
-    @Override
-    public Collection<ParameterInfo> getParameters() {
-        Collection<ParameterInfo> pis = new ArrayList<ParameterInfo>();
-        for (Class<?> cl : m.getParameterTypes()) {
-            pis.add(new RFParameterInfo(cl));
-        }
-        return pis;
-    }
-
-    @Override
-    public <T extends Annotation> T getAnnotation(Class<T> annClass) {
-        return m.getAnnotation(annClass);
-    }
-
-    @Override
-    public boolean isPublic() {
-        return Modifier.isPublic(m.getModifiers());
-    }
-
-    @Override
-    public boolean isAbstract() {
-        return Modifier.isAbstract(m.getModifiers());
-    }
-
-    @Override
-    public boolean isSynchronized() {
-        return Modifier.isSynchronized(m.getModifiers());
-    }
-
-    @Override
-    public boolean isStrictFP() {
-        return Modifier.isStrict(m.getModifiers());
-    }
-
-    @Override
-    public boolean isStatic() {
-        return Modifier.isStatic(m.getModifiers());
-    }
-
-    @Override
-    public int compareTo(MethodInfo o) {
-        return getQualifiedName().compareTo(o.getQualifiedName());
-    }
-}
--- a/jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflective/RFParameterInfo.java	Mon Jun 09 22:09:42 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jmh.generators.reflective;
-
-import org.openjdk.jmh.generators.core.ClassInfo;
-import org.openjdk.jmh.generators.core.ParameterInfo;
-
-class RFParameterInfo implements ParameterInfo {
-    private final Class<?> cl;
-
-    public RFParameterInfo(Class<?> cl) {
-        this.cl = cl;
-    }
-
-    @Override
-    public ClassInfo getType() {
-        return new RFClassInfo(cl);
-    }
-}