Repository: groovy Updated Branches: refs/heads/GROOVY_2_6_X b1d964dba -> f7e2c46a0
Refine `getGroovydoc` DGMs (cherry picked from commit 86eb9dd) Project: http://git-wip-us.apache.org/repos/asf/groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/ba37b013 Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/ba37b013 Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/ba37b013 Branch: refs/heads/GROOVY_2_6_X Commit: ba37b01388772caf15d948f9c1e914b36952bbab Parents: b1d964d Author: sunlan <sun...@apache.org> Authored: Sun Sep 10 20:42:22 2017 +0800 Committer: sunlan <sun...@apache.org> Committed: Sun Sep 10 22:46:47 2017 +0800 ---------------------------------------------------------------------- .../groovy/runtime/DefaultGroovyMethods.java | 35 ++------------------ 1 file changed, 2 insertions(+), 33 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/groovy/blob/ba37b013/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java ---------------------------------------------------------------------- diff --git a/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java b/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java index 9f99021..b4dae13 100644 --- a/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java +++ b/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java @@ -117,8 +117,8 @@ import java.io.Reader; import java.io.StringWriter; import java.io.UnsupportedEncodingException; import java.io.Writer; +import java.lang.reflect.AnnotatedElement; import java.lang.reflect.Array; -import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.lang.reflect.Modifier; @@ -18884,44 +18884,13 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport { return self.remove(o); } - - /** - * Get runtime groovydoc - * @param holder the groovydoc hold - * @return runtime groovydoc - * @since 2.6.0 - */ - public static String getGroovydoc(Class<?> holder) { - return holder.<Groovydoc>getAnnotation(Groovydoc.class).value(); - } - - /** - * Get runtime groovydoc - * @param holder the groovydoc hold - * @return runtime groovydoc - * @since 2.6.0 - */ - public static String getGroovydoc(Method holder) { - return holder.<Groovydoc>getAnnotation(Groovydoc.class).value(); - } - - /** - * Get runtime groovydoc - * @param holder the groovydoc hold - * @return runtime groovydoc - * @since 2.6.0 - */ - public static String getGroovydoc(Constructor holder) { - return ((Groovydoc) holder.<Groovydoc>getAnnotation(Groovydoc.class)).value(); - } - /** * Get runtime groovydoc * @param holder the groovydoc hold * @return runtime groovydoc * @since 2.6.0 */ - public static String getGroovydoc(Field holder) { + public static String getGroovydoc(AnnotatedElement holder) { return holder.<Groovydoc>getAnnotation(Groovydoc.class).value(); } }