maven-doxia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vsive...@apache.org
Subject svn commit: r799838 - in /maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck: ./ validation/
Date Sat, 01 Aug 2009 11:23:24 GMT
Author: vsiveton
Date: Sat Aug  1 11:23:24 2009
New Revision: 799838

URL: http://svn.apache.org/viewvc?rev=799838&view=rev
Log:
o fixed checkstyle

Modified:
    maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/DefaultLinkCheck.java
    maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/LinkMatcher.java
    maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/FileLinkValidator.java
    maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/HTTPLinkValidator.java
    maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/LinkValidationResult.java
    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/main/java/org/apache/maven/doxia/linkcheck/validation/MailtoLinkValidator.java
    maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/OfflineHTTPLinkValidator.java

Modified: maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/DefaultLinkCheck.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/DefaultLinkCheck.java?rev=799838&r1=799837&r2=799838&view=diff
==============================================================================
--- maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/DefaultLinkCheck.java
(original)
+++ maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/DefaultLinkCheck.java
Sat Aug  1 11:23:24 2009
@@ -191,9 +191,9 @@
     }
 
     /** {@inheritDoc} */
-    public void setReportOutputEncoding( String encoding )
+    public void setReportOutputEncoding( String enc )
     {
-        this.reportOutputEncoding = encoding;
+        this.reportOutputEncoding = enc;
     }
 
     /** {@inheritDoc} */
@@ -460,7 +460,8 @@
 
                     if ( getExcludedPages() != null )
                     {
-                        String diff = StringUtils.difference( getBasedir().getAbsolutePath(),
file.getAbsolutePath() );
+                        String diff =
+                            StringUtils.difference( getBasedir().getAbsolutePath(), file.getAbsolutePath()
);
                         if ( diff.startsWith( File.separator ) )
                         {
                             diff = diff.substring( 1 );
@@ -480,7 +481,8 @@
                     String fileRelativePath = file.getAbsolutePath();
                     if ( fileRelativePath.startsWith( this.basedir.getAbsolutePath() ) )
                     {
-                        fileRelativePath = fileRelativePath.substring( this.basedir.getAbsolutePath().length()
+ 1 );
+                        fileRelativePath =
+                            fileRelativePath.substring( this.basedir.getAbsolutePath().length()
+ 1 );
                     }
                     fileRelativePath = fileRelativePath.replace( '\\', '/' );
 
@@ -587,8 +589,8 @@
                     {
                         HTTPLinkValidationResult httpResult = (HTTPLinkValidationResult)
result;
 
-
-                        if ( httpResult.getHttpStatusCode() > 0 && getExcludedHttpStatusErrors()
!= null
+                        if ( httpResult.getHttpStatusCode() > 0
+                            && getExcludedHttpStatusErrors() != null
                             && StringUtils.indexOfAny( String.valueOf( httpResult.getHttpStatusCode()
),
                                                        toStringArray( getExcludedHttpStatusErrors()
) ) >= 0 )
                         {
@@ -616,7 +618,8 @@
                     {
                         HTTPLinkValidationResult httpResult = (HTTPLinkValidationResult)
result;
 
-                        if ( httpResult.getHttpStatusCode() > 0 && getExcludedHttpStatusWarnings()
!= null
+                        if ( httpResult.getHttpStatusCode() > 0
+                            && getExcludedHttpStatusWarnings() != null
                             && StringUtils.indexOfAny( String.valueOf( httpResult.getHttpStatusCode()
),
                                                        toStringArray( getExcludedHttpStatusWarnings()
) ) >= 0 )
                         {
@@ -664,7 +667,8 @@
         if ( LOG.isDebugEnabled() )
         {
             Runtime r = Runtime.getRuntime();
-            LOG.debug( "Memory: " + ( r.totalMemory() - r.freeMemory() ) / MEG + "M/" + r.totalMemory()
/ MEG + "M" );
+            LOG.debug( "Memory: " + ( r.totalMemory() - r.freeMemory() ) / MEG + "M/" + r.totalMemory()
/ MEG
+                + "M" );
         }
     }
 
@@ -697,8 +701,8 @@
         catch ( IllegalStateException e )
         {
             IOException ioe =
-                new IOException( e.getMessage() + " Maybe try to specify an other encoding
instead of '" + encoding
-                    + "'." );
+                new IOException( e.getMessage() + " Maybe try to specify an other encoding
instead of '"
+                    + encoding + "'." );
             ioe.initCause( e );
             throw ioe;
         }

Modified: maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/LinkMatcher.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/LinkMatcher.java?rev=799838&r1=799837&r2=799838&view=diff
==============================================================================
--- maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/LinkMatcher.java
(original)
+++ maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/LinkMatcher.java
Sat Aug  1 11:23:24 2009
@@ -67,7 +67,8 @@
      * @return a StringBuffer with file's contents.
      * @throws IOException if something goes wrong.
      */
-    private static StringBuffer fileToStringBuffer( File file, String encoding ) throws IOException
+    private static StringBuffer fileToStringBuffer( File file, String encoding )
+        throws IOException
     {
         final StringBuffer pageBuffer = new StringBuffer();
 
@@ -75,7 +76,7 @@
         Reader r = null;
         try
         {
-            r = ReaderFactory.newReader( file, encoding ) ;
+            r = ReaderFactory.newReader( file, encoding );
             reader = new BufferedReader( r );
 
             String line;
@@ -101,7 +102,8 @@
      * @return a set with all links to check
      * @throws IOException if something goes wrong
      */
-    static Set match( File file, String encoding ) throws IOException
+    static Set match( File file, String encoding )
+        throws IOException
     {
         LINK_LIST.clear();
 

Modified: maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/FileLinkValidator.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/FileLinkValidator.java?rev=799838&r1=799837&r2=799838&view=diff
==============================================================================
--- maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/FileLinkValidator.java
(original)
+++ maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/FileLinkValidator.java
Sat Aug  1 11:23:24 2009
@@ -37,7 +37,8 @@
  * @author <a href="mailto:aheritier@apache.org">Arnaud Heritier</a>
  * @version $Id$
  */
-public final class FileLinkValidator implements LinkValidator
+public final class FileLinkValidator
+    implements LinkValidator
 {
     private String encoding;
 
@@ -74,8 +75,8 @@
         // If we find an http(s) link or a mail link, it's not good
         // links starting with "/" should have a base URL pre-pended and be handled by OnlineHTTPLinkValidator.
         if ( link.toLowerCase( Locale.ENGLISH ).startsWith( "http://" )
-            || link.toLowerCase( Locale.ENGLISH ).startsWith( "https://" )
-            || link.indexOf( '@' ) != -1 || link.startsWith( "/" ) )
+            || link.toLowerCase( Locale.ENGLISH ).startsWith( "https://" ) || link.indexOf(
'@' ) != -1
+            || link.startsWith( "/" ) )
         {
             return null;
         }

Modified: maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/HTTPLinkValidator.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/HTTPLinkValidator.java?rev=799838&r1=799837&r2=799838&view=diff
==============================================================================
--- maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/HTTPLinkValidator.java
(original)
+++ maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/HTTPLinkValidator.java
Sat Aug  1 11:23:24 2009
@@ -28,7 +28,8 @@
  * @author <a href="mailto:aheritier@apache.org">Arnaud Heritier</a>
  * @version $Id$
  */
-public abstract class HTTPLinkValidator implements LinkValidator
+public abstract class HTTPLinkValidator
+    implements LinkValidator
 {
     /** {@inheritDoc} */
     public Object getResourceKey( LinkValidationItem lvi )
@@ -36,8 +37,7 @@
         String link = lvi.getLink();
 
         if ( !link.toLowerCase( Locale.ENGLISH ).startsWith( "http://" )
-            && !link.toLowerCase( Locale.ENGLISH ).startsWith( "https://" )
-            && !link.startsWith( "/" ) )
+            && !link.toLowerCase( Locale.ENGLISH ).startsWith( "https://" ) &&
!link.startsWith( "/" ) )
         {
             return null;
         }

Modified: maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/LinkValidationResult.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/LinkValidationResult.java?rev=799838&r1=799837&r2=799838&view=diff
==============================================================================
--- maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/LinkValidationResult.java
(original)
+++ maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/LinkValidationResult.java
Sat Aug  1 11:23:24 2009
@@ -29,7 +29,8 @@
  * @author <a href="mailto:aheritier@apache.org">Arnaud Heritier</a>
  * @version $Id$
  */
-public class LinkValidationResult implements Serializable
+public class LinkValidationResult
+    implements Serializable
 {
     /** serialVersionUID. */
     private static final long serialVersionUID = -8346824125135406813L;

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=799838&r1=799837&r2=799838&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
Sat Aug  1 11:23:24 2009
@@ -185,7 +185,8 @@
             LOG.error( "Unable to validate link : " + lvi.getLink() );
         }
 
-        return new LinkValidationResult( LinkcheckFileResult.UNKNOWN_LEVEL, false, "No validator
found for this link" );
+        return new LinkValidationResult( LinkcheckFileResult.UNKNOWN_LEVEL, false,
+                                         "No validator found for this link" );
     }
 
     /**
@@ -303,7 +304,7 @@
                 if ( LOG.isDebugEnabled() )
                 {
                     LOG.debug( "[" + resourceKey + "] with result [" + this.cache.get( resourceKey
)
-                                    + "] is stored in the cache." );
+                        + "] is stored in the cache." );
                 }
             }
         }
@@ -363,7 +364,7 @@
                 if ( LOG.isDebugEnabled() )
                 {
                     LOG.debug( "The cache returns for [" + resourceKey + "] the result ["
-                                            + this.cache.get( resourceKey ) + "]." );
+                        + this.cache.get( resourceKey ) + "]." );
                 }
 
                 return (LinkValidationResult) this.cache.get( resourceKey );
@@ -388,6 +389,11 @@
         this.cache.put( resourceKey, lvr );
     }
 
+    /**
+     * @param link not null
+     * @param pattern not null
+     * @return true if pattern match
+     */
     protected static boolean matchPattern( String link, String pattern )
     {
         if ( StringUtils.isEmpty( pattern ) )

Modified: maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/MailtoLinkValidator.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/MailtoLinkValidator.java?rev=799838&r1=799837&r2=799838&view=diff
==============================================================================
--- maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/MailtoLinkValidator.java
(original)
+++ maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/MailtoLinkValidator.java
Sat Aug  1 11:23:24 2009
@@ -28,7 +28,8 @@
  * @author <a href="mailto:aheritier@apache.org">Arnaud Heritier</a>
  * @version $Id$
  */
-public final class MailtoLinkValidator implements LinkValidator
+public final class MailtoLinkValidator
+    implements LinkValidator
 {
     /** The (unique) LinkValidationResult to be returned by this LinkValidator. */
     private static final LinkValidationResult LVR =

Modified: maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/OfflineHTTPLinkValidator.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/OfflineHTTPLinkValidator.java?rev=799838&r1=799837&r2=799838&view=diff
==============================================================================
--- maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/OfflineHTTPLinkValidator.java
(original)
+++ maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/OfflineHTTPLinkValidator.java
Sat Aug  1 11:23:24 2009
@@ -27,14 +27,13 @@
  * @author <a href="mailto:aheritier@apache.org">Arnaud Heritier</a>
  * @version $Id$
  */
-public final class OfflineHTTPLinkValidator extends HTTPLinkValidator
+public final class OfflineHTTPLinkValidator
+    extends HTTPLinkValidator
 {
-
     /** {@inheritDoc} */
     public LinkValidationResult validateLink( LinkValidationItem lvi )
     {
         return new LinkValidationResult( LinkcheckFileResult.WARNING_LEVEL, false,
                                          "Maven is offline. Link not checked." );
     }
-
 }



Mime
View raw message