code formatting

This commit is contained in:
Hervé Boutemy 2013-03-30 09:37:11 +01:00
parent 973673721b
commit 42962fa281
12 changed files with 66 additions and 45 deletions

View File

@ -1,5 +1,24 @@
package org.apache.maven.repository.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.util.Collections;
import java.util.HashSet;
import java.util.Set;

View File

@ -171,17 +171,17 @@ public class DefaultMaven
}
catch ( OutOfMemoryError e )
{
result = addExceptionToResult(new DefaultMavenExecutionResult(), e);
result = addExceptionToResult( new DefaultMavenExecutionResult(), e );
}
catch ( MavenExecutionRequestPopulationException e )
{
result = addExceptionToResult(new DefaultMavenExecutionResult(), e);
result = addExceptionToResult( new DefaultMavenExecutionResult(), e );
}
catch ( RuntimeException e )
{
result =
addExceptionToResult(new DefaultMavenExecutionResult(),
new InternalErrorException("Internal error: " + e, e));
addExceptionToResult( new DefaultMavenExecutionResult(),
new InternalErrorException( "Internal error: " + e, e ) );
}
finally
{
@ -191,7 +191,6 @@ public class DefaultMaven
return result;
}
@SuppressWarnings({"ThrowableInstanceNeverThrown", "ThrowableResultOfMethodCallIgnored"})
private MavenExecutionResult doExecute( MavenExecutionRequest request )
{
//TODO: Need a general way to inject standard properties
@ -211,7 +210,7 @@ public class DefaultMaven
}
catch ( LocalRepositoryNotAccessibleException e )
{
return addExceptionToResult(result, e);
return addExceptionToResult( result, e );
}
DelegatingLocalArtifactRepository delegatingLocalArtifactRepository =
@ -233,7 +232,7 @@ public class DefaultMaven
}
catch ( MavenExecutionException e )
{
return addExceptionToResult(result, e);
return addExceptionToResult( result, e );
}
eventCatapult.fire( ExecutionEvent.Type.ProjectDiscoveryStarted, session, null );
@ -249,7 +248,7 @@ public class DefaultMaven
}
catch ( ProjectBuildingException e )
{
return addExceptionToResult(result, e);
return addExceptionToResult( result, e );
}
session.setProjects( projects );
@ -275,7 +274,7 @@ public class DefaultMaven
}
catch ( org.apache.maven.DuplicateProjectException e )
{
return addExceptionToResult(result, e);
return addExceptionToResult( result, e );
}
repoSession.setReadOnly();
@ -292,7 +291,7 @@ public class DefaultMaven
}
catch ( MavenExecutionException e )
{
return addExceptionToResult(result, e);
return addExceptionToResult( result, e );
}
finally
{
@ -315,15 +314,15 @@ public class DefaultMaven
ProjectCycleException error = new ProjectCycleException( message, e );
return addExceptionToResult(result, error);
return addExceptionToResult( result, error );
}
catch ( DuplicateProjectException e )
{
return addExceptionToResult(result, e);
return addExceptionToResult( result, e );
}
catch ( MavenExecutionException e )
{
return addExceptionToResult(result, e);
return addExceptionToResult( result, e );
}
result.setTopologicallySortedProjects( session.getProjects() );
@ -339,7 +338,7 @@ public class DefaultMaven
if ( session.getResult().hasExceptions() )
{
return addExceptionToResult(result, session.getResult().getExceptions().get(0));
return addExceptionToResult( result, session.getResult().getExceptions().get( 0 ) );
}
return result;
@ -592,7 +591,7 @@ public class DefaultMaven
return lifecycleListeners;
}
private MavenExecutionResult addExceptionToResult(MavenExecutionResult result, Throwable e)
private MavenExecutionResult addExceptionToResult( MavenExecutionResult result, Throwable e )
{
if ( !result.getExceptions().contains( e ) )
{

View File

@ -43,9 +43,9 @@ import java.util.Map;
class ReactorReader
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;
@ -103,7 +103,7 @@ class ReactorReader
}
else
{
String type = artifact.getProperty( "type", "");
String type = artifact.getProperty( "type", "" );
if ( project.hasLifecyclePhase( "compile" ) && COMPILE_PHASE_TYPES.contains( type ) )
{
return new File( project.getBuild().getOutputDirectory() );

View File

@ -67,20 +67,20 @@ public class LifecycleThreadedBuilder
for ( TaskSegment taskSegment : currentTaskSegment )
{
Map<MavenProject, ProjectSegment> projectBuildMap = projectBuilds.selectSegment( taskSegment );
try
{
try
{
multiThreadedProjectTaskSegmentBuild( analyzer, reactorContext, session, service, taskSegment,
projectBuildMap, muxer );
if ( reactorContext.getReactorBuildStatus().isHalted( ) )
{
break;
}
}
catch ( Exception e )
if ( reactorContext.getReactorBuildStatus().isHalted() )
{
session.getResult().addException(e);
break;
}
}
catch ( Exception e )
{
session.getResult().addException( e );
break;
}
}
}
@ -126,12 +126,12 @@ public class LifecycleThreadedBuilder
}
catch ( InterruptedException e )
{
rootSession.getResult().addException(e);
rootSession.getResult().addException( e );
break;
}
catch ( ExecutionException e )
{
rootSession.getResult().addException(e);
rootSession.getResult().addException( e );
break;
}
}

View File

@ -100,29 +100,29 @@ public class PluginParameterException
}
}
messageBuffer.append( "Inside the definition for plugin \'");
messageBuffer.append( "Inside the definition for plugin \'" );
messageBuffer.append( mojo.getPluginDescriptor().getArtifactId() );
messageBuffer.append( "\', specify the following:\n\n<configuration>\n ...\n" );
messageBuffer.append( " <" ).append( param.getName() ).append( '>' );
if( isArray || isCollection )
if ( isArray || isCollection )
{
messageBuffer.append( '\n' );
messageBuffer.append( '\n' );
messageBuffer.append( " <item>" );
}
else if ( isProperties )
{
messageBuffer.append( '\n' );
messageBuffer.append( '\n' );
messageBuffer.append( " <property>\n" );
messageBuffer.append( " <name>KEY</name>\n" );
messageBuffer.append( " <value>" );
}
else if ( isMap )
{
messageBuffer.append( '\n' );
messageBuffer.append( '\n' );
messageBuffer.append( " <KEY>" );
}
messageBuffer.append( "VALUE" );
if( isArray || isCollection )
if ( isArray || isCollection )
{
messageBuffer.append( "</item>\n" );
messageBuffer.append( " " );

View File

@ -122,8 +122,9 @@ public interface ProjectBuildingRequest
List<String> getInactiveProfileIds();
/**
* Add a {@link org.apache.maven.model.Profile} that has come from an external source. This may be from a custom configuration
* like the MavenCLI settings.xml file, or from a custom dialog in an IDE integration like M2Eclipse.
* Add a {@link org.apache.maven.model.Profile} that has come from an external source. This may be from a custom
* configuration like the MavenCLI settings.xml file, or from a custom dialog in an IDE integration like M2Eclipse.
*
* @param profile
*/
void addProfile( Profile profile );
@ -143,7 +144,6 @@ public interface ProjectBuildingRequest
* Sets the start time of the build.
*
* @param buildStartTime The start time of the build, may be {@code null}.
* @return This request, never {@code null}.
*/
void setBuildStartTime( Date buildStartTime );

View File

@ -97,7 +97,7 @@ public class CLIManager
public static final String THREADS = "T";
public static final String LEGACY_LOCAL_REPOSITORY ="llr";
public static final String LEGACY_LOCAL_REPOSITORY = "llr";
protected Options options;

View File

@ -27,7 +27,10 @@ package org.apache.maven.cli.logging;
*/
public interface Slf4jConfiguration
{
public static enum Level { DEBUG, INFO, ERROR }
public static enum Level
{
DEBUG, INFO, ERROR
}
/**
* Set root logging level.

View File

@ -43,7 +43,7 @@ public class Log4j2Configuration
value = "info";
break;
case ERROR:
default:
value = "error";
break;
}

View File

@ -45,7 +45,7 @@ public class LogbackConfiguration
value = ch.qos.logback.classic.Level.INFO;
break;
case ERROR:
default:
value = ch.qos.logback.classic.Level.ERROR;
break;
}

View File

@ -45,7 +45,7 @@ public class Slf4jSimpleConfiguration
value = "info";
break;
case ERROR:
default:
value = "error";
break;
}

View File

@ -110,7 +110,7 @@ public class DefaultProfileActivationContext
* @param systemProperties The system properties, may be {@code null}.
* @return This context, never {@code null}.
*/
@SuppressWarnings("unchecked")
@SuppressWarnings( "unchecked" )
public DefaultProfileActivationContext setSystemProperties( Properties systemProperties )
{
if ( systemProperties != null )
@ -159,7 +159,7 @@ public class DefaultProfileActivationContext
* @param userProperties The user properties, may be {@code null}.
* @return This context, never {@code null}.
*/
@SuppressWarnings("unchecked")
@SuppressWarnings( "unchecked" )
public DefaultProfileActivationContext setUserProperties( Properties userProperties )
{
if ( userProperties != null )