changeset 439:3387329b6564

Yak shaving: getDeclared* -> get*
author shade
date Fri, 28 Feb 2014 14:28:17 +0400
parents 80e3f02d698a
children 3ccedf7d3298
files jmh-core/src/main/java/org/openjdk/jmh/generators/annotations/APClassInfo.java jmh-core/src/main/java/org/openjdk/jmh/generators/bytecode/ASMClassInfo.java jmh-core/src/main/java/org/openjdk/jmh/generators/core/BenchmarkGenerator.java jmh-core/src/main/java/org/openjdk/jmh/generators/core/BenchmarkGeneratorUtils.java jmh-core/src/main/java/org/openjdk/jmh/generators/core/StateObjectHandler.java jmh-core/src/main/java/org/openjdk/jmh/generators/reflective/ReflectiveClassInfo.java jmh-core/src/main/java/org/openjdk/jmh/generators/source/ClassInfo.java
diffstat 7 files changed, 19 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/annotations/APClassInfo.java	Fri Feb 28 14:26:18 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/generators/annotations/APClassInfo.java	Fri Feb 28 14:28:17 2014 +0400
@@ -78,7 +78,7 @@
     }
 
     @Override
-    public Collection<FieldInfo> getDeclaredFields() {
+    public Collection<FieldInfo> getFields() {
         List<FieldInfo> ls = new ArrayList<FieldInfo>();
         for (VariableElement e : ElementFilter.fieldsIn(el.getEnclosedElements())) {
             ls.add(new APFieldInfo(processEnv, e));
@@ -88,7 +88,7 @@
 
 
     @Override
-    public Collection<MethodInfo> getDeclaredMethods() {
+    public Collection<MethodInfo> getMethods() {
         Collection<MethodInfo> mis = new ArrayList<MethodInfo>();
         for (ExecutableElement e : ElementFilter.methodsIn(el.getEnclosedElements())) {
             mis.add(new APMethodInfo(processEnv, this, e));
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/bytecode/ASMClassInfo.java	Fri Feb 28 14:26:18 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/generators/bytecode/ASMClassInfo.java	Fri Feb 28 14:28:17 2014 +0400
@@ -134,7 +134,7 @@
     }
 
     @Override
-    public Collection<FieldInfo> getDeclaredFields() {
+    public Collection<FieldInfo> getFields() {
         return fields;
     }
 
@@ -144,7 +144,7 @@
     }
 
     @Override
-    public Collection<MethodInfo> getDeclaredMethods() {
+    public Collection<MethodInfo> getMethods() {
         return methods;
     }
 
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/core/BenchmarkGenerator.java	Fri Feb 28 14:26:18 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/generators/core/BenchmarkGenerator.java	Fri Feb 28 14:28:17 2014 +0400
@@ -64,7 +64,6 @@
 import org.openjdk.jmh.util.internal.SampleBuffer;
 
 import javax.annotation.Generated;
-import java.io.BufferedWriter;
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.lang.annotation.IncompleteAnnotationException;
@@ -189,7 +188,7 @@
             if (currentClass.getQualifiedName().contains("generated")) continue;
             if (currentClass.isAbstract()) continue;
 
-            for (MethodInfo mi : currentClass.getDeclaredMethods()) {
+            for (MethodInfo mi : currentClass.getMethods()) {
                 GenerateMicroBenchmark ann = mi.getAnnotation(GenerateMicroBenchmark.class);
                 if (ann != null) {
                     result.put(currentClass, mi);
@@ -198,7 +197,7 @@
 
             for (ClassInfo upperClass : currentClass.getSuperclasses()) {
                 if (upperClass.getQualifiedName().contains("generated")) continue;
-                for (MethodInfo mi : upperClass.getDeclaredMethods()) {
+                for (MethodInfo mi : upperClass.getMethods()) {
                     GenerateMicroBenchmark ann = mi.getAnnotation(GenerateMicroBenchmark.class);
                     if (ann != null) {
                         result.put(currentClass, mi);
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/core/BenchmarkGeneratorUtils.java	Fri Feb 28 14:26:18 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/generators/core/BenchmarkGeneratorUtils.java	Fri Feb 28 14:28:17 2014 +0400
@@ -39,7 +39,7 @@
     public static <T extends Annotation> Collection<MethodInfo> getMethodsAnnotatedWith(GeneratorSource source, Class<T> annClass) {
         List<MethodInfo> mis = new ArrayList<MethodInfo>();
         for (ClassInfo ci : source.getClasses()) {
-            for (MethodInfo mi : ci.getDeclaredMethods()) {
+            for (MethodInfo mi : ci.getMethods()) {
                 if (mi.getAnnotation(annClass) != null) {
                     mis.add(mi);
                 }
@@ -61,7 +61,7 @@
     public static <T extends Annotation> Collection<FieldInfo> getFieldsAnnotatedWith(GeneratorSource source, Class<T> annClass) {
         List<FieldInfo> mis = new ArrayList<FieldInfo>();
         for (ClassInfo ci : source.getClasses()) {
-            for (FieldInfo mi : ci.getDeclaredFields()) {
+            for (FieldInfo mi : ci.getFields()) {
                 if (mi.getAnnotation(annClass) != null) {
                     mis.add(mi);
                 }
@@ -72,18 +72,18 @@
 
     public static Collection<FieldInfo> getAllFields(ClassInfo ci) {
         List<FieldInfo> ls = new ArrayList<FieldInfo>();
-        ls.addAll(ci.getDeclaredFields());
+        ls.addAll(ci.getFields());
         for (ClassInfo cl : ci.getSuperclasses()) {
-            ls.addAll(cl.getDeclaredFields());
+            ls.addAll(cl.getFields());
         }
         return ls;
     }
 
     public static Collection<MethodInfo> getMethods(ClassInfo ci) {
         List<MethodInfo> ls = new ArrayList<MethodInfo>();
-        ls.addAll(ci.getDeclaredMethods());
+        ls.addAll(ci.getMethods());
         for (ClassInfo cl : ci.getSuperclasses()) {
-            ls.addAll(cl.getDeclaredMethods());
+            ls.addAll(cl.getMethods());
         }
         return ls;
     }
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/core/StateObjectHandler.java	Fri Feb 28 14:26:18 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/generators/core/StateObjectHandler.java	Fri Feb 28 14:28:17 2014 +0400
@@ -165,7 +165,7 @@
                         " can only be used with " + Scope.class.getSimpleName() + "." + Scope.Thread + " states.", ci);
             }
 
-            for (FieldInfo sub : ci.getDeclaredFields()) {
+            for (FieldInfo sub : ci.getFields()) {
                 if (sub.isPublic()) {
                     String fieldType = sub.getType();
                     if (fieldType.equals("int") || fieldType.equals("long")) {
@@ -182,7 +182,7 @@
                 }
             }
 
-            for (MethodInfo sub : ci.getDeclaredMethods()) {
+            for (MethodInfo sub : ci.getMethods()) {
                 if (sub.isPublic()) {
                     String returnType = sub.getReturnType();
                     if (returnType.equals("int") || returnType.equals("long")) {
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/reflective/ReflectiveClassInfo.java	Fri Feb 28 14:26:18 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/generators/reflective/ReflectiveClassInfo.java	Fri Feb 28 14:28:17 2014 +0400
@@ -59,7 +59,7 @@
     }
 
     @Override
-    public Collection<FieldInfo> getDeclaredFields() {
+    public Collection<FieldInfo> getFields() {
         // FIXME
         return Collections.emptyList();
     }
@@ -71,7 +71,7 @@
     }
 
     @Override
-    public Collection<MethodInfo> getDeclaredMethods() {
+    public Collection<MethodInfo> getMethods() {
         // FIXME
         return Collections.emptyList();
     }
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/source/ClassInfo.java	Fri Feb 28 14:26:18 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/generators/source/ClassInfo.java	Fri Feb 28 14:28:17 2014 +0400
@@ -38,12 +38,12 @@
 
     String getQualifiedName();
 
-    Collection<FieldInfo> getDeclaredFields();
+    Collection<FieldInfo> getFields();
+
+    Collection<MethodInfo> getMethods();
 
     Collection<MethodInfo> getConstructors();
 
-    Collection<MethodInfo> getDeclaredMethods();
-
     Collection<ClassInfo> getSuperclasses();
 
     <T extends Annotation> T getAnnotation(Class<T> annClass);