Author: vsiveton
Date: Thu Jul 31 03:32:01 2008
New Revision: 681325
URL: http://svn.apache.org/viewvc?rev=681325&view=rev
Log:
o fixed PMD
Modified:
maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractJavadocMojo.java
maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/JavadocUtil.java
Modified:
maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractJavadocMojo.java
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractJavadocMojo.java?rev=681325&r1=681324&r2=681325&view=diff
==============================================================================
---
maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractJavadocMojo.java
(original)
+++
maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractJavadocMojo.java
Thu Jul 31 03:32:01 2008
@@ -2026,12 +2026,9 @@
private String getStylesheetFile( File javadocOutputDirectory )
{
String stylesheetfilePath = this.stylesheetfile;
- if ( StringUtils.isEmpty( stylesheetfilePath ) )
+ if ( StringUtils.isEmpty( stylesheetfilePath ) && "maven".equals(
stylesheet ) )
{
- if ( "maven".equals( stylesheet ) )
- {
- stylesheetfilePath = javadocOutputDirectory + File.separator +
DEFAULT_CSS_NAME;
- }
+ stylesheetfilePath = javadocOutputDirectory + File.separator +
DEFAULT_CSS_NAME;
}
return stylesheetfilePath;
@@ -2146,14 +2143,11 @@
path.append( docletPath );
}
- if ( StringUtils.isEmpty( path.toString() ) )
+ if ( StringUtils.isEmpty( path.toString() ) &&
getLog().isWarnEnabled() )
{
- if ( getLog().isWarnEnabled() )
- {
- getLog().warn(
- "No docletpath option was found. Please review
<docletpath/> or <docletArtifact/>"
- + " or <doclets/>." );
- }
+ getLog().warn(
+ "No docletpath option was found. Please review
<docletpath/> or <docletArtifact/>"
+ + " or <doclets/>." );
}
return path.toString();
@@ -2613,14 +2607,9 @@
throw new MavenReportException( "Unable to parse javadoc
version: " + e.getMessage(), e );
}
- if ( fJavadocVersion != jVersion )
+ if ( fJavadocVersion != jVersion && getLog().isWarnEnabled() )
{
- if ( getLog().isWarnEnabled() )
- {
- getLog().warn(
- "Are you sure about the <javadocVersion/>
parameter? It seems to be "
- + jVersion );
- }
+ getLog().warn( "Are you sure about the <javadocVersion/>
parameter? It seems to be " + jVersion );
}
}
else
@@ -3986,19 +3975,16 @@
// Handle Javadoc warnings
//
----------------------------------------------------------------------
- if ( StringUtils.isNotEmpty( err.getOutput() ) )
+ if ( StringUtils.isNotEmpty( err.getOutput() ) &&
getLog().isWarnEnabled() )
{
- if ( getLog().isWarnEnabled() )
- {
- getLog().warn( "Javadoc Warnings" );
+ getLog().warn( "Javadoc Warnings" );
- StringTokenizer token = new StringTokenizer( err.getOutput(),
"\n" );
- while ( token.hasMoreTokens() )
- {
- String current = token.nextToken().trim();
+ StringTokenizer token = new StringTokenizer( err.getOutput(), "\n"
);
+ while ( token.hasMoreTokens() )
+ {
+ String current = token.nextToken().trim();
- getLog().warn( current );
- }
+ getLog().warn( current );
}
}
}
Modified:
maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/JavadocUtil.java
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/JavadocUtil.java?rev=681325&r1=681324&r2=681325&view=diff
==============================================================================
---
maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/JavadocUtil.java
(original)
+++
maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/JavadocUtil.java
Thu Jul 31 03:32:01 2008
@@ -85,12 +85,9 @@
}
File directory = new File( dir );
- if ( directory.exists() && directory.isDirectory() )
+ if ( directory.exists() && directory.isDirectory() &&
!pruned.contains( dir ) )
{
- if ( !pruned.contains( dir ) )
- {
- pruned.add( dir );
- }
+ pruned.add( dir );
}
}
@@ -116,12 +113,9 @@
}
File file = new File( f );
- if ( file.exists() && file.isFile() )
+ if ( file.exists() && file.isFile() && !pruned.contains( f ) )
{
- if ( !pruned.contains( f ) )
- {
- pruned.add( f );
- }
+ pruned.add( f );
}
}
@@ -804,18 +798,15 @@
}
Proxy activeProxy = settings.getActiveProxy();
- if ( activeProxy != null )
- {
- if ( ( StringUtils.isNotEmpty( activeProxy.getHost() ) )
- && ( StringUtils.isNotEmpty( activeProxy.getUsername() ) )
- && ( StringUtils.isNotEmpty( activeProxy.getPassword() ) ) )
- {
- String pass = "-J-Dhttp.proxyPassword=\"" +
activeProxy.getPassword() + "\"";
- String hidepass = "-J-Dhttp.proxyPassword=\""
- + StringUtils.repeat( "*",
activeProxy.getPassword().length() ) + "\"";
+ if ( activeProxy != null && StringUtils.isNotEmpty(
activeProxy.getHost() )
+ && StringUtils.isNotEmpty( activeProxy.getUsername() )
+ && StringUtils.isNotEmpty( activeProxy.getPassword() ) )
+ {
+ String pass = "-J-Dhttp.proxyPassword=\"" +
activeProxy.getPassword() + "\"";
+ String hidepass =
+ "-J-Dhttp.proxyPassword=\"" + StringUtils.repeat( "*",
activeProxy.getPassword().length() ) + "\"";
- return StringUtils.replace( cmdLine, pass, hidepass );
- }
+ return StringUtils.replace( cmdLine, pass, hidepass );
}
return cmdLine;