Repository: groovy
Updated Branches:
  refs/heads/master b7af0995f -> 3602dd940


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/3602dd94
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/3602dd94
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/3602dd94

Branch: refs/heads/master
Commit: 3602dd940d7538a97c9370fd1ab85480d7ea8a10
Parents: b7af099
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:15:17 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/3602dd94/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