Updated Branches: refs/heads/master 543870467 -> b63904c9d
fixed errors reported by Checkstyle (once again...) Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/b63904c9 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/b63904c9 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/b63904c9 Branch: refs/heads/master Commit: b63904c9db0e6760d8f0f52488242272a70b7d70 Parents: 5438704 Author: Hervé Boutemy <[email protected]> Authored: Mon Dec 3 02:21:58 2012 +0100 Committer: Hervé Boutemy <[email protected]> Committed: Mon Dec 3 02:21:58 2012 +0100 ---------------------------------------------------------------------- .../maven/profiles/DefaultProfileManager.java | 5 - .../activation/SystemPropertyProfileActivator.java | 2 +- .../internal/LifecycleDependencyResolver.java | 37 +++-- .../lifecycle/internal/ThreadLockedArtifact.java | 10 +- .../plugin/DefaultLifecycleBindingsInjector.java | 4 +- .../apache/maven/plugin/BuildPluginManager.java | 28 ++-- .../maven/plugin/DefaultBuildPluginManager.java | 30 ++-- .../plugin/internal/DefaultLegacySupport.java | 14 +- .../internal/PluginDependenciesResolver.java | 2 +- .../maven/plugin/prefix/PluginPrefixResult.java | 6 +- .../project/DefaultModelBuildingListener.java | 2 +- .../maven/project/DefaultProjectBuilder.java | 28 ++-- .../maven/model/building/DefaultModelBuilder.java | 126 ++++++++------- .../maven/model/building/DefaultModelProblem.java | 3 +- .../building/DefaultModelProblemCollector.java | 7 +- .../apache/maven/model/building/ModelProblem.java | 3 +- .../model/building/ModelProblemCollector.java | 3 - .../building/ModelProblemCollectorRequest.java | 44 +++--- .../AbstractStringBasedModelInterpolator.java | 4 +- .../interpolation/ProblemDetectingValueSource.java | 3 +- .../StringSearchModelInterpolator.java | 10 +- .../model/plugin/DefaultReportingConverter.java | 6 +- .../model/profile/DefaultProfileSelector.java | 8 +- .../activation/JdkVersionProfileActivator.java | 2 +- .../model/validation/DefaultModelValidator.java | 10 +- 25 files changed, 214 insertions(+), 183 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven/blob/b63904c9/maven-compat/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java ---------------------------------------------------------------------- diff --git a/maven-compat/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java b/maven-compat/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java index ae3d2c5..740c2cd 100644 --- a/maven-compat/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java +++ b/maven-compat/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java @@ -20,13 +20,10 @@ package org.apache.maven.profiles; */ import org.apache.maven.model.Activation; -import org.apache.maven.model.InputLocation; import org.apache.maven.model.Profile; import org.apache.maven.model.building.ModelProblem; import org.apache.maven.model.building.ModelProblemCollector; -import org.apache.maven.model.building.ModelProblem.Severity; import org.apache.maven.model.profile.DefaultProfileActivationContext; -import org.apache.maven.model.profile.ProfileActivationContext; import org.apache.maven.model.profile.ProfileSelector; import org.apache.maven.profiles.activation.ProfileActivationException; import org.codehaus.plexus.MutablePlexusContainer; @@ -36,13 +33,11 @@ import org.codehaus.plexus.component.repository.exception.ComponentLookupExcepti import org.codehaus.plexus.logging.Logger; import java.util.ArrayList; -import java.util.Collections; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Properties; -import org.apache.maven.model.building.ModelProblem.Version; import org.apache.maven.model.building.ModelProblemCollectorRequest; @Deprecated http://git-wip-us.apache.org/repos/asf/maven/blob/b63904c9/maven-compat/src/main/java/org/apache/maven/profiles/activation/SystemPropertyProfileActivator.java ---------------------------------------------------------------------- diff --git a/maven-compat/src/main/java/org/apache/maven/profiles/activation/SystemPropertyProfileActivator.java b/maven-compat/src/main/java/org/apache/maven/profiles/activation/SystemPropertyProfileActivator.java index 4186415..a03267d 100644 --- a/maven-compat/src/main/java/org/apache/maven/profiles/activation/SystemPropertyProfileActivator.java +++ b/maven-compat/src/main/java/org/apache/maven/profiles/activation/SystemPropertyProfileActivator.java @@ -63,7 +63,7 @@ public class SystemPropertyProfileActivator + profile.getId() + "'" ); } - if ( name.startsWith("!") ) + if ( name.startsWith( "!" ) ) { reverseName = true; name = name.substring( 1 ); http://git-wip-us.apache.org/repos/asf/maven/blob/b63904c9/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleDependencyResolver.java ---------------------------------------------------------------------- diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleDependencyResolver.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleDependencyResolver.java index a549ce2..075283d 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleDependencyResolver.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleDependencyResolver.java @@ -1,20 +1,33 @@ 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 + * 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 + * 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. + * 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.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + import org.apache.maven.RepositoryUtils; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.ArtifactUtils; @@ -37,8 +50,6 @@ import org.sonatype.aether.graph.DependencyNode; import org.sonatype.aether.util.filter.AndDependencyFilter; import org.sonatype.aether.util.filter.ScopeDependencyFilter; -import java.util.*; - /** * Resolves dependencies for the artifacts in context of the lifecycle build * @@ -49,7 +60,7 @@ import java.util.*; * <p/> * NOTE: This class is not part of any public api and can be changed or deleted without prior notice. */ -@Component(role = LifecycleDependencyResolver.class) +@Component( role = LifecycleDependencyResolver.class ) public class LifecycleDependencyResolver { http://git-wip-us.apache.org/repos/asf/maven/blob/b63904c9/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ThreadLockedArtifact.java ---------------------------------------------------------------------- diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ThreadLockedArtifact.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ThreadLockedArtifact.java index b566e64..9c6cf40 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ThreadLockedArtifact.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ThreadLockedArtifact.java @@ -52,8 +52,8 @@ class ThreadLockedArtifact public boolean hasReal() { - return real != null && - ( !( real instanceof ThreadLockedArtifact ) || ( (ThreadLockedArtifact) real ).hasReal() ); + return real != null + && ( !( real instanceof ThreadLockedArtifact ) || ( (ThreadLockedArtifact) real ).hasReal() ); } public String getGroupId() @@ -96,17 +96,17 @@ class ThreadLockedArtifact return real.hasClassifier(); } - private static final InheritableThreadLocal<ThreadLockedArtifact> threadArtifact = + private static final InheritableThreadLocal<ThreadLockedArtifact> THREAD_ARTIFACT = new InheritableThreadLocal<ThreadLockedArtifact>(); public void attachToThread() { - threadArtifact.set( this ); + THREAD_ARTIFACT.set( this ); } public File getFile() { - final ThreadLockedArtifact lockedArtifact = threadArtifact.get(); + final ThreadLockedArtifact lockedArtifact = THREAD_ARTIFACT.get(); if ( lockedArtifact != null && this != lockedArtifact && mustLock() ) { try http://git-wip-us.apache.org/repos/asf/maven/blob/b63904c9/maven-core/src/main/java/org/apache/maven/model/plugin/DefaultLifecycleBindingsInjector.java ---------------------------------------------------------------------- diff --git a/maven-core/src/main/java/org/apache/maven/model/plugin/DefaultLifecycleBindingsInjector.java b/maven-core/src/main/java/org/apache/maven/model/plugin/DefaultLifecycleBindingsInjector.java index d2486b4..5cb3363 100644 --- a/maven-core/src/main/java/org/apache/maven/model/plugin/DefaultLifecycleBindingsInjector.java +++ b/maven-core/src/main/java/org/apache/maven/model/plugin/DefaultLifecycleBindingsInjector.java @@ -66,9 +66,9 @@ public class DefaultLifecycleBindingsInjector if ( defaultPlugins == null ) { - problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE) + problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ) .setMessage( "Unknown packaging: " + packaging ) - .setLocation( model.getLocation( "packaging" ))); + .setLocation( model.getLocation( "packaging" ) ) ); } else if ( !defaultPlugins.isEmpty() ) { http://git-wip-us.apache.org/repos/asf/maven/blob/b63904c9/maven-core/src/main/java/org/apache/maven/plugin/BuildPluginManager.java ---------------------------------------------------------------------- diff --git a/maven-core/src/main/java/org/apache/maven/plugin/BuildPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/BuildPluginManager.java index 48eed40..5e93bce 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/BuildPluginManager.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/BuildPluginManager.java @@ -1,18 +1,22 @@ package org.apache.maven.plugin; /* - * 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. + * 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.List; http://git-wip-us.apache.org/repos/asf/maven/blob/b63904c9/maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java ---------------------------------------------------------------------- diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java index 3ae2c58..fee2eb0 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java @@ -1,18 +1,22 @@ package org.apache.maven.plugin; /* - * 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. + * 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.ByteArrayOutputStream; @@ -33,7 +37,7 @@ import org.sonatype.aether.repository.RemoteRepository; // TODO: the antrun plugin has its own configurator, the only plugin that does. might need to think about how that works // TODO: remove the coreArtifactFilterManager -@Component(role = BuildPluginManager.class) +@Component( role = BuildPluginManager.class ) public class DefaultBuildPluginManager implements BuildPluginManager { http://git-wip-us.apache.org/repos/asf/maven/blob/b63904c9/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultLegacySupport.java ---------------------------------------------------------------------- diff --git a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultLegacySupport.java b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultLegacySupport.java index 78790d7..a71a000 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultLegacySupport.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultLegacySupport.java @@ -39,29 +39,29 @@ public class DefaultLegacySupport implements LegacySupport { - private static final ThreadLocal<AtomicReference<MavenSession>> session = new InheritableThreadLocal<AtomicReference<MavenSession>>(); + private static final ThreadLocal<AtomicReference<MavenSession>> SESSION = new InheritableThreadLocal<AtomicReference<MavenSession>>(); public void setSession( MavenSession session ) { - AtomicReference<MavenSession> reference = DefaultLegacySupport.session.get(); + AtomicReference<MavenSession> reference = DefaultLegacySupport.SESSION.get(); if ( reference != null ) { - reference.set( null); + reference.set( null ); } - if ( session == null && reference != null) + if ( session == null && reference != null ) { - DefaultLegacySupport.session.remove(); + DefaultLegacySupport.SESSION.remove(); } else { - DefaultLegacySupport.session.set( new AtomicReference<MavenSession>( session )); + DefaultLegacySupport.SESSION.set( new AtomicReference<MavenSession>( session ) ); } } public MavenSession getSession() { - AtomicReference<MavenSession> currentSession = DefaultLegacySupport.session.get(); + AtomicReference<MavenSession> currentSession = DefaultLegacySupport.SESSION.get(); return currentSession != null ? currentSession.get() : null; } http://git-wip-us.apache.org/repos/asf/maven/blob/b63904c9/maven-core/src/main/java/org/apache/maven/plugin/internal/PluginDependenciesResolver.java ---------------------------------------------------------------------- diff --git a/maven-core/src/main/java/org/apache/maven/plugin/internal/PluginDependenciesResolver.java b/maven-core/src/main/java/org/apache/maven/plugin/internal/PluginDependenciesResolver.java index 1aa578e..60d8314 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/internal/PluginDependenciesResolver.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/internal/PluginDependenciesResolver.java @@ -50,7 +50,7 @@ public interface PluginDependenciesResolver * @return The resolved plugin artifact, never {@code null}. * @throws PluginResolutionException If the plugin artifact could not be resolved. */ - public Artifact resolve( Plugin plugin, List<RemoteRepository> repositories, RepositorySystemSession session ) + Artifact resolve( Plugin plugin, List<RemoteRepository> repositories, RepositorySystemSession session ) throws PluginResolutionException; /** http://git-wip-us.apache.org/repos/asf/maven/blob/b63904c9/maven-core/src/main/java/org/apache/maven/plugin/prefix/PluginPrefixResult.java ---------------------------------------------------------------------- diff --git a/maven-core/src/main/java/org/apache/maven/plugin/prefix/PluginPrefixResult.java b/maven-core/src/main/java/org/apache/maven/plugin/prefix/PluginPrefixResult.java index f21b670..0e67f37 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/prefix/PluginPrefixResult.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/prefix/PluginPrefixResult.java @@ -1,7 +1,5 @@ package org.apache.maven.plugin.prefix; -import org.sonatype.aether.repository.ArtifactRepository; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -11,7 +9,7 @@ import org.sonatype.aether.repository.ArtifactRepository; * "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 + * 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 @@ -21,6 +19,8 @@ import org.sonatype.aether.repository.ArtifactRepository; * under the License. */ +import org.sonatype.aether.repository.ArtifactRepository; + /** * Describes the result of a plugin prefix resolution request. * http://git-wip-us.apache.org/repos/asf/maven/blob/b63904c9/maven-core/src/main/java/org/apache/maven/project/DefaultModelBuildingListener.java ---------------------------------------------------------------------- diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultModelBuildingListener.java b/maven-core/src/main/java/org/apache/maven/project/DefaultModelBuildingListener.java index ca26638..3aebe9b 100644 --- a/maven-core/src/main/java/org/apache/maven/project/DefaultModelBuildingListener.java +++ b/maven-core/src/main/java/org/apache/maven/project/DefaultModelBuildingListener.java @@ -116,7 +116,7 @@ class DefaultModelBuildingListener catch ( PluginResolutionException e ) { event.getProblems().add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ) - .setMessage( "Unresolveable build extension: " + e.getMessage()) + .setMessage( "Unresolveable build extension: " + e.getMessage() ) .setException( e ) ); } catch ( PluginVersionResolutionException e ) http://git-wip-us.apache.org/repos/asf/maven/blob/b63904c9/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java ---------------------------------------------------------------------- diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java index 4e4db80..a242ee5 100644 --- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java +++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java @@ -1,18 +1,22 @@ package org.apache.maven.project; /* - * 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. + * 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.File; http://git-wip-us.apache.org/repos/asf/maven/blob/b63904c9/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java ---------------------------------------------------------------------- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java index e075f7b..90a20eb 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java @@ -317,7 +317,7 @@ public class DefaultModelBuilder } message += currentData.getId(); - problems.add( new ModelProblemCollectorRequest(ModelProblem.Severity.FATAL, ModelProblem.Version.BASE).setMessage(message)); + problems.add( new ModelProblemCollectorRequest( ModelProblem.Severity.FATAL, ModelProblem.Version.BASE ).setMessage( message ) ); throw problems.newModelBuildingException(); } } @@ -409,7 +409,7 @@ public class DefaultModelBuilder modelValidator.validateEffectiveModel( resultModel, request, problems ); - if ( hasModelErrors(problems) ) + if ( hasModelErrors( problems ) ) { throw problems.newModelBuildingException(); } @@ -471,15 +471,15 @@ public class DefaultModelBuilder if ( pomFile != null ) { - problems.add( new ModelProblemCollectorRequest(Severity.ERROR, Version.V20) - .setMessage("Malformed POM " + modelSource.getLocation() + ": " + e.getMessage()) - .setException(e )); + problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.V20 ) + .setMessage( "Malformed POM " + modelSource.getLocation() + ": " + e.getMessage() ) + .setException( e ) ); } else { - problems.add( new ModelProblemCollectorRequest(Severity.WARNING, Version.V20) - .setMessage("Malformed POM " + modelSource.getLocation() + ": " + e.getMessage()) - .setException(e)); + problems.add( new ModelProblemCollectorRequest( Severity.WARNING, Version.V20 ) + .setMessage( "Malformed POM " + modelSource.getLocation() + ": " + e.getMessage() ) + .setException( e ) ); } } @@ -491,9 +491,9 @@ public class DefaultModelBuilder } catch ( ModelParseException e ) { - problems.add( new ModelProblemCollectorRequest(Severity.FATAL, Version.BASE) - .setMessage("Non-parseable POM " + modelSource.getLocation() + ": " + e.getMessage()) - .setException(e)); + problems.add( new ModelProblemCollectorRequest( Severity.FATAL, Version.BASE ) + .setMessage( "Non-parseable POM " + modelSource.getLocation() + ": " + e.getMessage() ) + .setException( e ) ); throw problems.newModelBuildingException(); } catch ( IOException e ) @@ -511,9 +511,9 @@ public class DefaultModelBuilder msg = e.getClass().getSimpleName(); } } - problems.add( new ModelProblemCollectorRequest(Severity.FATAL, Version.BASE) - .setMessage("Non-readable POM " + modelSource.getLocation() + ": " + msg) - .setException(e )); + problems.add( new ModelProblemCollectorRequest( Severity.FATAL, Version.BASE ) + .setMessage( "Non-readable POM " + modelSource.getLocation() + ": " + msg ) + .setException( e ) ); throw problems.newModelBuildingException(); } @@ -522,7 +522,7 @@ public class DefaultModelBuilder problems.setSource( model ); modelValidator.validateRawModel( model, request, problems ); - if ( hasFatalErrors(problems) ) + if ( hasFatalErrors( problems ) ) { throw problems.newModelBuildingException(); } @@ -562,10 +562,10 @@ public class DefaultModelBuilder } catch ( InvalidRepositoryException e ) { - problems.add( new ModelProblemCollectorRequest(Severity.ERROR, Version.BASE) - .setMessage( "Invalid repository " + repository.getId() + ": " + e.getMessage()) - .setLocation(repository.getLocation( "" )) - .setException(e) ); + problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ) + .setMessage( "Invalid repository " + repository.getId() + ": " + e.getMessage() ) + .setLocation( repository.getLocation( "" ) ) + .setException( e ) ); } } } @@ -617,9 +617,9 @@ public class DefaultModelBuilder if ( versions.get( key ) == null && managedVersions.get( key ) == null ) { InputLocation location = plugins.get( key ).getLocation( "" ); - problems.add( new ModelProblemCollectorRequest(Severity.WARNING, Version.V20) - .setMessage( "'build.plugins.plugin.version' for " + key + " is missing.") - .setLocation(location)); + problems.add( new ModelProblemCollectorRequest( Severity.WARNING, Version.V20 ) + .setMessage( "'build.plugins.plugin.version' for " + key + " is missing." ) + .setLocation( location ) ); } } } @@ -694,10 +694,10 @@ public class DefaultModelBuilder if ( !"pom".equals( parentModel.getPackaging() ) ) { - problems.add( new ModelProblemCollectorRequest(Severity.ERROR, Version.BASE) - .setMessage( "Invalid packaging for parent POM " + ModelProblemUtils.toSourceHint( parentModel ) + ", must be \"pom\" but is \"" - + parentModel.getPackaging() + "\"") - .setLocation(parentModel.getLocation( "packaging" ))); + problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ) + .setMessage( "Invalid packaging for parent POM " + ModelProblemUtils.toSourceHint( parentModel ) + + ", must be \"pom\" but is \"" + parentModel.getPackaging() + "\"" ) + .setLocation( parentModel.getLocation( "packaging" ) ) ); } } else @@ -749,9 +749,9 @@ public class DefaultModelBuilder buffer.append( ", please verify your project structure" ); problems.setSource( childModel ); - problems.add( new ModelProblemCollectorRequest( Severity.WARNING, Version.BASE) - .setMessage( buffer.toString()) - .setLocation( parent.getLocation( "" ))); + problems.add( new ModelProblemCollectorRequest( Severity.WARNING, Version.BASE ) + .setMessage( buffer.toString() ) + .setLocation( parent.getLocation( "" ) ) ); return null; } if ( version == null || !version.equals( parent.getVersion() ) ) @@ -843,10 +843,10 @@ public class DefaultModelBuilder } } - problems.add( new ModelProblemCollectorRequest(Severity.FATAL, Version.BASE) - .setMessage( buffer.toString()) - .setLocation(parent.getLocation( "" )) - .setException(e)); + problems.add( new ModelProblemCollectorRequest( Severity.FATAL, Version.BASE ) + .setMessage( buffer.toString() ) + .setLocation( parent.getLocation( "" ) ) + .setException( e ) ); throw problems.newModelBuildingException(); } @@ -912,23 +912,26 @@ public class DefaultModelBuilder if ( groupId == null || groupId.length() <= 0 ) { - problems.add( new ModelProblemCollectorRequest(Severity.ERROR, Version.BASE) - .setMessage( "'dependencyManagement.dependencies.dependency.groupId' for " + dependency.getManagementKey() + " is missing.") - .setLocation( dependency.getLocation( "" ))); + problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ) + .setMessage( "'dependencyManagement.dependencies.dependency.groupId' for " + + dependency.getManagementKey() + " is missing." ) + .setLocation( dependency.getLocation( "" ) ) ); continue; } if ( artifactId == null || artifactId.length() <= 0 ) { - problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE) - .setMessage( "'dependencyManagement.dependencies.dependency.artifactId' for " + dependency.getManagementKey() + " is missing.") - .setLocation( dependency.getLocation( "" ))); + problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ) + .setMessage( "'dependencyManagement.dependencies.dependency.artifactId' for " + + dependency.getManagementKey() + " is missing." ) + .setLocation( dependency.getLocation( "" ) ) ); continue; } if ( version == null || version.length() <= 0 ) { - problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE) - .setMessage( "'dependencyManagement.dependencies.dependency.version' for " + dependency.getManagementKey() + " is missing.") - .setLocation( dependency.getLocation( "" ))); + problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ) + .setMessage( "'dependencyManagement.dependencies.dependency.version' for " + + dependency.getManagementKey() + " is missing." ) + .setLocation( dependency.getLocation( "" ) ) ); continue; } @@ -942,7 +945,7 @@ public class DefaultModelBuilder message += modelId + " -> "; } message += imported; - problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ).setMessage( message )); + problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ).setMessage( message ) ); continue; } @@ -976,8 +979,8 @@ public class DefaultModelBuilder problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ) .setMessage( buffer.toString() ) - .setLocation( dependency.getLocation( "" )) - .setException( e )); + .setLocation( dependency.getLocation( "" ) ) + .setException( e ) ); continue; } @@ -1076,24 +1079,31 @@ public class DefaultModelBuilder && ( version == null || message.contains( version ) ); } - protected boolean hasModelErrors(ModelProblemCollectorExt problems) { - if (problems instanceof DefaultModelProblemCollector) { - return ((DefaultModelProblemCollector)problems).hasErrors(); - } else { - //the default execution path only knows the DefaultModelProblemCollector, + protected boolean hasModelErrors( ModelProblemCollectorExt problems ) + { + if ( problems instanceof DefaultModelProblemCollector ) + { + return ( (DefaultModelProblemCollector) problems ).hasErrors(); + } + else + { + // the default execution path only knows the DefaultModelProblemCollector, // only reason it's not in signature is because it's package private - throw new IllegalStateException(); + throw new IllegalStateException(); } - } - protected boolean hasFatalErrors(ModelProblemCollectorExt problems) { - if (problems instanceof DefaultModelProblemCollector) { - return ((DefaultModelProblemCollector)problems).hasFatalErrors(); - } else { - //the default execution path only knows the DefaultModelProblemCollector, + protected boolean hasFatalErrors( ModelProblemCollectorExt problems ) + { + if ( problems instanceof DefaultModelProblemCollector ) + { + return ( (DefaultModelProblemCollector) problems ).hasFatalErrors(); + } + else + { + // the default execution path only knows the DefaultModelProblemCollector, // only reason it's not in signature is because it's package private - throw new IllegalStateException(); + throw new IllegalStateException(); } } http://git-wip-us.apache.org/repos/asf/maven/blob/b63904c9/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelProblem.java ---------------------------------------------------------------------- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelProblem.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelProblem.java index e0effac..0d68aae 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelProblem.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelProblem.java @@ -146,7 +146,8 @@ public class DefaultModelProblem return severity; } - public Version getVersion() { + public Version getVersion() + { return version; } http://git-wip-us.apache.org/repos/asf/maven/blob/b63904c9/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelProblemCollector.java ---------------------------------------------------------------------- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelProblemCollector.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelProblemCollector.java index e2573eb..114afeb 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelProblemCollector.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelProblemCollector.java @@ -23,10 +23,7 @@ import java.util.EnumSet; import java.util.List; import java.util.Set; -import org.apache.maven.model.InputLocation; import org.apache.maven.model.Model; -import org.apache.maven.model.building.ModelProblem.Severity; -import org.apache.maven.model.building.ModelProblem.Version; import org.apache.maven.model.io.ModelParseException; /** @@ -174,7 +171,9 @@ class DefaultModelProblemCollector column = e.getColumnNumber(); } - ModelProblem problem = new DefaultModelProblem( req.getMessage(), req.getSeverity(), req.getVersion(), source, line, column, modelId, req.getException() ); + ModelProblem problem = + new DefaultModelProblem( req.getMessage(), req.getSeverity(), req.getVersion(), source, line, column, + modelId, req.getException() ); add( problem ); } http://git-wip-us.apache.org/repos/asf/maven/blob/b63904c9/maven-model-builder/src/main/java/org/apache/maven/model/building/ModelProblem.java ---------------------------------------------------------------------- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/ModelProblem.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/ModelProblem.java index 811f2e0..555f033 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/building/ModelProblem.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/ModelProblem.java @@ -41,7 +41,8 @@ public interface ModelProblem } - enum Version { + enum Version + { //based on ModeBuildingResult.validationLevel BASE, V20, http://git-wip-us.apache.org/repos/asf/maven/blob/b63904c9/maven-model-builder/src/main/java/org/apache/maven/model/building/ModelProblemCollector.java ---------------------------------------------------------------------- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/ModelProblemCollector.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/ModelProblemCollector.java index b232103..961d40a 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/building/ModelProblemCollector.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/ModelProblemCollector.java @@ -19,9 +19,6 @@ package org.apache.maven.model.building; * under the License. */ -import java.util.List; -import org.apache.maven.model.InputLocation; - /** * Collects problems that are encountered during model building. The primary purpose of this component is to account for * the fact that the problem reporter has/should not have information about the calling context and hence cannot provide http://git-wip-us.apache.org/repos/asf/maven/blob/b63904c9/maven-model-builder/src/main/java/org/apache/maven/model/building/ModelProblemCollectorRequest.java ---------------------------------------------------------------------- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/ModelProblemCollectorRequest.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/ModelProblemCollectorRequest.java index d91c5c2..60bfdde 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/building/ModelProblemCollectorRequest.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/ModelProblemCollectorRequest.java @@ -1,19 +1,23 @@ +package org.apache.maven.model.building; + /* - * Copyright 2012 The Apache Software Foundation. + * 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 * - * Licensed 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 * - * 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. + * 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.model.building; import org.apache.maven.model.InputLocation; import org.apache.maven.model.building.ModelProblem.Severity; @@ -38,17 +42,17 @@ public final class ModelProblemCollectorRequest * @param severity * @param version */ - public ModelProblemCollectorRequest(Severity severity, Version version) + public ModelProblemCollectorRequest( Severity severity, Version version ) { this.severity = severity; this.version = version; - if (severity == null) + if ( severity == null ) { - throw new IllegalStateException("No severity declared"); + throw new IllegalStateException( "No severity declared" ); } - if (version == null) + if ( version == null ) { - throw new IllegalStateException("No version declared."); + throw new IllegalStateException( "No version declared." ); } } @@ -67,7 +71,7 @@ public final class ModelProblemCollectorRequest return exception; } - public ModelProblemCollectorRequest setException(Exception exception) + public ModelProblemCollectorRequest setException( Exception exception ) { this.exception = exception; return this; @@ -78,7 +82,7 @@ public final class ModelProblemCollectorRequest return message; } - public ModelProblemCollectorRequest setMessage(String message) + public ModelProblemCollectorRequest setMessage( String message ) { this.message = message; return this; @@ -89,7 +93,7 @@ public final class ModelProblemCollectorRequest return location; } - public ModelProblemCollectorRequest setLocation(InputLocation location) + public ModelProblemCollectorRequest setLocation( InputLocation location ) { this.location = location; return this; http://git-wip-us.apache.org/repos/asf/maven/blob/b63904c9/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/AbstractStringBasedModelInterpolator.java ---------------------------------------------------------------------- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/AbstractStringBasedModelInterpolator.java b/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/AbstractStringBasedModelInterpolator.java index dc8b41b..57e11c3 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/AbstractStringBasedModelInterpolator.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/AbstractStringBasedModelInterpolator.java @@ -45,7 +45,6 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Properties; -import org.apache.maven.model.building.ModelProblem; import org.apache.maven.model.building.ModelProblem.Version; import org.apache.maven.model.building.ModelProblemCollectorRequest; @@ -244,7 +243,8 @@ public abstract class AbstractStringBasedModelInterpolator } catch ( InterpolationException e ) { - problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ).setMessage( e.getMessage() ).setException( e )); + problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ) + .setMessage( e.getMessage() ).setException( e ) ); } interpolator.clearFeedback(); http://git-wip-us.apache.org/repos/asf/maven/blob/b63904c9/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/ProblemDetectingValueSource.java ---------------------------------------------------------------------- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/ProblemDetectingValueSource.java b/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/ProblemDetectingValueSource.java index 106414e..8167baf 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/ProblemDetectingValueSource.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/ProblemDetectingValueSource.java @@ -20,7 +20,6 @@ package org.apache.maven.model.interpolation; */ import java.util.List; -import org.apache.maven.model.building.ModelProblem; import org.apache.maven.model.building.ModelProblemCollector; import org.apache.maven.model.building.ModelProblem.Severity; @@ -65,7 +64,7 @@ class ProblemDetectingValueSource { msg += " Please use ${" + newPrefix + expression.substring( bannedPrefix.length() ) + "} instead."; } - problems.add( new ModelProblemCollectorRequest( Severity.WARNING, Version.V20 ).setMessage( msg )); + problems.add( new ModelProblemCollectorRequest( Severity.WARNING, Version.V20 ).setMessage( msg ) ); } return value; http://git-wip-us.apache.org/repos/asf/maven/blob/b63904c9/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/StringSearchModelInterpolator.java ---------------------------------------------------------------------- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/StringSearchModelInterpolator.java b/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/StringSearchModelInterpolator.java index d4bc534..2ef7eb1 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/StringSearchModelInterpolator.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/StringSearchModelInterpolator.java @@ -49,7 +49,7 @@ public class StringSearchModelInterpolator extends AbstractStringBasedModelInterpolator { - private static final Map<Class<?>, InterpolateObjectAction.CacheItem> cachedEntries = + private static final Map<Class<?>, InterpolateObjectAction.CacheItem> CACHED_ENTRIES = new ConcurrentHashMap<Class<?>, InterpolateObjectAction.CacheItem>( 80, 0.75f, 2 ); // Empirical data from 3.x, actual =40 @@ -161,11 +161,11 @@ public class StringSearchModelInterpolator private CacheItem getCacheEntry( Class<?> cls ) { - CacheItem cacheItem = cachedEntries.get( cls ); + CacheItem cacheItem = CACHED_ENTRIES.get( cls ); if ( cacheItem == null ) { cacheItem = new CacheItem( cls ); - cachedEntries.put( cls, cacheItem ); + CACHED_ENTRIES.put( cls, cacheItem ); } return cacheItem; } @@ -247,7 +247,7 @@ public class StringSearchModelInterpolator } else if ( Collection.class.isAssignableFrom( type ) ) { - throw new RuntimeException("We dont interpolate into collections, use a list instead"); + throw new RuntimeException( "We dont interpolate into collections, use a list instead" ); } else if ( Map.class.isAssignableFrom( type ) ) { @@ -278,7 +278,7 @@ public class StringSearchModelInterpolator } } - static abstract class CacheField + abstract static class CacheField { protected final Field field; http://git-wip-us.apache.org/repos/asf/maven/blob/b63904c9/maven-model-builder/src/main/java/org/apache/maven/model/plugin/DefaultReportingConverter.java ---------------------------------------------------------------------- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/plugin/DefaultReportingConverter.java b/maven-model-builder/src/main/java/org/apache/maven/model/plugin/DefaultReportingConverter.java index 6a95b97..f8a2a93 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/plugin/DefaultReportingConverter.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/plugin/DefaultReportingConverter.java @@ -108,9 +108,9 @@ public class DefaultReportingConverter && request.getValidationLevel() >= ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_3_1 ) { - problems.add( new ModelProblemCollectorRequest( Severity.WARNING, Version.V31) - .setMessage( "The <reporting> section is deprecated, please move the reports to the <configuration> section of the new Maven Site Plugin.") - .setLocation( reporting.getLocation( "" ) )); + problems.add( new ModelProblemCollectorRequest( Severity.WARNING, Version.V31 ) + .setMessage( "The <reporting> section is deprecated, please move the reports to the <configuration> section of the new Maven Site Plugin." ) + .setLocation( reporting.getLocation( "" ) ) ); } for ( ReportPlugin plugin : reporting.getPlugins() ) http://git-wip-us.apache.org/repos/asf/maven/blob/b63904c9/maven-model-builder/src/main/java/org/apache/maven/model/profile/DefaultProfileSelector.java ---------------------------------------------------------------------- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/profile/DefaultProfileSelector.java b/maven-model-builder/src/main/java/org/apache/maven/model/profile/DefaultProfileSelector.java index dc00410..c376c99 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/profile/DefaultProfileSelector.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/profile/DefaultProfileSelector.java @@ -115,10 +115,10 @@ public class DefaultProfileSelector } catch ( RuntimeException e ) { - problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE) - .setMessage( "Failed to determine activation for profile " + profile.getId()) - .setLocation( profile.getLocation( "" )) - .setException( e )); + problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ) + .setMessage( "Failed to determine activation for profile " + profile.getId() ) + .setLocation( profile.getLocation( "" ) ) + .setException( e ) ); return false; } } http://git-wip-us.apache.org/repos/asf/maven/blob/b63904c9/maven-model-builder/src/main/java/org/apache/maven/model/profile/activation/JdkVersionProfileActivator.java ---------------------------------------------------------------------- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/profile/activation/JdkVersionProfileActivator.java b/maven-model-builder/src/main/java/org/apache/maven/model/profile/activation/JdkVersionProfileActivator.java index 7fa5537..62b6cfb 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/profile/activation/JdkVersionProfileActivator.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/profile/activation/JdkVersionProfileActivator.java @@ -65,7 +65,7 @@ public class JdkVersionProfileActivator { problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ) .setMessage( "Failed to determine Java version for profile " + profile.getId() ) - .setLocation(activation.getLocation( "jdk" ) ) ); + .setLocation( activation.getLocation( "jdk" ) ) ); return false; } http://git-wip-us.apache.org/repos/asf/maven/blob/b63904c9/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java ---------------------------------------------------------------------- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java b/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java index ff084f7..77219a7 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java @@ -62,7 +62,7 @@ public class DefaultModelValidator implements ModelValidator { - private static final Pattern ID_REGEX = Pattern.compile("[A-Za-z0-9_\\-.]+"); + private static final Pattern ID_REGEX = Pattern.compile( "[A-Za-z0-9_\\-.]+" ); private static final String ILLEGAL_FS_CHARS = "\\/:\"<>|?*"; @@ -230,8 +230,9 @@ public class DefaultModelValidator { if ( !"pom".equals( model.getPackaging() ) ) { - addViolation( problems, Severity.ERROR, Version.BASE,"packaging", null, "with value '" + model.getPackaging() - + "' is invalid. Aggregator projects " + "require 'pom' as packaging.", model ); + addViolation( problems, Severity.ERROR, Version.BASE, "packaging", null, + "with value '" + model.getPackaging() + "' is invalid. Aggregator projects " + + "require 'pom' as packaging.", model ); } for ( int i = 0, n = model.getModules().size(); i < n; i++ ) @@ -850,7 +851,8 @@ public class DefaultModelValidator buffer.append( ' ' ).append( message ); - problems.add( new ModelProblemCollectorRequest( severity, version ).setMessage( buffer.toString() ).setLocation( getLocation( fieldName, tracker ))); + problems.add( new ModelProblemCollectorRequest( severity, version ) + .setMessage( buffer.toString() ).setLocation( getLocation( fieldName, tracker ) ) ); } private static InputLocation getLocation( String fieldName, InputLocationTracker tracker )
