Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_5_X 1c5d81180 -> 40eb8f6ff


GROOVY-8876: groovydoc fails with "java.lang.StringIndexOutOfBoundsException: 
String index out of range: -1" on file with no extension


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

Branch: refs/heads/GROOVY_2_5_X
Commit: 40eb8f6ff6c556bf76cca6c0163c633186321467
Parents: 1c5d811
Author: Paul King <pa...@asert.com.au>
Authored: Tue Nov 20 09:15:17 2018 +1000
Committer: Paul King <pa...@asert.com.au>
Committed: Tue Nov 20 09:16:20 2018 +1000

----------------------------------------------------------------------
 .../groovy/tools/groovydoc/SimpleGroovyClassDocAssembler.java      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/40eb8f6f/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 3796f46..6da231e 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
@@ -71,7 +71,7 @@ public class SimpleGroovyClassDocAssembler extends 
VisitorAdapter implements Gro
 
         stack = new Stack<GroovySourceAST>();
         classDocs = new LinkedHashMap<String, GroovyClassDoc>();
-        if (file != null) {
+        if (file != null && file.contains(".")) {
             // todo: replace this simple idea of default class name
             int idx = file.lastIndexOf(".");
             className = file.substring(0, idx);

Reply via email to