Author: ltheussl Date: Sun Jun 21 10:01:58 2009 New Revision: 786981 URL: http://svn.apache.org/viewvc?rev=786981&view=rev Log: Checkstyle fixes
Modified: maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/cli/ConverterCli.java maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/util/ConverterUtil.java maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/wrapper/AbstractFileWrapper.java maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/wrapper/AbstractWrapper.java maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/wrapper/InputFileWrapper.java maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/wrapper/InputReaderWrapper.java maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/wrapper/OutputFileWrapper.java maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/wrapper/OutputStreamWrapper.java 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=786981&r1=786980&r2=786981&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 Jun 21 10:01:58 2009 @@ -48,7 +48,7 @@ /** * Default main which terminates the JVM with <code>0</code> if no errors occurs. * - * @param args + * @param args command line args. * @see #doMain(String[]) * @see System#exit(int) */ Modified: maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/util/ConverterUtil.java URL: http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/util/ConverterUtil.java?rev=786981&r1=786980&r2=786981&view=diff ============================================================================== --- maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/util/ConverterUtil.java (original) +++ maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/util/ConverterUtil.java Sun Jun 21 10:01:58 2009 @@ -51,16 +51,19 @@ { throw new IllegalArgumentException( "plexus is required" ); } + if ( format == null ) { throw new IllegalArgumentException( "format is required" ); } + if ( supportedFormats == null ) { throw new IllegalArgumentException( "supportedFormats is required" ); } Parser parser = null; + for ( int i = 0; i < supportedFormats.length; i++ ) { if ( format.equalsIgnoreCase( supportedFormats[i] ) ) @@ -84,7 +87,7 @@ * @return an instance of <code>SinkFactory</code> depending on the given format. * @throws ComponentLookupException if could not find the SinkFactory for the given format. * @throws UnsupportedFormatException if the found sink is not instantiated. - * @throws IOException + * @throws IOException if any. * @throws IllegalArgumentException if any parameter is null */ public static SinkFactory getSinkFactory( PlexusContainer plexus, String format, String[] supportedFormats ) @@ -94,16 +97,19 @@ { throw new IllegalArgumentException( "plexus is required" ); } + if ( format == null ) { throw new IllegalArgumentException( "format is required" ); } + if ( supportedFormats == null ) { throw new IllegalArgumentException( "supportedFormats is required" ); } SinkFactory factory = null; + for ( int i = 0; i < supportedFormats.length; i++ ) { if ( format.equalsIgnoreCase( supportedFormats[i] ) ) Modified: maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/wrapper/AbstractFileWrapper.java URL: http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/wrapper/AbstractFileWrapper.java?rev=786981&r1=786980&r2=786981&view=diff ============================================================================== --- maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/wrapper/AbstractFileWrapper.java (original) +++ maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/wrapper/AbstractFileWrapper.java Sun Jun 21 10:01:58 2009 @@ -41,9 +41,6 @@ { public static final String AUTO_ENCODING = "auto"; - /** serialVersionUID */ - static final long serialVersionUID = 6072685230076158590L; - private File file; private String encoding; @@ -67,12 +64,12 @@ throw new IllegalArgumentException( "absolutePath is required" ); } - File file = new File( absolutePath ); - if ( !file.isAbsolute() ) + File filetoset = new File( absolutePath ); + if ( !filetoset.isAbsolute() ) { - file = new File( new File( "" ).getAbsolutePath(), absolutePath ); + filetoset = new File( new File( "" ).getAbsolutePath(), absolutePath ); } - this.file = file; + this.file = filetoset; if ( StringUtils.isNotEmpty( encoding ) && !encoding.equalsIgnoreCase( encoding ) && !validateEncoding( encoding ) ) @@ -170,9 +167,10 @@ /** {...@inheritdoc} */ public int hashCode() { - int result = super.hashCode(); - result = 37 * result + ( getFile() != null ? getFile().hashCode() : 0 ); - return result; + final int result = super.hashCode(); + final int hash = 37; + + return hash * result + ( getFile() != null ? getFile().hashCode() : 0 ); } /** {...@inheritdoc} */ Modified: maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/wrapper/AbstractWrapper.java URL: http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/wrapper/AbstractWrapper.java?rev=786981&r1=786980&r2=786981&view=diff ============================================================================== --- maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/wrapper/AbstractWrapper.java (original) +++ maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/wrapper/AbstractWrapper.java Sun Jun 21 10:01:58 2009 @@ -34,9 +34,6 @@ { public static final String AUTO_FORMAT = "auto"; - /** serialVersionUID */ - static final long serialVersionUID = -1150854786311626411L; - private String format; private String[] supportedFormat; @@ -111,9 +108,10 @@ /** {...@inheritdoc} */ public int hashCode() { - int result = 17; - result = 37 * result + ( format != null ? format.hashCode() : 0 ); - return result; + final int result = 17; + final int hash = 37; + + return hash * result + ( format != null ? format.hashCode() : 0 ); } /** {...@inheritdoc} */ Modified: maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/wrapper/InputFileWrapper.java URL: http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/wrapper/InputFileWrapper.java?rev=786981&r1=786980&r2=786981&view=diff ============================================================================== --- maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/wrapper/InputFileWrapper.java (original) +++ maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/wrapper/InputFileWrapper.java Sun Jun 21 10:01:58 2009 @@ -41,12 +41,11 @@ * @param format could be null * @param charsetName could be null * @param supportedFormat not null - * @throws IllegalArgumentException if the file doesn't exist. * @throws UnsupportedEncodingException if the encoding is unsupported. * @throws FileNotFoundException if the file for absolutePath is not found. */ private InputFileWrapper( String absolutePath, String format, String charsetName, String[] supportedFormat ) - throws IllegalArgumentException, UnsupportedEncodingException, FileNotFoundException + throws UnsupportedEncodingException, FileNotFoundException { super( absolutePath, format, charsetName, supportedFormat ); @@ -59,16 +58,14 @@ /** * @param absolutePath for a file or a directory not null. * @param format could be null - * @param charsetName could be null * @param supportedFormat not null * @return a type safe input reader - * @throws IllegalArgumentException if the file doesn't exist. * @throws UnsupportedEncodingException if the encoding is unsupported. * @throws FileNotFoundException if the file for absolutePath is not found. * @see #valueOf(String, String, String, String[]) using AUTO_FORMAT */ public static InputFileWrapper valueOf( String absolutePath, String format, String[] supportedFormat ) - throws IllegalArgumentException, UnsupportedEncodingException, FileNotFoundException + throws UnsupportedEncodingException, FileNotFoundException { return valueOf( absolutePath, format, AUTO_FORMAT, supportedFormat ); } @@ -79,13 +76,12 @@ * @param charsetName could be null * @param supportedFormat not null * @return a type safe input reader - * @throws IllegalArgumentException if the file doesn't exist. * @throws UnsupportedEncodingException if the encoding is unsupported. * @throws FileNotFoundException if the file for absolutePath is not found. */ public static InputFileWrapper valueOf( String absolutePath, String format, String charsetName, String[] supportedFormat ) - throws IllegalArgumentException, UnsupportedEncodingException, FileNotFoundException + throws UnsupportedEncodingException, FileNotFoundException { return new InputFileWrapper( absolutePath, format, charsetName, supportedFormat ); } Modified: maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/wrapper/InputReaderWrapper.java URL: http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/wrapper/InputReaderWrapper.java?rev=786981&r1=786980&r2=786981&view=diff ============================================================================== --- maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/wrapper/InputReaderWrapper.java (original) +++ maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/wrapper/InputReaderWrapper.java Sun Jun 21 10:01:58 2009 @@ -71,10 +71,8 @@ * @param format not null * @param supportedFormat not null * @return a type safe input reader - * @throws IllegalArgumentException if any */ public static InputReaderWrapper valueOf( Reader reader, String format, String[] supportedFormat ) - throws IllegalArgumentException { return new InputReaderWrapper( reader, format, supportedFormat ); } Modified: maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/wrapper/OutputFileWrapper.java URL: http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/wrapper/OutputFileWrapper.java?rev=786981&r1=786980&r2=786981&view=diff ============================================================================== --- maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/wrapper/OutputFileWrapper.java (original) +++ maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/wrapper/OutputFileWrapper.java Sun Jun 21 10:01:58 2009 @@ -62,11 +62,10 @@ * @param format not null * @param supportedFormat not null * @return a type safe output writer - * @throws IllegalArgumentException if any. * @throws UnsupportedEncodingException if the encoding is unsupported. */ public static OutputFileWrapper valueOf( String absolutePath, String format, String[] supportedFormat ) - throws IllegalArgumentException, UnsupportedEncodingException + throws UnsupportedEncodingException { return valueOf( absolutePath, format, WriterFactory.UTF_8, supportedFormat ); } @@ -77,12 +76,11 @@ * @param charsetName could be null * @param supportedFormat not null * @return a type safe output writer - * @throws IllegalArgumentException if any. * @throws UnsupportedEncodingException if the encoding is unsupported. */ public static OutputFileWrapper valueOf( String absolutePath, String format, String charsetName, String[] supportedFormat ) - throws IllegalArgumentException, UnsupportedEncodingException + throws UnsupportedEncodingException { if ( StringUtils.isEmpty( format ) ) { Modified: maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/wrapper/OutputStreamWrapper.java URL: http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/wrapper/OutputStreamWrapper.java?rev=786981&r1=786980&r2=786981&view=diff ============================================================================== --- maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/wrapper/OutputStreamWrapper.java (original) +++ maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/wrapper/OutputStreamWrapper.java Sun Jun 21 10:01:58 2009 @@ -20,7 +20,6 @@ */ import java.io.OutputStream; -import java.io.UnsupportedEncodingException; import org.codehaus.plexus.util.StringUtils; @@ -79,13 +78,12 @@ /** * @param out not null * @param format not null + * @param encoding not null * @param supportedFormat not null * @return a type safe output stream wrapper - * @throws IllegalArgumentException if any. - * @throws UnsupportedEncodingException if the encoding is unsupported. */ - public static OutputStreamWrapper valueOf( OutputStream out, String format, String encoding, String[] supportedFormat ) - throws IllegalArgumentException + public static OutputStreamWrapper valueOf( OutputStream out, String format, String encoding, + String[] supportedFormat ) { if ( out == null ) {