maven-doxia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r709894 - in /maven/doxia/doxia-tools/trunk: doxia-converter/src/main/java/org/apache/maven/doxia/ doxia-converter/src/main/java/org/apache/maven/doxia/cli/ doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/ doxia-linkcheck/src...
Date Sun, 02 Nov 2008 16:42:07 GMT
Author: hboutemy
Date: Sun Nov  2 08:42:06 2008
New Revision: 709894

URL: http://svn.apache.org/viewvc?rev=709894&view=rev
Log:
fixed errors reported by Checkstyle

Modified:
    maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/Converter.java
    maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/DefaultConverter.java
    maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/cli/CLIManager.java
    maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/cli/ConverterCli.java
    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/LinkCheck.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/MailtoLinkValidator.java
    maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/OfflineHTTPLinkValidator.java
    maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/OnlineHTTPLinkValidator.java

Modified: maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/Converter.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/Converter.java?rev=709894&r1=709893&r2=709894&view=diff
==============================================================================
--- maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/Converter.java
(original)
+++ maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/Converter.java
Sun Nov  2 08:42:06 2008
@@ -1,3 +1,5 @@
+package org.apache.maven.doxia;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -16,7 +18,6 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.maven.doxia;
 
 import org.apache.maven.doxia.logging.LogEnabled;
 import org.apache.maven.doxia.wrapper.InputFileWrapper;

Modified: maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/DefaultConverter.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/DefaultConverter.java?rev=709894&r1=709893&r2=709894&view=diff
==============================================================================
--- maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/DefaultConverter.java
(original)
+++ maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/DefaultConverter.java
Sun Nov  2 08:42:06 2008
@@ -1,3 +1,5 @@
+package org.apache.maven.doxia;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -16,7 +18,6 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.maven.doxia;
 
 import java.io.BufferedInputStream;
 import java.io.CharArrayWriter;
@@ -115,7 +116,8 @@
 
     /** Supported output format, i.e. supported Doxia Sink */
     public static final String[] SUPPORTED_TO_FORMAT =
-        { APT_SINK, CONFLUENCE_SINK, DOCBOOK_SINK, FO_SINK, ITEXT_SINK, LATEX_SINK, RTF_SINK,
TWIKI_SINK, XDOC_SINK, XHTML_SINK };
+        { APT_SINK, CONFLUENCE_SINK, DOCBOOK_SINK, FO_SINK, ITEXT_SINK, LATEX_SINK, RTF_SINK,
TWIKI_SINK, XDOC_SINK,
+            XHTML_SINK };
 
     /** Flag to format the generated files, actually only for XML based sinks. */
     private boolean formatOutput;

Modified: maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/cli/CLIManager.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/cli/CLIManager.java?rev=709894&r1=709893&r2=709894&view=diff
==============================================================================
--- maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/cli/CLIManager.java
(original)
+++ maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/cli/CLIManager.java
Sun Nov  2 08:42:06 2008
@@ -1,3 +1,5 @@
+package org.apache.maven.doxia.cli;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -16,7 +18,6 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.maven.doxia.cli;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -71,37 +72,36 @@
     /** e character */
     static final char ERRORS = 'e';
 
-    private static final Options options;
+    private static final Options OPTIONS;
 
     static
     {
-        options = new Options();
+        OPTIONS = new Options();
 
-        options.addOption( OptionBuilder.withLongOpt( "help" ).withDescription( "Display
help information." )
+        OPTIONS.addOption( OptionBuilder.withLongOpt( "help" ).withDescription( "Display
help information." )
                                         .create( HELP ) );
-        options.addOption( OptionBuilder.withLongOpt( "version" ).withDescription( "Display
version information." )
+        OPTIONS.addOption( OptionBuilder.withLongOpt( "version" ).withDescription( "Display
version information." )
                                         .create( VERSION ) );
 
-        options.addOption( OptionBuilder.withLongOpt( "input" ).withDescription( "Input file
or directory." )
+        OPTIONS.addOption( OptionBuilder.withLongOpt( "input" ).withDescription( "Input file
or directory." )
                                         .hasArg().create( IN ) );
-        options.addOption( OptionBuilder.withLongOpt( "output" ).withDescription( "Output
file or directory." )
+        OPTIONS.addOption( OptionBuilder.withLongOpt( "output" ).withDescription( "Output
file or directory." )
                                         .hasArg().create( OUT ) );
-        options.addOption( OptionBuilder.withDescription( "From format. If not specified,
try to autodetect it." )
+        OPTIONS.addOption( OptionBuilder.withDescription( "From format. If not specified,
try to autodetect it." )
                                         .hasArg().create( FROM ) );
-        options.addOption( OptionBuilder.withDescription( "To format." ).hasArg().create(
TO ) );
-        options.addOption( OptionBuilder.withLongOpt( "inputEncoding" )
-                                        .withDescription(
-                                                          "Input file encoding. "
+        OPTIONS.addOption( OptionBuilder.withDescription( "To format." ).hasArg().create(
TO ) );
+        OPTIONS.addOption( OptionBuilder.withLongOpt( "inputEncoding" )
+                                        .withDescription( "Input file encoding. "
                                                               + "If not specified, try to
autodetect it." )
                                         .hasArg().create( INENCODING ) );
-        options.addOption( OptionBuilder.withLongOpt( "format" )
-                           .withDescription(
-                                             "Format the output (actually only xml based
outputs) to be human readable." )
+        OPTIONS.addOption( OptionBuilder.withLongOpt( "format" )
+                           .withDescription( "Format the output (actually only xml based
outputs) "
+                                             + " to be human readable." )
                            .create( FORMAT ) );
 
-        options.addOption( OptionBuilder.withLongOpt( "debug" )
+        OPTIONS.addOption( OptionBuilder.withLongOpt( "debug" )
                                         .withDescription( "Produce execution debug output."
).create( DEBUG ) );
-        options.addOption( OptionBuilder.withLongOpt( "errors" )
+        OPTIONS.addOption( OptionBuilder.withLongOpt( "errors" )
                                         .withDescription( "Produce execution error messages."
).create( ERRORS ) );
     }
 
@@ -123,7 +123,7 @@
         String[] cleanArgs = cleanArgs( args );
 
         CommandLineParser parser = new GnuParser();
-        return parser.parse( options, cleanArgs );
+        return parser.parse( OPTIONS, cleanArgs );
     }
 
     static void displayHelp()
@@ -132,7 +132,7 @@
 
         HelpFormatter formatter = new HelpFormatter();
         formatter.printHelp( "doxia [options] -in <arg> [-from <arg>] [-inEncoding
<arg>] -out <arg> "
-            + "-to <arg>\n", "\nOptions:", options, getSupportedFormatAndEncoding()
);
+            + "-to <arg>\n", "\nOptions:", OPTIONS, getSupportedFormatAndEncoding()
);
     }
 
     private static String getSupportedFormatAndEncoding()

Modified: maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/cli/ConverterCli.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/cli/ConverterCli.java?rev=709894&r1=709893&r2=709894&view=diff
==============================================================================
--- maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/cli/ConverterCli.java
(original)
+++ maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/cli/ConverterCli.java
Sun Nov  2 08:42:06 2008
@@ -1,3 +1,5 @@
+package org.apache.maven.doxia.cli;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -16,7 +18,6 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.maven.doxia.cli;
 
 import java.io.FileNotFoundException;
 import java.io.IOException;

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=709894&r1=709893&r2=709894&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
Sun Nov  2 08:42:06 2008
@@ -278,7 +278,7 @@
     {
         if ( StringUtils.isEmpty( encoding ) )
         {
-            throw new IllegalArgumentException( "encoding is required");
+            throw new IllegalArgumentException( "encoding is required" );
         }
         try
         {
@@ -583,9 +583,9 @@
                     break;
                 case LinkcheckFileResult.ERROR_LEVEL:
                     boolean ignoredError = false;
-                    if ( result instanceof HTTPLinkValidationResult)
+                    if ( result instanceof HTTPLinkValidationResult )
                     {
-                        HTTPLinkValidationResult httpResult = (HTTPLinkValidationResult)result;
+                        HTTPLinkValidationResult httpResult = (HTTPLinkValidationResult)
result;
 
 
                         if ( httpResult.getHttpStatusCode() > 0 && getExcludedHttpStatusErrors()
!= null
@@ -596,7 +596,7 @@
                         }
                     }
 
-                    if (ignoredError)
+                    if ( ignoredError )
                     {
                         linkcheckFile.setSuccessful( linkcheckFile.getSuccessful() + 1 );
                     }
@@ -612,9 +612,9 @@
                     break;
                 case LinkcheckFileResult.WARNING_LEVEL:
                     boolean ignoredWarning = false;
-                    if ( result instanceof HTTPLinkValidationResult)
+                    if ( result instanceof HTTPLinkValidationResult )
                     {
-                        HTTPLinkValidationResult httpResult = (HTTPLinkValidationResult)result;
+                        HTTPLinkValidationResult httpResult = (HTTPLinkValidationResult)
result;
 
                         if ( httpResult.getHttpStatusCode() > 0 && getExcludedHttpStatusWarnings()
!= null
                             && StringUtils.indexOfAny( String.valueOf( httpResult.getHttpStatusCode()
),
@@ -624,7 +624,7 @@
                         }
                     }
 
-                    if (ignoredWarning)
+                    if ( ignoredWarning )
                     {
                         linkcheckFile.setSuccessful( linkcheckFile.getSuccessful() + 1 );
                     }
@@ -739,7 +739,8 @@
                 return true;
             }
 
-            if ( name.toLowerCase( Locale.ENGLISH ).endsWith( ".html" ) || name.toLowerCase(
Locale.ENGLISH ).endsWith( ".htm" ) )
+            if ( name.toLowerCase( Locale.ENGLISH ).endsWith( ".html" )
+                || name.toLowerCase( Locale.ENGLISH ).endsWith( ".htm" ) )
             {
                 return true;
             }

Modified: maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/LinkCheck.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/LinkCheck.java?rev=709894&r1=709893&r2=709894&view=diff
==============================================================================
--- maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/LinkCheck.java
(original)
+++ maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/LinkCheck.java
Sun Nov  2 08:42:06 2008
@@ -39,14 +39,14 @@
      *
      * @param base the base directory
      */
-    public void setBasedir( File base );
+    void setBasedir( File base );
 
     /**
-     * Sets the base URL. This is pre-pended to links that start with '/'.
+     * Sets the base URL. This is prepended to links that start with '/'.
      *
      * @param url the base URL.
      */
-    public void setBaseURL( String url );
+    void setBaseURL( String url );
 
     /**
      * Sets the excluded HTTP errors, i.e. <code>404</code>, a int[] with excluded
errors.
@@ -54,7 +54,7 @@
      * @param excl The excludes to set
      * @see {@link HttpStatus} for all possible values.
      */
-    public void setExcludedHttpStatusErrors( int[] excl );
+    void setExcludedHttpStatusErrors( int[] excl );
 
     /**
      * Sets the excluded HTTP warnings, i.e. <code>301</code>, a int[] with excluded
errors.
@@ -62,7 +62,7 @@
      * @param excl The excludes to set
      * @see {@link HttpStatus} for all possible values.
      */
-    public void setExcludedHttpStatusWarnings( int[] excl );
+    void setExcludedHttpStatusWarnings( int[] excl );
 
     /**
      * Sets the excluded links, a String[] with excluded locations.
@@ -71,35 +71,35 @@
      *
      * @param excl The excludes to set
      */
-    public void setExcludedLinks( String[] excl );
+    void setExcludedLinks( String[] excl );
 
     /**
      * Sets the excluded pages, a String[] with excluded locations.
      *
      * @param excl The excludes to set
      */
-    public void setExcludedPages( String[] excl );
+    void setExcludedPages( String[] excl );
 
     /**
      * Sets the http parameters bean.
      *
      * @param http parameters bean.
      */
-    public void setHttp( HttpBean http );
+    void setHttp( HttpBean http );
 
     /**
      * Sets the cache File.
      *
      * @param cacheFile The cacheFile to set. Set this to null to ignore storing the cache.
      */
-    public void setLinkCheckCache( File cacheFile );
+    void setLinkCheckCache( File cacheFile );
 
     /**
      * Set the online mode.
      *
      * @param onLine online mode.
      */
-    public void setOnline( boolean onLine );
+    void setOnline( boolean onLine );
 
     /**
      * Set the output file for the results.
@@ -107,14 +107,14 @@
      *
      * @param file the output file.
      */
-    public void setReportOutput( File file );
+    void setReportOutput( File file );
 
     /**
      * Sets the outputEncoding.
      *
      * @param encoding The outputEncoding to set.
      */
-    public void setReportOutputEncoding( String encoding );
+    void setReportOutputEncoding( String encoding );
 
     /**
      * Execute the link check. The basedir <b>should</b> be set before.
@@ -123,7 +123,7 @@
      * @throws LinkCheckException if any
      * @see #setBasedir(File)
      */
-    public LinkcheckModel execute()
+    LinkcheckModel execute()
         throws LinkCheckException;
 
     /**
@@ -132,5 +132,5 @@
      * @param encoding a valid encoding
      * @see <a href="http://java.sun.com/j2se/1.4.2/docs/guide/intl/encoding.doc.html">Supported
encodings</a>
      */
-    public void setEncoding( String encoding );
+    void setEncoding( String encoding );
 }

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=709894&r1=709893&r2=709894&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
Sun Nov  2 08:42:06 2008
@@ -73,7 +73,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://" )
+        if ( link.toLowerCase( Locale.ENGLISH ).startsWith( "http://" ) 
+            || 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=709894&r1=709893&r2=709894&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
Sun Nov  2 08:42:06 2008
@@ -35,7 +35,8 @@
     {
         String link = lvi.getLink();
 
-        if ( !link.toLowerCase( Locale.ENGLISH ).startsWith( "http://" ) && !link.toLowerCase(
Locale.ENGLISH ).startsWith( "https://" )
+        if ( !link.toLowerCase( Locale.ENGLISH ).startsWith( "http://" )
+            && !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/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=709894&r1=709893&r2=709894&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
Sun Nov  2 08:42:06 2008
@@ -31,7 +31,8 @@
 public final class MailtoLinkValidator implements LinkValidator
 {
     /** The (unique) LinkValidationResult to be returned by this LinkValidator. */
-    private static final LinkValidationResult LVR = new LinkValidationResult( LinkcheckFileResult.VALID_LEVEL,
false, "" );
+    private static final LinkValidationResult LVR =
+        new LinkValidationResult( LinkcheckFileResult.VALID_LEVEL, false, "" );
 
     /** {@inheritDoc} */
     public LinkValidationResult validateLink( LinkValidationItem lvi )

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=709894&r1=709893&r2=709894&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
Sun Nov  2 08:42:06 2008
@@ -33,7 +33,8 @@
     /** {@inheritDoc} */
     public LinkValidationResult validateLink( LinkValidationItem lvi )
     {
-        return new LinkValidationResult( LinkcheckFileResult.WARNING_LEVEL, false, "Maven
is offline. Link not checked." );
+        return new LinkValidationResult( LinkcheckFileResult.WARNING_LEVEL, false,
+                                         "Maven is offline. Link not checked." );
     }
 
 }

Modified: maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/OnlineHTTPLinkValidator.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/OnlineHTTPLinkValidator.java?rev=709894&r1=709893&r2=709894&view=diff
==============================================================================
--- maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/OnlineHTTPLinkValidator.java
(original)
+++ maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/OnlineHTTPLinkValidator.java
Sun Nov  2 08:42:06 2008
@@ -175,26 +175,29 @@
 
             if ( hm == null )
             {
-                return new LinkValidationResult( LinkcheckFileResult.ERROR_LEVEL, false,
"Cannot retreive HTTP Status" );
+                return new LinkValidationResult( LinkcheckFileResult.ERROR_LEVEL, false,
+                                                 "Cannot retreive HTTP Status" );
             }
 
             if ( hm.getStatusCode() == HttpStatus.SC_OK )
             {
-                return new HTTPLinkValidationResult( LinkcheckFileResult.VALID_LEVEL, true,
hm.getStatusCode(), hm.getStatusText() );
-            }
+                return new HTTPLinkValidationResult( LinkcheckFileResult.VALID_LEVEL, true,
hm.getStatusCode(),
+                                                 hm.getStatusText() );
+        }
 
-            // If there's a redirection ... add a warning
-            if ( hm.getStatusCode() == HttpStatus.SC_MOVED_PERMANENTLY
-                            || hm.getStatusCode() == HttpStatus.SC_MOVED_TEMPORARILY
-                            || hm.getStatusCode() == HttpStatus.SC_TEMPORARY_REDIRECT )
+        // If there's a redirection ... add a warning
+        if ( hm.getStatusCode() == HttpStatus.SC_MOVED_PERMANENTLY
+                        || hm.getStatusCode() == HttpStatus.SC_MOVED_TEMPORARILY
+                        || hm.getStatusCode() == HttpStatus.SC_TEMPORARY_REDIRECT )
+        {
+            if ( LOG.isWarnEnabled() )
             {
-                if ( LOG.isWarnEnabled() )
-                {
-                    LOG.warn( "Received: [" + hm.getStatusCode() + "] for [" + link + "]
in page [" + lvi.getSource()
+                LOG.warn( "Received: [" + hm.getStatusCode() + "] for [" + link + "] in page
[" + lvi.getSource()
                         + "]" );
                 }
 
-                return new HTTPLinkValidationResult( LinkcheckFileResult.WARNING_LEVEL, true,
hm.getStatusCode(), hm.getStatusText() );
+                return new HTTPLinkValidationResult( LinkcheckFileResult.WARNING_LEVEL, true,
hm.getStatusCode(),
+                                                     hm.getStatusText() );
             }
 
             if ( LOG.isDebugEnabled() )
@@ -203,7 +206,8 @@
                     + "]" );
             }
 
-            return new HTTPLinkValidationResult( LinkcheckFileResult.ERROR_LEVEL, false,
hm.getStatusCode(), hm.getStatusText() );
+            return new HTTPLinkValidationResult( LinkcheckFileResult.ERROR_LEVEL, false,
hm.getStatusCode(),
+                                                 hm.getStatusText() );
 
         }
         catch ( Throwable t )



Mime
View raw message