You are viewing a plain text version of this content. The canonical link for it is here.
Posted to doxia-commits@maven.apache.org by lt...@apache.org on 2008/03/11 13:46:06 UTC

svn commit: r635901 - in /maven/doxia/doxia-tools/trunk/doxia-linkcheck/src: main/java/org/apache/maven/doxia/linkcheck/validation/LinkValidatorManager.java test/java/org/apache/maven/doxia/linkcheck/LinkCheckTest.java

Author: ltheussl
Date: Tue Mar 11 05:46:02 2008
New Revision: 635901

URL: http://svn.apache.org/viewvc?rev=635901&view=rev
Log:
[DOXIA-216] When an empty String was added to the excludes (possible during relative-path resolution) any link was reported valid because the pattern always matched. There is still a problem with local links that needs to be resolved, added a test case.

Modified:
    maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/LinkValidatorManager.java
    maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/test/java/org/apache/maven/doxia/linkcheck/LinkCheckTest.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=635901&r1=635900&r2=635901&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 Tue Mar 11 05:46:02 2008
@@ -374,6 +374,11 @@
 
     protected static boolean matchPattern( String link, String pattern )
     {
+        if ( StringUtils.isEmpty( pattern ) )
+        {
+            return StringUtils.isEmpty( link );
+        }
+
         if ( pattern.indexOf( '*' ) == -1 )
         {
             if ( pattern.endsWith( "/" ) )

Modified: maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/test/java/org/apache/maven/doxia/linkcheck/LinkCheckTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/test/java/org/apache/maven/doxia/linkcheck/LinkCheckTest.java?rev=635901&r1=635900&r2=635901&view=diff
==============================================================================
--- maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/test/java/org/apache/maven/doxia/linkcheck/LinkCheckTest.java (original)
+++ maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/test/java/org/apache/maven/doxia/linkcheck/LinkCheckTest.java Tue Mar 11 05:46:02 2008
@@ -93,6 +93,9 @@
         // There are 805 distinct links in this page
         check( map, "index-all.html", 805 );
 
+        // FIXME: this fails because the local (anchor) link is reported as valid, why?
+        //ftc = (LinkcheckFile) map.get( "testA.html" );
+        //assertEquals( "Non-existent links", 0, ftc.getSuccessful() );
     }
 
     private void check( Map map, String name, int linkCount )