groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject [20/21] groovy git commit: GROOVY-8025: Using closures with annotations on Spock classes results in Groovydoc exception (partial fix only)
Date Wed, 21 Dec 2016 12:01:02 GMT
GROOVY-8025: Using closures with annotations on Spock classes results in Groovydoc exception
(partial fix only)


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

Branch: refs/heads/parrot
Commit: 7dbeb825c933f65e0006f21907c21e45941b0448
Parents: 9172867
Author: paulk <paulk@asert.com.au>
Authored: Tue Dec 20 18:52:02 2016 +1000
Committer: paulk <paulk@asert.com.au>
Committed: Tue Dec 20 18:52:02 2016 +1000

----------------------------------------------------------------------
 src/main/org/codehaus/groovy/antlr/SourceBuffer.java             | 1 +
 .../groovy/tools/groovydoc/SimpleGroovyClassDocAssembler.java    | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/7dbeb825/src/main/org/codehaus/groovy/antlr/SourceBuffer.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/antlr/SourceBuffer.java b/src/main/org/codehaus/groovy/antlr/SourceBuffer.java
index 9f2601e..1d7f38b 100644
--- a/src/main/org/codehaus/groovy/antlr/SourceBuffer.java
+++ b/src/main/org/codehaus/groovy/antlr/SourceBuffer.java
@@ -75,6 +75,7 @@ public class SourceBuffer {
                 if (startColumn < 1) { startColumn = 1;}
                 if (endColumn > line.length()) { endColumn = line.length() + 1;}
                 if (endColumn < 1) { endColumn = 1;}
+                if (endColumn < startColumn) { endColumn = startColumn;}
 
                 line = line.substring(startColumn - 1, endColumn - 1);
             } else {

http://git-wip-us.apache.org/repos/asf/groovy/blob/7dbeb825/subprojects/groovy-groovydoc/src/main/java/org/codehaus/groovy/tools/groovydoc/SimpleGroovyClassDocAssembler.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-groovydoc/src/main/java/org/codehaus/groovy/tools/groovydoc/SimpleGroovyClassDocAssembler.java
b/subprojects/groovy-groovydoc/src/main/java/org/codehaus/groovy/tools/groovydoc/SimpleGroovyClassDocAssembler.java
index a178a92..7439ea7 100644
--- a/subprojects/groovy-groovydoc/src/main/java/org/codehaus/groovy/tools/groovydoc/SimpleGroovyClassDocAssembler.java
+++ b/subprojects/groovy-groovydoc/src/main/java/org/codehaus/groovy/tools/groovydoc/SimpleGroovyClassDocAssembler.java
@@ -986,7 +986,9 @@ public class SimpleGroovyClassDocAssembler extends VisitorAdapter implements
Gro
     private SimpleGroovyClassDoc getCurrentClassDoc() {
         if (stack.isEmpty()) return null;
         GroovySourceAST node = getParentNode();
-        if (isTopLevelConstruct(node)) return foundClasses.get(getIdentFor(node));
+        if (isTopLevelConstruct(node) && foundClasses != null) {
+            return foundClasses.get(getIdentFor(node));
+        }
         GroovySourceAST saved = stack.pop();
         SimpleGroovyClassDoc result = getCurrentClassDoc();
         stack.push(saved);


Mime
View raw message