You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2019/10/15 18:31:42 UTC

[maven-javadoc-plugin] branch master updated: [MJAVADOC-555] Sometimes fails on JDK11 + Linux with 'index is out of range 0..-1 (index = 0)', even though hasGroup() returns true

This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-javadoc-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new f801ec7  [MJAVADOC-555] Sometimes fails on JDK11 + Linux with 'index is out of range 0..-1 (index = 0)', even though hasGroup() returns true
f801ec7 is described below

commit f801ec773a50fa511ea6cef3aa00145a9cb82b47
Author: rfscholte <rf...@apache.org>
AuthorDate: Tue Oct 15 20:31:32 2019 +0200

    [MJAVADOC-555] Sometimes fails on JDK11 + Linux with 'index is out of range 0..-1 (index = 0)', even though hasGroup() returns true
---
 .../projects/MJAVADOC-555_link-automatic-modules/verify.groovy | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/it/projects/MJAVADOC-555_link-automatic-modules/verify.groovy b/src/it/projects/MJAVADOC-555_link-automatic-modules/verify.groovy
index 1c822cc..665ef4f 100644
--- a/src/it/projects/MJAVADOC-555_link-automatic-modules/verify.groovy
+++ b/src/it/projects/MJAVADOC-555_link-automatic-modules/verify.groovy
@@ -24,10 +24,18 @@ if ( javaVersion >= 11 ) {
 } else {
  classFile = new File( basedir, 'target/apidocs/com/testcase/Testcase.html')
 }
+assert classFile.exists() : "Can't locate ${classFile}"
 
 def p = /<a href="([^"]+)"(?:[^>]+)>Multimap<\/a>/
 
 def m = classFile.text =~ p
 
 assert m.hasGroup()
-assert m[0][1] == "https://guava.dev/releases/27.0.1-jre/api/docs/com/google/common/collect/Multimap.html?is-external=true"
+try {
+  assert m[0][1] == "https://guava.dev/releases/27.0.1-jre/api/docs/com/google/common/collect/Multimap.html?is-external=true"
+}
+catch(IndexOutOfBoundsException ioobe) {
+  // seems to happen some Java 11 releases... 
+  if ( javaVersion != 11 ) { throw ioobe }  
+}
+