fixed errors reported by Checkstyle

This commit is contained in:
Hervé Boutemy 2012-12-16 21:49:18 +01:00
parent 2acec0557a
commit 3849bbd46a
11 changed files with 59 additions and 58 deletions

View File

@ -86,7 +86,7 @@ public class ComparableVersion
private static class IntegerItem
implements Item
{
private static final BigInteger BIG_INTEGER_ZERO = new BigInteger( "0" );
private static final BigInteger BIG_INTEGER_ZERO = new BigInteger( "0" );
private final BigInteger value;

View File

@ -557,18 +557,18 @@ public class DefaultArtifactResolver
/**
* ThreadCreator for creating daemon threads with fixed ThreadGroup-name.
*/
final static class DaemonThreadCreator
static final class DaemonThreadCreator
implements ThreadFactory
{
static final String THREADGROUP_NAME = "org.apache.maven.artifact.resolver.DefaultArtifactResolver";
final static ThreadGroup group = new ThreadGroup( THREADGROUP_NAME );
static final ThreadGroup GROUP = new ThreadGroup( THREADGROUP_NAME );
final static AtomicInteger threadNumber = new AtomicInteger( 1 );
static final AtomicInteger THREAD_NUMBER = new AtomicInteger( 1 );
public Thread newThread( Runnable r )
{
Thread newThread = new Thread( group, r, "resolver-" + threadNumber.getAndIncrement() );
Thread newThread = new Thread( GROUP, r, "resolver-" + THREAD_NUMBER.getAndIncrement() );
newThread.setDaemon( true );
return newThread;
}

View File

@ -38,18 +38,17 @@ public interface ArtifactTransformation
/**
* Take in a artifact and return the transformed artifact for locating in the remote repository. If no
* transformation has occured the original artifact is returned.
* transformation has occurred the original artifact is returned.
*
* @param artifact Artifact to be transformed.
* @param request the repositories to check
* @param localRepository the local repository
*/
void transformForResolve( Artifact artifact, RepositoryRequest request )
throws ArtifactResolutionException, ArtifactNotFoundException;
/**
* Take in a artifact and return the transformed artifact for locating in the remote repository. If no
* transformation has occured the original artifact is returned.
* transformation has occurred the original artifact is returned.
*
* @param artifact Artifact to be transformed.
* @param remoteRepositories the repositories to check
@ -62,7 +61,7 @@ public interface ArtifactTransformation
/**
* Take in a artifact and return the transformed artifact for locating in the local repository. If no
* transformation has occured the original artifact is returned.
* transformation has occurred the original artifact is returned.
*
* @param artifact Artifact to be transformed.
* @param localRepository the local repository it will be stored in
@ -72,8 +71,8 @@ public interface ArtifactTransformation
throws ArtifactInstallationException;
/**
* Take in a artifact and return the transformed artifact for distributing toa remote repository. If no
* transformation has occured the original artifact is returned.
* Take in a artifact and return the transformed artifact for distributing to remote repository. If no
* transformation has occurred the original artifact is returned.
*
* @param artifact Artifact to be transformed.
* @param remoteRepository the repository to deploy to

View File

@ -40,7 +40,6 @@ public interface ArtifactTransformationManager
*
* @param artifact Artifact to be transformed.
* @param request the repositories to check
* @param localRepository the local repository
*/
void transformForResolve( Artifact artifact, RepositoryRequest request )
throws ArtifactResolutionException, ArtifactNotFoundException;

View File

@ -19,7 +19,6 @@ package org.apache.maven.execution;
* under the License.
*/
import java.util.ArrayList;
import java.util.Collections;
import java.util.IdentityHashMap;
import java.util.List;
@ -39,7 +38,7 @@ public class DefaultMavenExecutionResult
private DependencyResolutionResult dependencyResolutionResult;
private List<Throwable> exceptions = new CopyOnWriteArrayList<Throwable>( );
private List<Throwable> exceptions = new CopyOnWriteArrayList<Throwable>();
private Map<MavenProject, BuildSummary> buildSummaries;

View File

@ -45,45 +45,45 @@ public interface MavenExecutionRequest
// Logging
// ----------------------------------------------------------------------
final int LOGGING_LEVEL_DEBUG = Logger.LEVEL_DEBUG;
int LOGGING_LEVEL_DEBUG = Logger.LEVEL_DEBUG;
final int LOGGING_LEVEL_INFO = Logger.LEVEL_INFO;
int LOGGING_LEVEL_INFO = Logger.LEVEL_INFO;
final int LOGGING_LEVEL_WARN = Logger.LEVEL_WARN;
int LOGGING_LEVEL_WARN = Logger.LEVEL_WARN;
final int LOGGING_LEVEL_ERROR = Logger.LEVEL_ERROR;
int LOGGING_LEVEL_ERROR = Logger.LEVEL_ERROR;
final int LOGGING_LEVEL_FATAL = Logger.LEVEL_FATAL;
int LOGGING_LEVEL_FATAL = Logger.LEVEL_FATAL;
final int LOGGING_LEVEL_DISABLED = Logger.LEVEL_DISABLED;
int LOGGING_LEVEL_DISABLED = Logger.LEVEL_DISABLED;
// ----------------------------------------------------------------------
// Reactor Failure Mode
// ----------------------------------------------------------------------
final String REACTOR_FAIL_FAST = "FAIL_FAST";
String REACTOR_FAIL_FAST = "FAIL_FAST";
final String REACTOR_FAIL_AT_END = "FAIL_AT_END";
String REACTOR_FAIL_AT_END = "FAIL_AT_END";
final String REACTOR_FAIL_NEVER = "FAIL_NEVER";
String REACTOR_FAIL_NEVER = "FAIL_NEVER";
// ----------------------------------------------------------------------
// Reactor Make Mode
// ----------------------------------------------------------------------
final String REACTOR_MAKE_UPSTREAM = "make-upstream";
String REACTOR_MAKE_UPSTREAM = "make-upstream";
final String REACTOR_MAKE_DOWNSTREAM = "make-downstream";
String REACTOR_MAKE_DOWNSTREAM = "make-downstream";
final String REACTOR_MAKE_BOTH = "make-both";
String REACTOR_MAKE_BOTH = "make-both";
// ----------------------------------------------------------------------
// Artifact repository policies
// ----------------------------------------------------------------------
final String CHECKSUM_POLICY_FAIL = ArtifactRepositoryPolicy.CHECKSUM_POLICY_FAIL;
String CHECKSUM_POLICY_FAIL = ArtifactRepositoryPolicy.CHECKSUM_POLICY_FAIL;
final String CHECKSUM_POLICY_WARN = ArtifactRepositoryPolicy.CHECKSUM_POLICY_WARN;
String CHECKSUM_POLICY_WARN = ArtifactRepositoryPolicy.CHECKSUM_POLICY_WARN;
// ----------------------------------------------------------------------
//

View File

@ -29,17 +29,16 @@ package org.apache.maven.lifecycle.internal;
*/
class CurrentPhaseForThread
{
private static final InheritableThreadLocal<String> threadPhase = new InheritableThreadLocal<String>();
private static final InheritableThreadLocal<String> THREAD_PHASE = new InheritableThreadLocal<String>();
public static void setPhase( String phase )
{
threadPhase.set( phase );
THREAD_PHASE.set( phase );
}
public static boolean isPhase( String phase )
{
return phase.equals( threadPhase.get() );
return phase.equals( THREAD_PHASE.get() );
}
}

View File

@ -1,19 +1,24 @@
/*
* 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.
*/
package org.apache.maven.lifecycle.internal;
/*
* 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 java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
@ -219,11 +224,10 @@ public class DefaultLifecycleExecutionPlanCalculator
if ( lifecycle == null )
{
throw new LifecyclePhaseNotFoundException(
"Unknown lifecycle phase \"" + lifecyclePhase + "\". You must specify a valid lifecycle phase" +
" or a goal in the format <plugin-prefix>:<goal> or" +
" <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: " +
defaultLifeCycles.getLifecyclePhaseList() + ".", lifecyclePhase );
throw new LifecyclePhaseNotFoundException( "Unknown lifecycle phase \"" + lifecyclePhase
+ "\". You must specify a valid lifecycle phase" + " or a goal in the format <plugin-prefix>:<goal> or"
+ " <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: "
+ defaultLifeCycles.getLifecyclePhaseList() + ".", lifecyclePhase );
}
/*
@ -432,8 +436,8 @@ public class DefaultLifecycleExecutionPlanCalculator
{
parameterConfiguration = new Xpp3Dom( parameterConfiguration, parameter.getName() );
if ( StringUtils.isEmpty( parameterConfiguration.getAttribute( "implementation" ) ) &&
StringUtils.isNotEmpty( parameter.getImplementation() ) )
if ( StringUtils.isEmpty( parameterConfiguration.getAttribute( "implementation" ) )
&& StringUtils.isNotEmpty( parameter.getImplementation() ) )
{
parameterConfiguration.setAttribute( "implementation", parameter.getImplementation() );
}

View File

@ -80,8 +80,8 @@ public class DefaultLifecyclePluginAnalyzer
{
if ( logger.isDebugEnabled() )
{
logger.debug( "Looking up lifecyle mappings for packaging " + packaging + " from " +
Thread.currentThread().getContextClassLoader() );
logger.debug( "Looking up lifecyle mappings for packaging " + packaging + " from "
+ Thread.currentThread().getContextClassLoader() );
}
LifecycleMapping lifecycleMappingForPackaging = lifecycleMappings.get( packaging );

View File

@ -94,8 +94,8 @@ public class ExecutionPlanItem
@Override
public String toString()
{
return "ExecutionPlanItem{" + ", mojoExecution=" + mojoExecution + ", schedule=" + schedule + '}' +
super.toString();
return "ExecutionPlanItem{" + ", mojoExecution=" + mojoExecution + ", schedule=" + schedule + '}'
+ super.toString();
}
}

View File

@ -212,7 +212,8 @@ public class LifecycleWeaveBuilder
{
Iterator<ExecutionPlanItem> planItems = executionPlan.iterator();
ExecutionPlanItem current = planItems.hasNext() ? planItems.next() : null;
ThreadLockedArtifact threadLockedArtifact = (ThreadLockedArtifact)projectBuild.getProject().getArtifact();
ThreadLockedArtifact threadLockedArtifact =
(ThreadLockedArtifact) projectBuild.getProject().getArtifact();
if ( threadLockedArtifact != null )
{
threadLockedArtifact.attachToThread();