maven-doxia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ltheu...@apache.org
Subject svn commit: r1003039 - /maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/LinkValidatorManager.java
Date Thu, 30 Sep 2010 12:30:38 GMT
Author: ltheussl
Date: Thu Sep 30 12:30:38 2010
New Revision: 1003039

URL: http://svn.apache.org/viewvc?rev=1003039&view=rev
Log:
[MLINKCHECK-6] IllegalArgumentException for some URIs

Modified:
    maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/LinkValidatorManager.java

Modified: maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/LinkValidatorManager.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/LinkValidatorManager.java?rev=1003039&r1=1003038&r2=1003039&view=diff
==============================================================================
--- maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/LinkValidatorManager.java
(original)
+++ maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/LinkValidatorManager.java
Thu Sep 30 12:30:38 2010
@@ -34,7 +34,10 @@ import java.io.InvalidClassException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.Serializable;
+
 import java.net.URI;
+import java.net.URISyntaxException;
+
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.LinkedList;
@@ -393,11 +396,18 @@ public class LinkValidatorManager
             return link.indexOf( pattern ) != -1;
         }
 
-        URI uri = URI.create( link );
+        try
+        {
+            URI uri = new URI( link );
 
-        if ( uri.getScheme() != null && !pattern.startsWith( uri.getScheme() ) )
+            if ( uri.getScheme() != null && !pattern.startsWith( uri.getScheme()
) )
+            {
+                return true;
+            }
+        }
+        catch ( URISyntaxException ex )
         {
-            return true;
+            LOG.debug( "Trying to check link to illegal URI: " + link, ex );
         }
 
         if ( pattern.matches( "\\*+/?.*" ) && !link.startsWith( "/" ) &&
!link.startsWith( "./" ) )



Mime
View raw message