groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject [2/3] groovy git commit: Add guard checking for `getGroovydoc`
Date Mon, 11 Sep 2017 14:29:16 GMT
Add guard checking for `getGroovydoc`

(cherry picked from commit a2fb76d)


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/6007654a
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/6007654a
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/6007654a

Branch: refs/heads/GROOVY_2_6_X
Commit: 6007654ad59cec1cdb40925adb477c6a912c4360
Parents: bd8e7e7
Author: sunlan <sunlan@apache.org>
Authored: Mon Sep 11 21:53:07 2017 +0800
Committer: sunlan <sunlan@apache.org>
Committed: Mon Sep 11 22:28:52 2017 +0800

----------------------------------------------------------------------
 src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/6007654a/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 1b8e803..f9e7bb6 100644
--- a/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
+++ b/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
@@ -18891,6 +18891,10 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport
{
      * @since 2.6.0
      */
     public static groovy.lang.groovydoc.Groovydoc getGroovydoc(AnnotatedElement holder) {
-        return new groovy.lang.groovydoc.Groovydoc(holder.<Groovydoc>getAnnotation(Groovydoc.class).value(),
holder);
+        Groovydoc groovydocAnnotation = holder.<Groovydoc>getAnnotation(Groovydoc.class);
+
+        return null == groovydocAnnotation
+                    ? null
+                    : new groovy.lang.groovydoc.Groovydoc(groovydocAnnotation.value(), holder);
     }
 }


Mime
View raw message