fixed errors reported by Checkstyle

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1413335 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Herve Boutemy 2012-11-25 11:04:16 +00:00
parent 8a0d8ecb12
commit 9009b8f858
10 changed files with 54 additions and 46 deletions

View File

@ -37,7 +37,7 @@ import org.codehaus.plexus.component.repository.exception.ComponentLookupExcepti
* @author Jason van Zyl * @author Jason van Zyl
* @todo this should probably be a component with some dynamic control of filtering * @todo this should probably be a component with some dynamic control of filtering
*/ */
@Component(role = ArtifactFilterManager.class) @Component( role = ArtifactFilterManager.class )
public class DefaultArtifactFilterManager public class DefaultArtifactFilterManager
implements ArtifactFilterManager implements ArtifactFilterManager
{ {
@ -90,7 +90,7 @@ public class DefaultArtifactFilterManager
* wagon from their plugin realm. * wagon from their plugin realm.
*/ */
DEFAULT_EXCLUSIONS = Collections.unmodifiableSet( artifacts); DEFAULT_EXCLUSIONS = Collections.unmodifiableSet( artifacts );
} }
protected Set<String> excludedArtifacts = new HashSet<String>( DEFAULT_EXCLUSIONS ); protected Set<String> excludedArtifacts = new HashSet<String>( DEFAULT_EXCLUSIONS );

View File

@ -1,18 +1,22 @@
package org.apache.maven; package org.apache.maven;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license * Licensed to the Apache Software Foundation (ASF) under one
* agreements. See the NOTICE file distributed with this work for additional information regarding * or more contributor license agreements. See the NOTICE file
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the * distributed with this work for additional information
* "License"); you may not use this file except in compliance with the License. You may obtain a * regarding copyright ownership. The ASF licenses this file
* copy of the License at * to you under the Apache License, Version 2.0 (the
* * "License"); you may not use this file except in compliance
* http://www.apache.org/licenses/LICENSE-2.0 * with the License. You may obtain a copy of the License at
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License * http://www.apache.org/licenses/LICENSE-2.0
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express *
* or implied. See the License for the specific language governing permissions and limitations under * Unless required by applicable law or agreed to in writing,
* the License. * software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/ */
import java.io.File; import java.io.File;
@ -79,26 +83,11 @@ import org.codehaus.plexus.util.xml.Xpp3Dom;
import org.sonatype.aether.ConfigurationProperties; import org.sonatype.aether.ConfigurationProperties;
import org.sonatype.aether.RepositorySystem; import org.sonatype.aether.RepositorySystem;
import org.sonatype.aether.RepositorySystemSession; import org.sonatype.aether.RepositorySystemSession;
import org.sonatype.aether.collection.DependencyGraphTransformer;
import org.sonatype.aether.collection.DependencyManager;
import org.sonatype.aether.collection.DependencySelector;
import org.sonatype.aether.collection.DependencyTraverser;
import org.sonatype.aether.repository.Authentication; import org.sonatype.aether.repository.Authentication;
import org.sonatype.aether.repository.LocalRepository; import org.sonatype.aether.repository.LocalRepository;
import org.sonatype.aether.repository.RepositoryPolicy; import org.sonatype.aether.repository.RepositoryPolicy;
import org.sonatype.aether.repository.WorkspaceReader; import org.sonatype.aether.repository.WorkspaceReader;
import org.sonatype.aether.util.DefaultRepositorySystemSession; import org.sonatype.aether.util.DefaultRepositorySystemSession;
import org.sonatype.aether.util.graph.manager.ClassicDependencyManager;
import org.sonatype.aether.util.graph.selector.AndDependencySelector;
import org.sonatype.aether.util.graph.selector.ExclusionDependencySelector;
import org.sonatype.aether.util.graph.selector.OptionalDependencySelector;
import org.sonatype.aether.util.graph.selector.ScopeDependencySelector;
import org.sonatype.aether.util.graph.transformer.ChainedDependencyGraphTransformer;
import org.sonatype.aether.util.graph.transformer.NearestVersionConflictResolver;
import org.sonatype.aether.util.graph.transformer.ConflictMarker;
import org.sonatype.aether.util.graph.transformer.JavaDependencyContextRefiner;
import org.sonatype.aether.util.graph.transformer.JavaEffectiveScopeCalculator;
import org.sonatype.aether.util.graph.traverser.FatArtifactTraverser;
import org.sonatype.aether.util.repository.ChainedWorkspaceReader; import org.sonatype.aether.util.repository.ChainedWorkspaceReader;
import org.sonatype.aether.util.repository.DefaultAuthenticationSelector; import org.sonatype.aether.util.repository.DefaultAuthenticationSelector;
import org.sonatype.aether.util.repository.DefaultMirrorSelector; import org.sonatype.aether.util.repository.DefaultMirrorSelector;
@ -107,7 +96,7 @@ import org.sonatype.aether.util.repository.DefaultProxySelector;
/** /**
* @author Jason van Zyl * @author Jason van Zyl
*/ */
@Component(role = Maven.class) @Component( role = Maven.class )
public class DefaultMaven public class DefaultMaven
implements Maven implements Maven
{ {

View File

@ -42,7 +42,7 @@ import org.apache.maven.repository.RepositorySystem;
import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.component.annotations.Requirement;
@Component(role = ProjectDependenciesResolver.class) @Component( role = ProjectDependenciesResolver.class )
public class DefaultProjectDependenciesResolver public class DefaultProjectDependenciesResolver
implements ProjectDependenciesResolver implements ProjectDependenciesResolver
{ {
@ -97,8 +97,8 @@ public class DefaultProjectDependenciesResolver
return resolved; return resolved;
} }
if ( ( scopesToCollect == null || scopesToCollect.isEmpty() ) && if ( ( scopesToCollect == null || scopesToCollect.isEmpty() )
( scopesToResolve == null || scopesToResolve.isEmpty() ) ) && ( scopesToResolve == null || scopesToResolve.isEmpty() ) )
{ {
return resolved; return resolved;
} }

View File

@ -1,5 +1,24 @@
package org.apache.maven; package org.apache.maven;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugin.MojoFailureException;
/** /**

View File

@ -43,9 +43,9 @@ import java.util.Map;
class ReactorReader class ReactorReader
implements WorkspaceReader implements WorkspaceReader
{ {
private final static Collection<String> JAR_LIKE_TYPES = Arrays.asList( "jar", "test-jar", "ejb-client" ); private static final Collection<String> JAR_LIKE_TYPES = Arrays.asList( "jar", "test-jar", "ejb-client" );
private final static Collection<String> COMPILE_PHASE_TYPES = Arrays.asList( "jar", "ejb-client" ); private static final Collection<String> COMPILE_PHASE_TYPES = Arrays.asList( "jar", "ejb-client" );
private Map<String, MavenProject> projectsByGAV; private Map<String, MavenProject> projectsByGAV;
@ -103,7 +103,7 @@ class ReactorReader
} }
else else
{ {
String type = artifact.getProperty( "type", ""); String type = artifact.getProperty( "type", "" );
if ( project.hasLifecyclePhase( "compile" ) && COMPILE_PHASE_TYPES.contains( type ) ) if ( project.hasLifecyclePhase( "compile" ) && COMPILE_PHASE_TYPES.contains( type ) )
{ {
return new File( project.getBuild().getOutputDirectory() ); return new File( project.getBuild().getOutputDirectory() );

View File

@ -39,7 +39,7 @@ public interface MetadataReader
* The key for the option to enable strict parsing. This option is of type {@link Boolean} and defaults to {@code * The key for the option to enable strict parsing. This option is of type {@link Boolean} and defaults to {@code
* true}. If {@code false}, unknown elements will be ignored instead of causing a failure. * true}. If {@code false}, unknown elements will be ignored instead of causing a failure.
*/ */
final String IS_STRICT = "org.apache.maven.artifact.repository.metadata.io.isStrict"; String IS_STRICT = "org.apache.maven.artifact.repository.metadata.io.isStrict";
/** /**
* Reads the metadata from the specified file. * Reads the metadata from the specified file.

View File

@ -179,9 +179,11 @@ public class DefaultExceptionHandler
reference = MojoExecutionException.class.getSimpleName(); reference = MojoExecutionException.class.getSimpleName();
Throwable cause = exception.getCause(); Throwable cause = exception.getCause();
if ( cause instanceof IOException ) { if ( cause instanceof IOException )
{
cause = cause.getCause(); cause = cause.getCause();
if ( cause instanceof ConnectException ) { if ( cause instanceof ConnectException )
{
reference = ConnectException.class.getSimpleName(); reference = ConnectException.class.getSimpleName();
} }
} }

View File

@ -21,8 +21,6 @@ package org.apache.maven.cli;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.Locale; import java.util.Locale;
@ -51,7 +49,7 @@ public final class CLIReportingUtils
public static String showVersion() public static String showVersion()
{ {
String LS = System.getProperty("line.separator"); final String LS = System.getProperty( "line.separator" );
Properties properties = getBuildProperties(); Properties properties = getBuildProperties();
StringBuffer version = new StringBuffer(); StringBuffer version = new StringBuffer();
version.append( createMavenVersionString( properties ) ).append( LS ); version.append( createMavenVersionString( properties ) ).append( LS );

View File

@ -283,7 +283,7 @@ public class MavenCli
if ( cliRequest.commandLine.hasOption( CLIManager.VERSION ) ) if ( cliRequest.commandLine.hasOption( CLIManager.VERSION ) )
{ {
System.out.println(CLIReportingUtils.showVersion()); System.out.println( CLIReportingUtils.showVersion() );
throw new ExitException( 0 ); throw new ExitException( 0 );
} }
} }
@ -417,7 +417,7 @@ public class MavenCli
eventSpyDispatcher.init( eventSpyContext ); eventSpyDispatcher.init( eventSpyContext );
// refresh logger in case container got customized by spy // refresh logger in case container got customized by spy
slf4jLogger = slf4jLoggerFactory.getLogger(this.getClass().getName()); slf4jLogger = slf4jLoggerFactory.getLogger( this.getClass().getName() );
maven = container.lookup( Maven.class ); maven = container.lookup( Maven.class );

View File

@ -1,7 +1,5 @@
package org.apache.maven.cli.transfer; package org.apache.maven.cli.transfer;
import java.io.PrintStream;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -21,6 +19,8 @@ import java.io.PrintStream;
* under the License. * under the License.
*/ */
import java.io.PrintStream;
public class BatchModeMavenTransferListener public class BatchModeMavenTransferListener
extends AbstractMavenTransferListener extends AbstractMavenTransferListener
{ {