diff --git a/apache-maven/maven-wrapper.pom b/apache-maven/maven-wrapper.pom index daf1be1e2c..491f0a7b71 100644 --- a/apache-maven/maven-wrapper.pom +++ b/apache-maven/maven-wrapper.pom @@ -26,10 +26,10 @@ under the License. maven 4.0.0-alpha-1-SNAPSHOT - + apache-maven-wrapper pom - + Apache Maven Wrapper Distribution The Apache Maven Wrapper distribution in zip and tar.gz formats. @@ -89,7 +89,7 @@ under the License. - + org.apache.maven @@ -97,7 +97,7 @@ under the License. ${project.version} - + apache-release diff --git a/apache-maven/src/assembly/maven/component.xml b/apache-maven/src/assembly/maven/component.xml index 9befc3b4ab..1bea1ce912 100644 --- a/apache-maven/src/assembly/maven/component.xml +++ b/apache-maven/src/assembly/maven/component.xml @@ -101,7 +101,7 @@ under the License. lib - + diff --git a/apache-maven/src/assembly/maven/conf/toolchains.xml b/apache-maven/src/assembly/maven/conf/toolchains.xml index b2630723e7..75862b4fd0 100644 --- a/apache-maven/src/assembly/maven/conf/toolchains.xml +++ b/apache-maven/src/assembly/maven/conf/toolchains.xml @@ -44,24 +44,24 @@ under the License. - \ No newline at end of file diff --git a/apache-maven/src/assembly/wrapper/bin.xml b/apache-maven/src/assembly/wrapper/bin.xml index 0fef0321d9..d6f5281a59 100644 --- a/apache-maven/src/assembly/wrapper/bin.xml +++ b/apache-maven/src/assembly/wrapper/bin.xml @@ -37,7 +37,7 @@ under the License. .mvn/wrapper maven-wrapper.jar - + src/assembly/shared/mvnwDebug.cmd diff --git a/apache-maven/src/assembly/wrapper/shared/.mvn/wrapper/maven-wrapper.properties b/apache-maven/src/assembly/wrapper/shared/.mvn/wrapper/maven-wrapper.properties index 6e5352356a..6fda8be71d 100644 --- a/apache-maven/src/assembly/wrapper/shared/.mvn/wrapper/maven-wrapper.properties +++ b/apache-maven/src/assembly/wrapper/shared/.mvn/wrapper/maven-wrapper.properties @@ -5,9 +5,9 @@ # 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 diff --git a/apache-maven/src/assembly/wrapper/source/.mvn/wrapper/MavenWrapperDownloader.java b/apache-maven/src/assembly/wrapper/source/.mvn/wrapper/MavenWrapperDownloader.java index 2bf0f65f93..29c5656f6c 100644 --- a/apache-maven/src/assembly/wrapper/source/.mvn/wrapper/MavenWrapperDownloader.java +++ b/apache-maven/src/assembly/wrapper/source/.mvn/wrapper/MavenWrapperDownloader.java @@ -62,7 +62,7 @@ public class MavenWrapperDownloader { // If the maven-wrapper.properties exists, read it and check if it contains a custom // wrapperUrl parameter. File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); - + String url = null; String repoUrl = System.getenv( "MVNW_REPOURL" ); @@ -70,20 +70,20 @@ public class MavenWrapperDownloader { { url = repoUrl + DEFAULT_DOWNLOAD_PATH; } - else if ( mavenWrapperPropertyFile.exists() ) + else if ( mavenWrapperPropertyFile.exists() ) { Properties mavenWrapperProperties = new Properties(); - try ( InputStream mavenWrapperPropertyFileInputStream = new FileInputStream( mavenWrapperPropertyFile ) ) + try ( InputStream mavenWrapperPropertyFileInputStream = new FileInputStream( mavenWrapperPropertyFile ) ) { mavenWrapperProperties.load( mavenWrapperPropertyFileInputStream ); url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); - } + } catch ( IOException e ) { System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); } } - + if ( url == null ) { url = "https://repo.maven.apache.org/maven2" + DEFAULT_DOWNLOAD_PATH; diff --git a/apache-maven/src/main/appended-resources/META-INF/NOTICE.vm b/apache-maven/src/main/appended-resources/META-INF/NOTICE.vm index acf7ba42e0..37fad1f600 100644 --- a/apache-maven/src/main/appended-resources/META-INF/NOTICE.vm +++ b/apache-maven/src/main/appended-resources/META-INF/NOTICE.vm @@ -47,27 +47,27 @@ about.html in archive lib/org.eclipse.sisu.inject-0.3.4.jar

About org.eclipse.sisu.inject

- +

November 5, 2013

License

-

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, "Program" will mean the Content.

-

If you did not receive this Content directly from the Eclipse Foundation, the Content is +

If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was +apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at http://www.eclipse.org.

Third Party Content

-

The Content includes items that have been sourced from third parties as set -out below. If you did not receive this Content directly from the Eclipse Foundation, -the following is provided for informational purposes only, and you should look +

The Content includes items that have been sourced from third parties as set +out below. If you did not receive this Content directly from the Eclipse Foundation, +the following is provided for informational purposes only, and you should look to the Redistributor's license for terms and conditions of use.

ASM 4.1

diff --git a/apache-maven/src/main/appended-resources/licenses/CDDL-1.0.txt b/apache-maven/src/main/appended-resources/licenses/CDDL-1.0.txt index 9bc6342e22..4ec9fa9bbb 100644 --- a/apache-maven/src/main/appended-resources/licenses/CDDL-1.0.txt +++ b/apache-maven/src/main/appended-resources/licenses/CDDL-1.0.txt @@ -17,12 +17,12 @@ COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 Modifications, in each case including portions thereof. 1.4. "Executable" means the Covered Software in any form - other than Source Code. + other than Source Code. 1.5. "Initial Developer" means the individual or entity that first makes Original Software available under this - License. - + License. + 1.6. "Larger Work" means a work which combines Covered Software or portions thereof with code not governed by the terms of this License. @@ -33,29 +33,29 @@ COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein. - + 1.9. "Modifications" means the Source Code and Executable - form of any of the following: + form of any of the following: A. Any file that results from an addition to, deletion from or modification of the contents of a file containing Original Software or previous - Modifications; + Modifications; B. Any new file that contains any part of the - Original Software or previous Modification; or + Original Software or previous Modification; or C. Any new file that is contributed or otherwise made available under the terms of this License. 1.10. "Original Software" means the Source Code and Executable form of computer software code that is - originally released under this License. + originally released under this License. 1.11. "Patent Claims" means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent - Licensable by grantor. + Licensable by grantor. 1.12. "Source Code" means (a) the common form of computer software code in which modifications are made and (b) @@ -72,40 +72,40 @@ COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. - 2. License Grants. + 2. License Grants. 2.1. The Initial Developer Grant. Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, the Initial Developer hereby grants You a world-wide, - royalty-free, non-exclusive license: + royalty-free, non-exclusive license: (a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer, to use, reproduce, modify, display, perform, sublicense and distribute the Original Software (or portions thereof), with or without Modifications, - and/or as part of a Larger Work; and + and/or as part of a Larger Work; and (b) under Patent Claims infringed by the making, using or selling of Original Software, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Software (or - portions thereof). + portions thereof). (c) The licenses granted in Sections 2.1(a) and (b) are effective on the date Initial Developer first distributes or otherwise makes the Original Software available to a third party under the terms of this - License. + License. (d) Notwithstanding Section 2.1(b) above, no patent license is granted: (1) for code that You delete from the Original Software, or (2) for infringements caused by: (i) the modification of the Original Software, or (ii) the combination of the Original - Software with other software or devices. + Software with other software or devices. 2.2. Contributor Grant. @@ -121,7 +121,7 @@ COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 Contributor (or portions thereof), either on an unmodified basis, with other Modifications, as Covered Software and/or as part of a Larger Work; and - + (b) under Patent Claims infringed by the making, using, or selling of Modifications made by that @@ -132,12 +132,12 @@ COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 Modifications made by that Contributor (or portions thereof); and (2) the combination of Modifications made by that Contributor with its Contributor Version - (or portions of such combination). + (or portions of such combination). (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first distributes or otherwise makes the Modifications - available to a third party. + available to a third party. (d) Notwithstanding Section 2.2(b) above, no patent license is granted: (1) for any code that Contributor @@ -148,7 +148,7 @@ COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 with other software (except as part of the Contributor Version) or other devices; or (3) under Patent Claims infringed by Covered Software in the - absence of Modifications made by that Contributor. + absence of Modifications made by that Contributor. 3. Distribution Obligations. @@ -199,7 +199,7 @@ COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer. - + 3.5. Distribution of Executable Versions. @@ -226,9 +226,9 @@ COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License - are fulfilled for the Covered Software. - - 4. Versions of the License. + are fulfilled for the Covered Software. + + 4. Versions of the License. 4.1. New Versions. @@ -237,7 +237,7 @@ COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 from time to time. Each version will be given a distinguishing version number. Except as provided in Section 4.3, no one other than the license steward has the - right to modify this License. + right to modify this License. 4.2. Effect of New Versions. @@ -253,7 +253,7 @@ COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 the Covered Software. Otherwise, You may also choose to use, distribute or otherwise make the Covered Software available under the terms of any subsequent version of the - License published by the license steward. + License published by the license steward. 4.3. Modified Versions. @@ -264,7 +264,7 @@ COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 license steward (except to note that the license differs from this License); and (b) otherwise make it clear that the license contains terms which differ from this License. - + 5. DISCLAIMER OF WARRANTY. @@ -279,9 +279,9 @@ COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS - DISCLAIMER. + DISCLAIMER. - 6. TERMINATION. + 6. TERMINATION. 6.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/handler/ArtifactHandler.java b/maven-artifact/src/main/java/org/apache/maven/artifact/handler/ArtifactHandler.java index cd07d8aeb3..f85f4eafcf 100644 --- a/maven-artifact/src/main/java/org/apache/maven/artifact/handler/ArtifactHandler.java +++ b/maven-artifact/src/main/java/org/apache/maven/artifact/handler/ArtifactHandler.java @@ -25,7 +25,7 @@ package org.apache.maven.artifact.handler; *
  • information on how to use the artifact: whether to add it to the classpath, or to take into account its * dependencies.
  • * - * + * * @author Jason van Zyl */ public interface ArtifactHandler @@ -43,7 +43,7 @@ public interface ArtifactHandler /** * Get the classifier associated to the dependency type. - * + * * @return the classifier */ String getClassifier(); diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/DefaultArtifactVersion.java b/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/DefaultArtifactVersion.java index 75b19fa9f6..cf81eb30ff 100644 --- a/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/DefaultArtifactVersion.java +++ b/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/DefaultArtifactVersion.java @@ -238,7 +238,7 @@ public class DefaultArtifactVersion } catch ( NumberFormatException e ) { - // should never happen since checked isDigits(s) before + // should never happen since checked isDigits(s) before return null; } } diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java b/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java index d2409dd116..e56dd236c7 100644 --- a/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java +++ b/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java @@ -64,7 +64,7 @@ public class VersionRange } /** - * @deprecated VersionRange is immutable, cloning is not useful and even more an issue against the cache + * @deprecated VersionRange is immutable, cloning is not useful and even more an issue against the cache * @return a clone */ @Deprecated diff --git a/maven-artifact/src/test/java/org/apache/maven/artifact/versioning/ComparableVersionIT.java b/maven-artifact/src/test/java/org/apache/maven/artifact/versioning/ComparableVersionIT.java index 33b744b96c..394b7f0565 100644 --- a/maven-artifact/src/test/java/org/apache/maven/artifact/versioning/ComparableVersionIT.java +++ b/maven-artifact/src/test/java/org/apache/maven/artifact/versioning/ComparableVersionIT.java @@ -52,10 +52,10 @@ public class ComparableVersionIT if ( mavenArtifactJar.matcher( filename ).matches() ) { Process p = Runtime.getRuntime().exec( new String[] { - Paths.get( System.getProperty( "java.home" ), "bin/java" ).toString(), + Paths.get( System.getProperty( "java.home" ), "bin/java" ).toString(), "-jar", - file.toAbsolutePath().toString(), - "5.32", + file.toAbsolutePath().toString(), + "5.32", "5.27" } ); try diff --git a/maven-builder-support/src/main/java/org/apache/maven/building/FileSource.java b/maven-builder-support/src/main/java/org/apache/maven/building/FileSource.java index 05db3779e0..db1b2b2df7 100644 --- a/maven-builder-support/src/main/java/org/apache/maven/building/FileSource.java +++ b/maven-builder-support/src/main/java/org/apache/maven/building/FileSource.java @@ -35,7 +35,7 @@ public class FileSource { private final File file; - private final int hashCode; + private final int hashCode; /** * Creates a new source backed by the specified file. diff --git a/maven-builder-support/src/main/java/org/apache/maven/building/ProblemCollector.java b/maven-builder-support/src/main/java/org/apache/maven/building/ProblemCollector.java index e7015676ce..8439fef5c0 100644 --- a/maven-builder-support/src/main/java/org/apache/maven/building/ProblemCollector.java +++ b/maven-builder-support/src/main/java/org/apache/maven/building/ProblemCollector.java @@ -41,17 +41,17 @@ public interface ProblemCollector * @param cause The cause of the problem, may be {@code null}. */ void add( Problem.Severity severity, String message, int line, int column, Exception cause ); - + /** * The next messages will be bound to this source. When calling this method again, previous messages keep * their source, but the next messages will use the new source. - * + * * @param source */ void setSource( String source ); - + /** - * + * * @return the collected Problems, never {@code null} */ List getProblems(); diff --git a/maven-builder-support/src/main/java/org/apache/maven/building/ProblemCollectorFactory.java b/maven-builder-support/src/main/java/org/apache/maven/building/ProblemCollectorFactory.java index c1c23737ec..43c9bd3838 100644 --- a/maven-builder-support/src/main/java/org/apache/maven/building/ProblemCollectorFactory.java +++ b/maven-builder-support/src/main/java/org/apache/maven/building/ProblemCollectorFactory.java @@ -22,7 +22,7 @@ package org.apache.maven.building; import java.util.List; /** - * + * * @author Robert Scholte * @since 3.3.0 */ @@ -30,8 +30,8 @@ public class ProblemCollectorFactory { /** - * The default implementation is not visible, create it with this factory - * + * The default implementation is not visible, create it with this factory + * * @param problems starting set of problems, may be {@code null} * @return a new instance of a ProblemCollector */ diff --git a/maven-builder-support/src/main/java/org/apache/maven/building/StringSource.java b/maven-builder-support/src/main/java/org/apache/maven/building/StringSource.java index 68de5766cc..d305899578 100644 --- a/maven-builder-support/src/main/java/org/apache/maven/building/StringSource.java +++ b/maven-builder-support/src/main/java/org/apache/maven/building/StringSource.java @@ -99,7 +99,7 @@ public class StringSource @Override public boolean equals( Object obj ) { - if ( this == obj ) + if ( this == obj ) { return true; } diff --git a/maven-builder-support/src/test/java/org/apache/maven/building/DefaultProblemCollectorTest.java b/maven-builder-support/src/test/java/org/apache/maven/building/DefaultProblemCollectorTest.java index bf0f847710..57ddcfa1f8 100644 --- a/maven-builder-support/src/test/java/org/apache/maven/building/DefaultProblemCollectorTest.java +++ b/maven-builder-support/src/test/java/org/apache/maven/building/DefaultProblemCollectorTest.java @@ -35,10 +35,10 @@ public class DefaultProblemCollectorTest assertEquals( 0, collector.getProblems().size() ); collector.add( null, "MESSAGE1", -1, -1, null ); - + Exception e2 = new Exception(); collector.add( Severity.WARNING, null, 42, 127, e2 ); - + assertEquals( 2, collector.getProblems().size() ); Problem p1 = collector.getProblems().get(0); @@ -47,7 +47,7 @@ public class DefaultProblemCollectorTest assertEquals( -1, p1.getLineNumber() ); assertEquals( -1, p1.getColumnNumber() ); assertEquals( null, p1.getException() ); - + Problem p2 = collector.getProblems().get(1); assertEquals( Severity.WARNING, p2.getSeverity() ); assertEquals( "",p2.getMessage() ); @@ -60,7 +60,7 @@ public class DefaultProblemCollectorTest public void testSetSource() { DefaultProblemCollector collector = new DefaultProblemCollector( null ); - + collector.add( null, "PROBLEM1", -1, -1, null ); collector.setSource( "SOURCE_PROBLEM2" ); diff --git a/maven-builder-support/src/test/java/org/apache/maven/building/DefaultProblemTest.java b/maven-builder-support/src/test/java/org/apache/maven/building/DefaultProblemTest.java index 80a20da999..1615fc3751 100644 --- a/maven-builder-support/src/test/java/org/apache/maven/building/DefaultProblemTest.java +++ b/maven-builder-support/src/test/java/org/apache/maven/building/DefaultProblemTest.java @@ -36,14 +36,14 @@ public class DefaultProblemTest problem = new DefaultProblem( null, Severity.FATAL, null, -1, -1, null ); assertEquals( Severity.FATAL, problem.getSeverity() ); - + problem = new DefaultProblem( null, Severity.ERROR, null, -1, -1, null ); assertEquals( Severity.ERROR, problem.getSeverity() ); problem = new DefaultProblem( null, Severity.WARNING, null, -1, -1, null ); assertEquals( Severity.WARNING, problem.getSeverity() ); } - + @Test public void testGetLineNumber() { @@ -52,7 +52,7 @@ public class DefaultProblemTest problem = new DefaultProblem( null, null, null, 42, -1, null ); assertEquals( 42, problem.getLineNumber() ); - + problem = new DefaultProblem( null, null, null, Integer.MAX_VALUE, -1, null ); assertEquals( Integer.MAX_VALUE, problem.getLineNumber() ); @@ -60,7 +60,7 @@ public class DefaultProblemTest problem = new DefaultProblem( null, null, null, Integer.MIN_VALUE, -1, null ); assertEquals( Integer.MIN_VALUE, problem.getLineNumber() ); } - + @Test public void testGetColumnNumber() { @@ -69,7 +69,7 @@ public class DefaultProblemTest problem = new DefaultProblem( null, null, null, -1, 42, null ); assertEquals( 42, problem.getColumnNumber() ); - + problem = new DefaultProblem( null, null, null, -1, Integer.MAX_VALUE, null ); assertEquals( Integer.MAX_VALUE, problem.getColumnNumber() ); @@ -77,13 +77,13 @@ public class DefaultProblemTest problem = new DefaultProblem( null, null, null, -1, Integer.MIN_VALUE, null ); assertEquals( Integer.MIN_VALUE, problem.getColumnNumber() ); } - + @Test public void testGetException() { DefaultProblem problem = new DefaultProblem( null, null, null, -1, -1, null ); assertEquals( null, problem.getException() ); - + Exception e = new Exception(); problem = new DefaultProblem( null, null, null, -1, -1, e ); assertSame( e, problem.getException() ); @@ -94,7 +94,7 @@ public class DefaultProblemTest { DefaultProblem problem = new DefaultProblem( null, null, null, -1, -1, null ); assertEquals( "", problem.getSource() ); - + problem = new DefaultProblem( null, null, "", -1, -1, null ); assertEquals( "", problem.getSource() ); @@ -107,7 +107,7 @@ public class DefaultProblemTest { DefaultProblem problem = new DefaultProblem( null, null, null, -1, -1, null ); assertEquals( "", problem.getLocation() ); - + problem = new DefaultProblem( null, null, "SOURCE", -1, -1, null ); assertEquals( "SOURCE", problem.getLocation() ); @@ -120,7 +120,7 @@ public class DefaultProblemTest problem = new DefaultProblem( null, null, "SOURCE", 42, 127, null ); assertEquals( "SOURCE, line 42, column 127", problem.getLocation() ); } - + @Test public void testGetMessage() { diff --git a/maven-builder-support/src/test/java/org/apache/maven/building/ProblemCollectorFactoryTest.java b/maven-builder-support/src/test/java/org/apache/maven/building/ProblemCollectorFactoryTest.java index 44c7906c7c..2fdcbb70c4 100644 --- a/maven-builder-support/src/test/java/org/apache/maven/building/ProblemCollectorFactoryTest.java +++ b/maven-builder-support/src/test/java/org/apache/maven/building/ProblemCollectorFactoryTest.java @@ -33,10 +33,10 @@ public class ProblemCollectorFactoryTest public void testNewInstance() { ProblemCollector collector1 = ProblemCollectorFactory.newInstance( null ); - + Problem problem = new DefaultProblem( "MESSAGE1", null, null, -1, -1, null ); ProblemCollector collector2 = ProblemCollectorFactory.newInstance( Collections.singletonList( problem ) ); - + assertNotSame( collector1, collector2 ); assertEquals( 0, collector1.getProblems().size() ); assertEquals( 1, collector2.getProblems().size() ); diff --git a/maven-compat/src/main/java/org/apache/maven/repository/legacy/DefaultWagonManager.java b/maven-compat/src/main/java/org/apache/maven/repository/legacy/DefaultWagonManager.java index d8f590bb6b..ab6383afe8 100644 --- a/maven-compat/src/main/java/org/apache/maven/repository/legacy/DefaultWagonManager.java +++ b/maven-compat/src/main/java/org/apache/maven/repository/legacy/DefaultWagonManager.java @@ -440,7 +440,7 @@ public class DefaultWagonManager } catch ( ChecksumFailedException e ) { - // if we catch a ChecksumFailedException, it means the transfer/read succeeded, but the + // if we catch a ChecksumFailedException, it means the transfer/read succeeded, but the // checksum doesn't match. This could be a problem with the server (ibiblio HTTP-200 error // page), so we'll try this up to two times. On the second try, we'll handle it as a bona-fide // error, based on the repository's checksum checking policy. diff --git a/maven-compat/src/main/java/org/apache/maven/repository/legacy/resolver/DefaultLegacyArtifactCollector.java b/maven-compat/src/main/java/org/apache/maven/repository/legacy/resolver/DefaultLegacyArtifactCollector.java index ffc9e9a962..69c72bf669 100644 --- a/maven-compat/src/main/java/org/apache/maven/repository/legacy/resolver/DefaultLegacyArtifactCollector.java +++ b/maven-compat/src/main/java/org/apache/maven/repository/legacy/resolver/DefaultLegacyArtifactCollector.java @@ -695,7 +695,7 @@ public class DefaultLegacyArtifactCollector fireEvent( ResolutionListener.UPDATE_SCOPE, listeners, nearest, farthestArtifact ); // previously we cloned the artifact, but it is more efficient to just update the artifactScope - // if problems are later discovered that the original object needs its original artifactScope value, + // if problems are later discovered that the original object needs its original artifactScope value, // cloning may // again be appropriate nearestArtifact.setScope( farthestArtifact.getScope() ); diff --git a/maven-compat/src/test/remote-repo/org/apache/maven/its/a/0.1/a-0.1.pom b/maven-compat/src/test/remote-repo/org/apache/maven/its/a/0.1/a-0.1.pom index f451418856..03caa12ee8 100644 --- a/maven-compat/src/test/remote-repo/org/apache/maven/its/a/0.1/a-0.1.pom +++ b/maven-compat/src/test/remote-repo/org/apache/maven/its/a/0.1/a-0.1.pom @@ -29,7 +29,7 @@ under the License. Maven Integration Test :: Dummy Artifact - + diff --git a/maven-compat/src/test/remote-repo/org/apache/maven/its/b/0.1/b-0.1.pom b/maven-compat/src/test/remote-repo/org/apache/maven/its/b/0.1/b-0.1.pom index ca20cbf5a9..149a241088 100644 --- a/maven-compat/src/test/remote-repo/org/apache/maven/its/b/0.1/b-0.1.pom +++ b/maven-compat/src/test/remote-repo/org/apache/maven/its/b/0.1/b-0.1.pom @@ -29,7 +29,7 @@ under the License. Maven Integration Test :: Dummy Artifact - + diff --git a/maven-compat/src/test/resources/inheritance-repo/t12scm/maven/p0/1.0/p0-1.0.pom b/maven-compat/src/test/resources/inheritance-repo/t12scm/maven/p0/1.0/p0-1.0.pom index 97bf7ccc22..a22df68eac 100644 --- a/maven-compat/src/test/resources/inheritance-repo/t12scm/maven/p0/1.0/p0-1.0.pom +++ b/maven-compat/src/test/resources/inheritance-repo/t12scm/maven/p0/1.0/p0-1.0.pom @@ -4,13 +4,13 @@ p0 pom 1.0 - + scm:svn:http://host/p0 scm:svn:https://host/p0 http://host/viewer?path=/p0 - + modules/p1 diff --git a/maven-compat/src/test/resources/inheritance-repo/t12scm/maven/p1/1.0/p1-1.0.pom b/maven-compat/src/test/resources/inheritance-repo/t12scm/maven/p1/1.0/p1-1.0.pom index e9ddf0d78c..736b51539b 100644 --- a/maven-compat/src/test/resources/inheritance-repo/t12scm/maven/p1/1.0/p1-1.0.pom +++ b/maven-compat/src/test/resources/inheritance-repo/t12scm/maven/p1/1.0/p1-1.0.pom @@ -7,5 +7,5 @@ 4.0.0 p1 - + diff --git a/maven-core/src/main/java/org/apache/maven/ArtifactFilterManager.java b/maven-core/src/main/java/org/apache/maven/ArtifactFilterManager.java index e15037e402..7826e5b882 100644 --- a/maven-core/src/main/java/org/apache/maven/ArtifactFilterManager.java +++ b/maven-core/src/main/java/org/apache/maven/ArtifactFilterManager.java @@ -30,7 +30,7 @@ public interface ArtifactFilterManager { /** * Returns a filter for core + extension artifacts. - * + * * @deprecated use {@code META-INF/maven/extension.xml} to define artifacts exported by Maven core and plugin * extensions. */ @@ -43,7 +43,7 @@ public interface ArtifactFilterManager /** * Exclude an extension artifact (doesn't affect getArtifactFilter's result, only getExtensionArtifactFilter). - * + * * @deprecated use {@code META-INF/maven/extension.xml} to define artifacts exported by Maven core and plugin * extensions. */ diff --git a/maven-core/src/main/java/org/apache/maven/DefaultProjectDependenciesResolver.java b/maven-core/src/main/java/org/apache/maven/DefaultProjectDependenciesResolver.java index 2b7945ee05..0ee0bee029 100644 --- a/maven-core/src/main/java/org/apache/maven/DefaultProjectDependenciesResolver.java +++ b/maven-core/src/main/java/org/apache/maven/DefaultProjectDependenciesResolver.java @@ -135,7 +135,7 @@ public class DefaultProjectDependenciesResolver if ( ! exclusions.isEmpty() ) { - filter = new AndArtifactFilter( Arrays.asList( new ArtifactFilter[]{ + filter = new AndArtifactFilter( Arrays.asList( new ArtifactFilter[]{ new ExcludesArtifactFilter( exclusions ), scopeFilter } ) ); } else diff --git a/maven-core/src/main/java/org/apache/maven/ProjectCycleException.java b/maven-core/src/main/java/org/apache/maven/ProjectCycleException.java index ecd8ecacd7..b4a6fd0bf3 100644 --- a/maven-core/src/main/java/org/apache/maven/ProjectCycleException.java +++ b/maven-core/src/main/java/org/apache/maven/ProjectCycleException.java @@ -31,7 +31,7 @@ public class ProjectCycleException { super( message ); } - + public ProjectCycleException( String message, CycleDetectedException cause ) { super( message, cause ); diff --git a/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java b/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java index c1e21c44be..1f053810e5 100644 --- a/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java +++ b/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java @@ -382,7 +382,7 @@ public class RepositoryUtils { return false; } - + for ( Iterator it1 = r1.iterator(), it2 = r2.iterator(); it1.hasNext(); ) { if ( !repositoryEquals( it1.next(), it2.next() ) ) @@ -390,7 +390,7 @@ public class RepositoryUtils return false; } } - + return true; } @@ -428,7 +428,7 @@ public class RepositoryUtils { return true; } - + return Objects.equals( r1.getId(), r2.getId() ) && Objects.equals( r1.getUrl(), r2.getUrl() ) && policyEquals( r1.getPolicy( false ), r2.getPolicy( false ) ) && policyEquals( r1.getPolicy( true ), r2.getPolicy( true ) ); diff --git a/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulator.java b/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulator.java index 399ee34483..94e9eccd4a 100644 --- a/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulator.java +++ b/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulator.java @@ -58,9 +58,9 @@ import org.codehaus.plexus.util.StringUtils; public class DefaultMavenExecutionRequestPopulator implements MavenExecutionRequestPopulator { - + private final MavenRepositorySystem repositorySystem; - + @Inject public DefaultMavenExecutionRequestPopulator( MavenRepositorySystem repositorySystem ) { @@ -90,7 +90,7 @@ public class DefaultMavenExecutionRequestPopulator } return request; } - + @Override public MavenExecutionRequest populateDefaults( MavenExecutionRequest request ) throws MavenExecutionRequestPopulationException @@ -107,11 +107,11 @@ public class DefaultMavenExecutionRequestPopulator return request; } - + // // // - + private void populateDefaultPluginGroups( MavenExecutionRequest request ) { request.addPluginGroup( "org.apache.maven.plugins" ); @@ -211,10 +211,10 @@ public class DefaultMavenExecutionRequestPopulator { request.setBaseDirectory( request.getPom().getAbsoluteFile().getParentFile() ); } - } - + } + /*if_not[MAVEN4]*/ - + @Override @Deprecated public MavenExecutionRequest populateFromSettings( MavenExecutionRequest request, Settings settings ) @@ -316,8 +316,8 @@ public class DefaultMavenExecutionRequestPopulator } return request; - } - + } + /*end[MAVEN4]*/ } diff --git a/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequestPopulator.java b/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequestPopulator.java index 4f254f7a04..c2d4c845fd 100644 --- a/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequestPopulator.java +++ b/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequestPopulator.java @@ -54,7 +54,7 @@ public interface MavenExecutionRequestPopulator throws MavenExecutionRequestPopulationException; /*if_not[MAVEN4]*/ - + /** * Copies the values from the given settings into the specified execution request. This method will replace any * existing values in the execution request that are controlled by the settings. Hence, it is expected that this diff --git a/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java b/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java index 8da252fb54..f8dbb03570 100644 --- a/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java +++ b/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java @@ -273,7 +273,7 @@ public class MavenSession { this.projectMap = projectMap; } - + /** This is a provisional method and may be removed */ public List getAllProjects() { @@ -285,24 +285,24 @@ public class MavenSession { this.allProjects = allProjects; } - + /*if_not[MAVEN4]*/ // - // Deprecated + // Deprecated // - - private PlexusContainer container; - + + private PlexusContainer container; + private final Settings settings; - + @Deprecated /** @deprecated This appears not to be used anywhere within Maven itself. */ - public Map getProjectMap() + public Map getProjectMap() { return projectMap; } - + @Deprecated public MavenSession( PlexusContainer container, RepositorySystemSession repositorySession, MavenExecutionRequest request, MavenExecutionResult result ) @@ -313,7 +313,7 @@ public class MavenSession this.settings = new SettingsAdapter( request ); this.repositorySession = repositorySession; } - + @Deprecated public MavenSession( PlexusContainer container, MavenExecutionRequest request, MavenExecutionResult result, MavenProject project ) @@ -365,7 +365,7 @@ public class MavenSession { return getProjects(); } - + @Deprecated // // Used by Tycho and will break users and force them to upgrade to Maven 3.1 so we should really leave @@ -403,7 +403,7 @@ public class MavenSession return executionProperties; } - + @Deprecated public PlexusContainer getContainer() { @@ -436,7 +436,7 @@ public class MavenSession throws ComponentLookupException { return container.lookupMap( role ); - } - + } + /*end[MAVEN4]*/ } diff --git a/maven-core/src/main/java/org/apache/maven/extension/internal/CoreExports.java b/maven-core/src/main/java/org/apache/maven/extension/internal/CoreExports.java index 331617cfa2..d72b3f9ea2 100644 --- a/maven-core/src/main/java/org/apache/maven/extension/internal/CoreExports.java +++ b/maven-core/src/main/java/org/apache/maven/extension/internal/CoreExports.java @@ -31,7 +31,7 @@ import org.codehaus.plexus.classworlds.realm.ClassRealm; /** * Provides information about artifacts (identified by groupId:artifactId string key) and classpath elements exported by * Maven core itself and loaded Maven core extensions. - * + * * @since 3.3.0 */ public class CoreExports diff --git a/maven-core/src/main/java/org/apache/maven/internal/aether/ConsumerModelSourceTransformer.java b/maven-core/src/main/java/org/apache/maven/internal/aether/ConsumerModelSourceTransformer.java index 4d5d263653..6da4193121 100644 --- a/maven-core/src/main/java/org/apache/maven/internal/aether/ConsumerModelSourceTransformer.java +++ b/maven-core/src/main/java/org/apache/maven/internal/aether/ConsumerModelSourceTransformer.java @@ -54,13 +54,13 @@ class ConsumerModelSourceTransformer extends AbstractModelSourceTransformer return new DefaultConsumerPomXMLFilterFactory( new DefaultBuildPomXMLFilterFactory( context, lexicalHandlerConsumer, true ) ).get( pomFile ); } - + /** * This transformer will ensure that encoding and version are kept. * However, it cannot prevent: *
      *
    • attributes will be on one line
    • - *
    • Unnecessary whitespace before the rootelement will be removed
    • + *
    • Unnecessary whitespace before the rootelement will be removed
    • *
    */ @Override @@ -68,9 +68,9 @@ class ConsumerModelSourceTransformer extends AbstractModelSourceTransformer throws IOException, org.apache.maven.model.building.TransformerException { final TransformerHandler transformerHandler; - + final SAXTransformerFactory transformerFactory = getTransformerFactory(); - + // Keep same encoding+version try ( InputStream input = Files.newInputStream( pomFile ) ) { @@ -81,7 +81,7 @@ class ConsumerModelSourceTransformer extends AbstractModelSourceTransformer final String encoding = streamReader.getCharacterEncodingScheme(); final String version = streamReader.getVersion(); - + Transformer transformer = transformerHandler.getTransformer(); transformer.setOutputProperty( OutputKeys.METHOD, "xml" ); if ( encoding == null && version == null ) @@ -104,7 +104,7 @@ class ConsumerModelSourceTransformer extends AbstractModelSourceTransformer } catch ( XMLStreamException | TransformerConfigurationException e ) { - throw new org.apache.maven.model.building.TransformerException( + throw new org.apache.maven.model.building.TransformerException( "Failed to detect XML encoding and version", e ); } return transformerHandler; diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycles.java b/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycles.java index 1a5b4a0f0a..16b2b8c974 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycles.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycles.java @@ -70,7 +70,7 @@ public class DefaultLifecycles /** * Get lifecycle based on phase - * + * * @param phase * @return */ @@ -121,22 +121,22 @@ public class DefaultLifecycles public List getLifeCycles() { List lifecycleIds = Arrays.asList( STANDARD_LIFECYCLES ); - - Comparator comparator = ( l, r ) -> + + Comparator comparator = ( l, r ) -> { int lx = lifecycleIds.indexOf( l ); int rx = lifecycleIds.indexOf( r ); - if ( lx < 0 || rx < 0 ) + if ( lx < 0 || rx < 0 ) { return rx - lx; } - else + else { return lx - rx; } - }; - + }; + // ensure canonical order of standard lifecycles return lifecyclesMap.values().stream() .peek( l -> Objects.requireNonNull( l.getId(), "A lifecycle must have an id." ) ) @@ -150,5 +150,5 @@ public class DefaultLifecycles .flatMap( l -> l.getPhases().stream() ) .collect( Collectors.joining( ", " ) ); } - + } diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/Lifecycle.java b/maven-core/src/main/java/org/apache/maven/lifecycle/Lifecycle.java index 5fc99d532c..8115bf8984 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/Lifecycle.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/Lifecycle.java @@ -72,7 +72,7 @@ public class Lifecycle { return defaultPhases; } - + @Deprecated public Map getDefaultPhases() { diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/MojoExecutionConfigurator.java b/maven-core/src/main/java/org/apache/maven/lifecycle/MojoExecutionConfigurator.java index c52a4409cf..07219b22b5 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/MojoExecutionConfigurator.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/MojoExecutionConfigurator.java @@ -36,7 +36,7 @@ public interface MojoExecutionConfigurator /** * Create the MojoExecution configuration based on configuration for a Mojo in the MavenProject and the * default configuration for the Mojo from the containing plugin's plugin.xml descriptor. - * + * * @param project * @param mojoExecution * @param allowPluginLevelConfig diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/BuildListCalculator.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/BuildListCalculator.java index d8ad993e6a..9000c9301e 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/BuildListCalculator.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/BuildListCalculator.java @@ -32,7 +32,7 @@ import org.apache.maven.project.MavenProject; /** * NOTE: This class is not part of any public api and can be changed or deleted without prior notice. - * + * * @since 3.0 * @author Kristian Rosenvold */ diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleExecutionPlanCalculator.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleExecutionPlanCalculator.java index d90a58b28f..fc64b92af2 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleExecutionPlanCalculator.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleExecutionPlanCalculator.java @@ -65,7 +65,7 @@ import org.codehaus.plexus.util.xml.pull.XmlPullParserException; /** * NOTE: This class is not part of any public api and can be changed or deleted without prior notice. - * + * * @since 3.0 * @author Benjamin Bentmann * @author Kristian Rosenvold (Extract class) @@ -155,7 +155,7 @@ public class DefaultLifecycleExecutionPlanCalculator LifecyclePhaseNotFoundException, LifecycleNotFoundException, PluginVersionResolutionException { Set alreadyPlannedExecutions = fillMojoDescriptors( session, project, mojoExecutions ); - + for ( MojoExecution mojoExecution : mojoExecutions ) { setupMojoExecution( session, project, mojoExecution, alreadyPlannedExecutions ); diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java index ed8ee7f900..f1bb442e24 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java @@ -45,7 +45,7 @@ import org.codehaus.plexus.util.xml.Xpp3Dom; /** * NOTE: This class is not part of any public api and can be changed or deleted without prior notice. - * + * * @since 3.0 * @author Benjamin Bentmann * @author Jason van Zyl @@ -153,13 +153,13 @@ public class DefaultLifecyclePluginAnalyzer List mojos = goals.getMojos(); if ( mojos != null ) { - + for ( int i = 0; i < mojos.size(); i++ ) { LifecycleMojo mojo = mojos.get( i ); - + GoalSpec gs = parseGoalSpec( mojo.getGoal() ); - + if ( gs == null ) { logger.warn( "Ignored invalid goal specification '" + mojo.getGoal() @@ -176,7 +176,7 @@ public class DefaultLifecyclePluginAnalyzer plugin.setLocation( "groupId", location ); plugin.setLocation( "artifactId", location ); plugin.setLocation( "version", location ); - + Plugin existing = plugins.get( plugin ); if ( existing != null ) { @@ -191,7 +191,7 @@ public class DefaultLifecyclePluginAnalyzer { plugins.put( plugin, plugin ); } - + PluginExecution execution = new PluginExecution(); execution.setId( getExecutionId( plugin, gs.goal ) ); execution.setPhase( phase ); diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DependencyContext.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DependencyContext.java index 55b14d6faa..281420b91d 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DependencyContext.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DependencyContext.java @@ -31,7 +31,7 @@ import java.util.TreeSet; * Context of dependency artifacts for a particular project. *

    * NOTE: This class is not part of any public api and can be changed or deleted without prior notice. - * + * * @since 3.0 * @author Benjamin Bentmann * @author Kristian Rosenvold (class extract only) 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 e755aa904c..44d6cef95c 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 @@ -78,7 +78,7 @@ public class LifecycleDependencyResolver @Inject private EventSpyDispatcher eventSpyDispatcher; - + @Inject private ProjectArtifactsCache projectArtifactsCache; @@ -129,13 +129,13 @@ public class LifecycleDependencyResolver throw new LifecycleExecutionException( e ); } } - + Set resolvedArtifacts; - ProjectArtifactsCache.Key cacheKey = projectArtifactsCache.createKey( project, scopesToCollect, + ProjectArtifactsCache.Key cacheKey = projectArtifactsCache.createKey( project, scopesToCollect, scopesToResolve, aggregating, session.getRepositorySession() ); ProjectArtifactsCache.CacheRecord recordArtifacts; recordArtifacts = projectArtifactsCache.get( cacheKey ); - + if ( recordArtifacts != null ) { resolvedArtifacts = recordArtifacts.getArtifacts(); @@ -167,7 +167,7 @@ public class LifecycleDependencyResolver for ( Artifact artifact : resolvedArtifacts ) { /** - * MNG-6300: resolvedArtifacts can be cache result; this ensures reactor files are always up to date + * MNG-6300: resolvedArtifacts can be cache result; this ensures reactor files are always up to date * During lifecycle the Artifact.getFile() can change from target/classes to the actual jar. * This clearly shows that target/classes should not be abused as artifactFile just for the classpath */ @@ -179,9 +179,9 @@ public class LifecycleDependencyResolver map.put( artifact.getDependencyConflictId(), artifact ); } - + project.setResolvedArtifacts( resolvedArtifacts ); - + for ( Artifact artifact : project.getDependencyArtifacts() ) { if ( artifact.getFile() == null ) diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilder.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilder.java index dc7c7bd69f..73839fc7c3 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilder.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilder.java @@ -42,7 +42,7 @@ import org.apache.maven.session.scope.internal.SessionScope; * Builds one or more lifecycles for a full module *

    * NOTE: This class is not part of any public api and can be changed or deleted without prior notice. - * + * * @since 3.0 * @author Benjamin Bentmann * @author Jason van Zyl diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleStarter.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleStarter.java index f616654c18..e3d886d283 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleStarter.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleStarter.java @@ -68,7 +68,7 @@ public class LifecycleStarter @Inject private Map builders; - + @Inject private SessionScope sessionScope; diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ProjectArtifactFactory.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ProjectArtifactFactory.java index 8665c80737..e698811f6d 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ProjectArtifactFactory.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ProjectArtifactFactory.java @@ -30,7 +30,7 @@ import org.apache.maven.project.artifact.InvalidDependencyVersionException; * Component interface responsible for creation of MavenProject#dependencyArtifacts instances. *

    * NOTE: This class is not part of any public api and can be changed or deleted without prior notice. - * + * * @since 3.2.4 */ public interface ProjectArtifactFactory diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/TaskSegment.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/TaskSegment.java index 8a44343553..5b0165f7d5 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/TaskSegment.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/TaskSegment.java @@ -27,7 +27,7 @@ import java.util.List; * Describes the required task segment as provided on the maven command line; i.e. "clean jetty:run install" * * NOTE: This class is not part of any public api and can be changed or deleted without prior notice. - * + * * @since 3.0 * @author Benjamin Bentmann * @author Kristian Rosenvold (extracted class only) diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java index 8ad2650ceb..c0cd289d5d 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java @@ -140,18 +140,18 @@ public class BuilderCommon logger.warn( "*****************************************************************" ); } } - + final String defaulModelId = DefaultLifecyclePluginAnalyzer.DEFAULTLIFECYCLEBINDINGS_MODELID; - + List unversionedPlugins = executionPlan.getMojoExecutions().stream() .map( MojoExecution::getPlugin ) .filter( p -> p.getLocation( "version" ) != null ) // versionless cli goal (?) .filter( p -> p.getLocation( "version" ).getSource() != null ) // versionless in pom (?) .filter( p -> defaulModelId.equals( p.getLocation( "version" ).getSource().getModelId() ) ) .distinct() - .map( Plugin::getArtifactId ) // managed by us, groupId is always o.a.m.plugins + .map( Plugin::getArtifactId ) // managed by us, groupId is always o.a.m.plugins .collect( Collectors.toList() ); - + if ( !unversionedPlugins.isEmpty() ) { logger.warn( "Version not locked for default bindings plugins " + unversionedPlugins diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/ThreadOutputMuxer.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/ThreadOutputMuxer.java index d17a20e44f..273570b68e 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/ThreadOutputMuxer.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/ThreadOutputMuxer.java @@ -36,7 +36,7 @@ import org.apache.maven.lifecycle.internal.ProjectSegment; * NOTE: This class is not part of any public api and can be changed or deleted without prior notice. * This class in particular may spontaneously self-combust and be replaced by a plexus-compliant thread aware * logger implementation at any time. - * + * * @since 3.0 * @author Kristian Rosenvold */ diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/DefaultLifecycleMapping.java b/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/DefaultLifecycleMapping.java index e12debef5f..7c8716cee9 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/DefaultLifecycleMapping.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/DefaultLifecycleMapping.java @@ -110,7 +110,7 @@ public class DefaultLifecycleMapping return null; } } - + @Deprecated public Map getPhases( String lifecycle ) { diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/LifecycleMojo.java b/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/LifecycleMojo.java index cd9a5b149a..504a880e81 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/LifecycleMojo.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/LifecycleMojo.java @@ -29,36 +29,36 @@ import org.codehaus.plexus.util.xml.Xpp3Dom; */ public class LifecycleMojo { - + private String goal; private Xpp3Dom configuration; private List dependencies; - + public String getGoal() { return goal; } - + public Xpp3Dom getConfiguration() { return configuration; } - + public List getDependencies() { return dependencies; } - + public void setGoal( String goal ) { this.goal = goal; } - + public void setConfiguration( Xpp3Dom configuration ) { this.configuration = configuration; } - + public void setDependencies( List dependencies ) { this.dependencies = dependencies; diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/LifecyclePhase.java b/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/LifecyclePhase.java index bf052c741b..ca9da81000 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/LifecyclePhase.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/LifecyclePhase.java @@ -32,36 +32,36 @@ import org.codehaus.plexus.util.StringUtils; */ public class LifecyclePhase { - + private List mojos; - + public LifecyclePhase() { } - + public LifecyclePhase( String goals ) { set( goals ); } - + public List getMojos() { return mojos; } - + public void setMojos( List mojos ) { this.mojos = mojos; } - + public void set( String goals ) { mojos = new ArrayList<>(); - + if ( StringUtils.isNotEmpty( goals ) ) { String[] mojoGoals = StringUtils.split( goals, "," ); - + for ( String mojoGoal: mojoGoals ) { LifecycleMojo lifecycleMojo = new LifecycleMojo(); @@ -70,7 +70,7 @@ public class LifecyclePhase } } } - + @Override public String toString() { @@ -94,7 +94,7 @@ public class LifecyclePhase } return sb.toString(); } - + @Deprecated public static Map toLegacyMap( Map lifecyclePhases ) { @@ -102,12 +102,12 @@ public class LifecyclePhase { return null; } - + if ( lifecyclePhases.isEmpty() ) { return Collections.emptyMap(); } - + Map phases = new LinkedHashMap<>(); for ( Map.Entry e: lifecyclePhases.entrySet() ) { @@ -115,5 +115,5 @@ public class LifecyclePhase } return phases; } - + } diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginArtifactsCache.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginArtifactsCache.java index 99de6d7e21..7f8ff14064 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginArtifactsCache.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginArtifactsCache.java @@ -122,9 +122,9 @@ public class DefaultPluginArtifactsCache CacheKey that = (CacheKey) o; - return CacheUtils.pluginEquals( plugin, that.plugin ) + return CacheUtils.pluginEquals( plugin, that.plugin ) && Objects.equals( workspace, that.workspace ) - && Objects.equals( localRepo, that.localRepo ) + && Objects.equals( localRepo, that.localRepo ) && RepositoryUtils.repositoriesEquals( repositories, that.repositories ) && Objects.equals( filter, that.filter ); } diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginDescriptorCache.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginDescriptorCache.java index 130cc358e8..69297ea28d 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginDescriptorCache.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginDescriptorCache.java @@ -197,9 +197,9 @@ public class DefaultPluginDescriptorCache CacheKey that = (CacheKey) obj; - return Objects.equals( this.artifactId, that.artifactId ) + return Objects.equals( this.artifactId, that.artifactId ) && Objects.equals( this.groupId, that.groupId ) - && Objects.equals( this.version, that.version ) + && Objects.equals( this.version, that.version ) && Objects.equals( this.localRepo, that.localRepo ) && Objects.equals( this.workspace, that.workspace ) && RepositoryUtils.repositoriesEquals( this.repositories, that.repositories ); diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginRealmCache.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginRealmCache.java index cd0bbb91b1..b2b1c40a5e 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginRealmCache.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginRealmCache.java @@ -135,11 +135,11 @@ public class DefaultPluginRealmCache CacheKey that = (CacheKey) o; - return parentRealm == that.parentRealm + return parentRealm == that.parentRealm && CacheUtils.pluginEquals( plugin, that.plugin ) - && Objects.equals( workspace, that.workspace ) + && Objects.equals( workspace, that.workspace ) && Objects.equals( localRepo, that.localRepo ) - && RepositoryUtils.repositoriesEquals( this.repositories, that.repositories ) + && RepositoryUtils.repositoriesEquals( this.repositories, that.repositories ) && Objects.equals( filter, that.filter ) && Objects.equals( foreignImports, that.foreignImports ); } diff --git a/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginManager.java index b228a1b4b7..c1ef63e7f4 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginManager.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginManager.java @@ -95,7 +95,7 @@ public interface MavenPluginManager /** * Sets up class realm for the specified build extensions plugin. - * + * * @since 3.3.0 */ ExtensionRealmCache.CacheRecord setupExtensionsRealm( MavenProject project, Plugin plugin, diff --git a/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java b/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java index 8244487527..4f55033823 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java @@ -54,7 +54,7 @@ import org.codehaus.plexus.util.introspection.ReflectionValueExtractor; * settings {@link MavenSession#getSettings()} * settings.* * basedir - * {@link MavenSession#getExecutionRootDirectory()} or + * {@link MavenSession#getExecutionRootDirectory()} or * System.getProperty( "user.dir" ) if null * mojoExecution the actual {@link MojoExecution} * mojo (since Maven 3)same as mojoExecution @@ -106,12 +106,12 @@ public class PluginParameterExpressionEvaluator this.project = session.getCurrentProject(); // - // Maven4: We may want to evaluate how this is used but we add these separate as the + // Maven4: We may want to evaluate how this is used but we add these separate as the // getExecutionProperties is deprecated in MavenSession. // this.properties.putAll( session.getUserProperties() ); this.properties.putAll( session.getSystemProperties() ); - + String basedir = null; if ( project != null ) diff --git a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java index 500ead6d68..7c77ee8843 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java @@ -128,7 +128,7 @@ public class DefaultMavenPluginManager * same class realm is used to load build extensions and load mojos for extensions=true plugins. *

    * Note: This is part of internal implementation and may be changed or removed without notice - * + * * @since 3.3.0 */ public static final String KEY_EXTENSIONS_REALMS = DefaultMavenPluginManager.class.getName() + "/extensionsRealms"; diff --git a/maven-core/src/main/java/org/apache/maven/project/MavenProject.java b/maven-core/src/main/java/org/apache/maven/project/MavenProject.java index 3cf7bd1428..94dc70aa9d 100644 --- a/maven-core/src/main/java/org/apache/maven/project/MavenProject.java +++ b/maven-core/src/main/java/org/apache/maven/project/MavenProject.java @@ -1073,7 +1073,7 @@ public class MavenProject MavenProject that = (MavenProject) other; return Objects.equals( getArtifactId(), that.getArtifactId() ) - && Objects.equals( getGroupId(), that.getGroupId() ) + && Objects.equals( getGroupId(), that.getGroupId() ) && Objects.equals( getVersion(), that.getVersion() ); } diff --git a/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java b/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java index 470bb2529b..ae44924e91 100644 --- a/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java +++ b/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java @@ -273,7 +273,7 @@ public class ProjectModelResolver } dependency.setVersion( versionRangeResult.getHighestVersion().toString() ); - + if ( modelPool != null ) { Model model = diff --git a/maven-core/src/main/java/org/apache/maven/project/ReactorModelCache.java b/maven-core/src/main/java/org/apache/maven/project/ReactorModelCache.java index 20e57b9eca..10ca8786bf 100644 --- a/maven-core/src/main/java/org/apache/maven/project/ReactorModelCache.java +++ b/maven-core/src/main/java/org/apache/maven/project/ReactorModelCache.java @@ -108,13 +108,13 @@ class ReactorModelCache return hashCode; } } - + private static final class SourceCacheKey { private final Source source; - + private final String tag; - + private final int hashCode; SourceCacheKey( Source source, String tag ) @@ -133,7 +133,7 @@ class ReactorModelCache @Override public boolean equals( Object obj ) { - if ( this == obj ) + if ( this == obj ) { return true; } @@ -141,13 +141,13 @@ class ReactorModelCache { return false; } - + SourceCacheKey other = (SourceCacheKey) obj; if ( !Objects.equals( this.source, other.source ) ) { return false; } - + if ( !Objects.equals( this.tag, other.tag ) ) { return false; diff --git a/maven-core/src/main/java/org/apache/maven/project/ReactorModelPool.java b/maven-core/src/main/java/org/apache/maven/project/ReactorModelPool.java index b5cb2ece8a..b46eea81ea 100644 --- a/maven-core/src/main/java/org/apache/maven/project/ReactorModelPool.java +++ b/maven-core/src/main/java/org/apache/maven/project/ReactorModelPool.java @@ -45,7 +45,7 @@ class ReactorModelPool /** * Get the model by its GAV or (since 4.0.0) by its GA if there is only one. - * + * * @param groupId, never {@code null} * @param artifactId, never {@code null} * @param version, can be {@code null} @@ -56,7 +56,7 @@ class ReactorModelPool { return modelsByGa.getOrDefault( new GAKey( groupId, artifactId ), Collections.emptySet() ).stream() .filter( m -> version == null || version.equals( getVersion( m ) ) ) - .reduce( ( a, b ) -> + .reduce( ( a, b ) -> { throw new IllegalStateException( "Multiple modules with key " + a.getGroupId() + ':' + a.getArtifactId() ); @@ -65,7 +65,7 @@ class ReactorModelPool /** * Find model by path, useful when location the parent by relativePath - * + * * @param path * @return the matching model or {@code null} * @since 4.0.0 @@ -83,7 +83,7 @@ class ReactorModelPool } return modelsByPath.get( pomFile ); } - + private String getVersion( Model model ) { String version = model.getVersion(); @@ -97,7 +97,7 @@ class ReactorModelPool static class Builder { private ReactorModelPool pool = new ReactorModelPool(); - + Builder put( Path pomFile, Model model ) { pool.modelsByPath.put( pomFile, model ); @@ -105,8 +105,8 @@ class ReactorModelPool k -> new HashSet() ).add( model ); return this; } - - ReactorModelPool build() + + ReactorModelPool build() { return pool; } diff --git a/maven-core/src/main/java/org/apache/maven/project/RepositorySessionDecorator.java b/maven-core/src/main/java/org/apache/maven/project/RepositorySessionDecorator.java index 82d6c9dbfc..d739c75be2 100644 --- a/maven-core/src/main/java/org/apache/maven/project/RepositorySessionDecorator.java +++ b/maven-core/src/main/java/org/apache/maven/project/RepositorySessionDecorator.java @@ -23,8 +23,8 @@ import org.eclipse.aether.RepositorySystemSession; /** * Component interface that allows per-project customization of Aether repository system sessions. - * - * Note: This interface is part of work in progress and can be changed or removed without notice. + * + * Note: This interface is part of work in progress and can be changed or removed without notice. * @since 3.2.4 */ public interface RepositorySessionDecorator diff --git a/maven-core/src/main/java/org/apache/maven/project/artifact/DefaultProjectArtifactsCache.java b/maven-core/src/main/java/org/apache/maven/project/artifact/DefaultProjectArtifactsCache.java index 7ec4d9af74..b4f6b63593 100644 --- a/maven-core/src/main/java/org/apache/maven/project/artifact/DefaultProjectArtifactsCache.java +++ b/maven-core/src/main/java/org/apache/maven/project/artifact/DefaultProjectArtifactsCache.java @@ -60,11 +60,11 @@ public class DefaultProjectArtifactsCache { private final String groupId; - + private final String artifactId; - + private final String version; - + private final Set dependencyArtifacts; private final WorkspaceRepository workspace; @@ -72,11 +72,11 @@ public class DefaultProjectArtifactsCache private final LocalRepository localRepo; private final List repositories; - + private final Set collect; - + private final Set resolve; - + private boolean aggregating; private final int hashCode; @@ -85,11 +85,11 @@ public class DefaultProjectArtifactsCache Collection scopesToCollect, Collection scopesToResolve, boolean aggregating, RepositorySystemSession session ) { - + groupId = project.getGroupId(); artifactId = project.getArtifactId(); version = project.getVersion(); - + Set deps = new LinkedHashSet<>(); if ( project.getDependencyArtifacts() != null ) { @@ -99,7 +99,7 @@ public class DefaultProjectArtifactsCache } } dependencyArtifacts = Collections.unmodifiableSet( deps ); - + workspace = RepositoryUtils.getWorkspace( session ); this.localRepo = session.getLocalRepository(); this.repositories = new ArrayList<>( repositories.size() ); @@ -115,10 +115,10 @@ public class DefaultProjectArtifactsCache } } collect = scopesToCollect == null - ? Collections.emptySet() + ? Collections.emptySet() : Collections.unmodifiableSet( new HashSet<>( scopesToCollect ) ); - resolve = scopesToResolve == null - ? Collections.emptySet() + resolve = scopesToResolve == null + ? Collections.emptySet() : Collections.unmodifiableSet( new HashSet<>( scopesToResolve ) ); this.aggregating = aggregating; @@ -166,10 +166,10 @@ public class DefaultProjectArtifactsCache return Objects.equals( groupId, that.groupId ) && Objects.equals( artifactId, that.artifactId ) && Objects.equals( version, that.version ) && Objects.equals( dependencyArtifacts, that.dependencyArtifacts ) - && Objects.equals( workspace, that.workspace ) + && Objects.equals( workspace, that.workspace ) && Objects.equals( localRepo, that.localRepo ) && RepositoryUtils.repositoriesEquals( repositories, that.repositories ) - && Objects.equals( collect, that.collect ) + && Objects.equals( collect, that.collect ) && Objects.equals( resolve, that.resolve ) && aggregating == that.aggregating; } @@ -181,7 +181,7 @@ public class DefaultProjectArtifactsCache public Key createKey( MavenProject project, Collection scopesToCollect, Collection scopesToResolve, boolean aggregating, RepositorySystemSession session ) { - return new CacheKey( project, project.getRemoteProjectRepositories(), scopesToCollect, scopesToResolve, + return new CacheKey( project, project.getRemoteProjectRepositories(), scopesToCollect, scopesToResolve, aggregating, session ); } diff --git a/maven-core/src/main/java/org/apache/maven/project/artifact/ProjectArtifactsCache.java b/maven-core/src/main/java/org/apache/maven/project/artifact/ProjectArtifactsCache.java index 8d8ad790ed..fa0f3c5bc9 100644 --- a/maven-core/src/main/java/org/apache/maven/project/artifact/ProjectArtifactsCache.java +++ b/maven-core/src/main/java/org/apache/maven/project/artifact/ProjectArtifactsCache.java @@ -79,7 +79,7 @@ public interface ProjectArtifactsCache } } - Key createKey( MavenProject project, Collection scopesToCollect, Collection scopesToResolve, + Key createKey( MavenProject project, Collection scopesToCollect, Collection scopesToResolve, boolean aggregating, RepositorySystemSession session ); CacheRecord get( Key key ) throws LifecycleExecutionException; diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchain.java b/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchain.java index 37823db511..0eb88d7538 100644 --- a/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchain.java +++ b/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchain.java @@ -50,7 +50,7 @@ public abstract class DefaultToolchain // should have been AbstractToolchain... private Logger logger; /** - * + * * @param model the model, must not be {@code null} * @param logger the logger, must not be {@code null} */ @@ -62,7 +62,7 @@ public abstract class DefaultToolchain // should have been AbstractToolchain... } /** - * + * * @param model the model, must not be {@code null} * @param type the type * @param logger the logger, must not be {@code null} @@ -160,7 +160,7 @@ public abstract class DefaultToolchain // should have been AbstractToolchain... } return hashCode; } - + @Override public String toString() { @@ -178,9 +178,9 @@ public abstract class DefaultToolchain // should have been AbstractToolchain... builder.append( ';' ); } } - + builder.append( '}' ); - + return builder.toString(); } } diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManager.java b/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManager.java index bba161ff59..cfe22cb212 100644 --- a/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManager.java +++ b/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManager.java @@ -48,7 +48,7 @@ public class DefaultToolchainManager @Inject Map factories; - + @Override public Toolchain getToolchainFromBuildContext( String type, MavenSession session ) { @@ -59,7 +59,7 @@ public class DefaultToolchainManager if ( model != null ) { List toolchains = selectToolchains( Collections.singletonList( model ), type, null ); - + if ( !toolchains.isEmpty() ) { return toolchains.get( 0 ); @@ -112,7 +112,7 @@ public class DefaultToolchainManager } return toolchains; } - + Map retrieveContext( MavenSession session ) { Map context = null; diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivate.java b/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivate.java index ce1dd76151..538c99d235 100644 --- a/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivate.java +++ b/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivate.java @@ -63,7 +63,7 @@ public class DefaultToolchainManagerPrivate toRet.add( fact.createToolchain( toolchainModel ) ); } } - + // add default toolchain ToolchainPrivate tool = fact.createDefaultToolchain(); if ( tool != null ) diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/RequirementMatcherFactory.java b/maven-core/src/main/java/org/apache/maven/toolchain/RequirementMatcherFactory.java index 3d6917bd82..02f5cc0a42 100644 --- a/maven-core/src/main/java/org/apache/maven/toolchain/RequirementMatcherFactory.java +++ b/maven-core/src/main/java/org/apache/maven/toolchain/RequirementMatcherFactory.java @@ -59,7 +59,7 @@ public final class RequirementMatcherFactory { return provides.equalsIgnoreCase( requirement ); } - + @Override public String toString() { @@ -99,7 +99,7 @@ public final class RequirementMatcherFactory return false; } } - + @Override public String toString() { diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainManagerPrivate.java b/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainManagerPrivate.java index 6836bf1c79..ed50bd46ab 100644 --- a/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainManagerPrivate.java +++ b/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainManagerPrivate.java @@ -37,7 +37,7 @@ public interface ToolchainManagerPrivate /** * Retrieves every toolchains of given type available in user settings. - * + * * @param type the type, must not be {@code null} * @param context the Maven session, must not be {@code null} * @since 3.0 (addition of the MavenSession parameter) diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainPrivate.java b/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainPrivate.java index 3b73910072..90e0f30563 100644 --- a/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainPrivate.java +++ b/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainPrivate.java @@ -40,7 +40,7 @@ public interface ToolchainPrivate boolean matchesRequirements( Map requirements ); /** - * + * * @return the original model wrapped by this interface */ ToolchainModel getModel(); diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuilder.java b/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuilder.java index 33bdc70d74..6b337a6dca 100644 --- a/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuilder.java +++ b/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuilder.java @@ -44,7 +44,7 @@ import java.util.List; import java.util.Map; /** - * + * * @author Robert Scholte * @since 3.3.0 */ @@ -66,13 +66,13 @@ public class DefaultToolchainsBuilder throws ToolchainsBuildingException { ProblemCollector problems = ProblemCollectorFactory.newInstance( null ); - + PersistedToolchains globalToolchains = readToolchains( request.getGlobalToolchainsSource(), request, problems ); PersistedToolchains userToolchains = readToolchains( request.getUserToolchainsSource(), request, problems ); toolchainsMerger.merge( userToolchains, globalToolchains, TrackableBase.GLOBAL_LEVEL ); - + problems.setSource( "" ); userToolchains = interpolate( userToolchains, problems ); @@ -193,7 +193,7 @@ public class DefaultToolchainsBuilder return toolchains; } - + private boolean hasErrors( List problems ) { if ( problems != null ) diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuildingRequest.java b/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuildingRequest.java index 144d724cff..3c0e65d477 100644 --- a/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuildingRequest.java +++ b/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuildingRequest.java @@ -33,7 +33,7 @@ public class DefaultToolchainsBuildingRequest private Source globalToolchainsSource; private Source userToolchainsSource; - + @Override public Source getGlobalToolchainsSource() { diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuildingResult.java b/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuildingResult.java index 4cad090119..2d07a4a03c 100644 --- a/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuildingResult.java +++ b/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuildingResult.java @@ -27,7 +27,7 @@ import org.apache.maven.toolchain.model.PersistedToolchains; /** * Holds the result of the merged toolchains and holds the problems during this build, if any. - * + * * @author Robert Scholte * @since 3.3.0 */ @@ -36,12 +36,12 @@ public class DefaultToolchainsBuildingResult { private PersistedToolchains effectiveToolchains; - + private List problems; - + /** * Default constructor - * + * * @param effectiveToolchains the merged toolchains, may not be {@code null} * @param problems the problems while building the effectiveToolchains, if any. */ @@ -56,7 +56,7 @@ public class DefaultToolchainsBuildingResult { return effectiveToolchains; } - + @Override public List getProblems() { diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/building/ToolchainsBuildingResult.java b/maven-core/src/main/java/org/apache/maven/toolchain/building/ToolchainsBuildingResult.java index 592fb98c3b..f7c5f71554 100644 --- a/maven-core/src/main/java/org/apache/maven/toolchain/building/ToolchainsBuildingResult.java +++ b/maven-core/src/main/java/org/apache/maven/toolchain/building/ToolchainsBuildingResult.java @@ -42,7 +42,7 @@ public interface ToolchainsBuildingResult /** * Return a list of problems, if any. - * + * * @return a list of problems, never {@code null}. */ List getProblems(); diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/java/DefaultJavaToolChain.java b/maven-core/src/main/java/org/apache/maven/toolchain/java/DefaultJavaToolChain.java index 9cfcff3855..ac29f1f6d6 100644 --- a/maven-core/src/main/java/org/apache/maven/toolchain/java/DefaultJavaToolChain.java +++ b/maven-core/src/main/java/org/apache/maven/toolchain/java/DefaultJavaToolChain.java @@ -26,7 +26,7 @@ import org.codehaus.plexus.logging.Logger; * Provides backwards compatibility with Maven 3.2.3 and earlier. Clients that do not require compatibility with Maven * 3.2.3 and earlier are encouraged to use {@link JavaToolchainImpl}. * Note: This is an internal component whose interface can change without prior notice. - * + * * @deprecated clients that do not require compatibility with Maven 3.2.3 and earlier should link to * {@link JavaToolchainImpl} instead. */ diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/merge/MavenToolchainMerger.java b/maven-core/src/main/java/org/apache/maven/toolchain/merge/MavenToolchainMerger.java index 41ccf58e91..9b6596ea3d 100644 --- a/maven-core/src/main/java/org/apache/maven/toolchain/merge/MavenToolchainMerger.java +++ b/maven-core/src/main/java/org/apache/maven/toolchain/merge/MavenToolchainMerger.java @@ -28,7 +28,7 @@ import org.apache.maven.toolchain.model.ToolchainModel; import org.codehaus.plexus.util.xml.Xpp3Dom; /** - * + * * @author Robert Scholte * @since 3.2.4 */ @@ -55,14 +55,14 @@ public class MavenToolchainMerger for ( ToolchainModel dominantModel : dominant ) { Object key = getToolchainModelKey( dominantModel ); - + merged.put( key, dominantModel ); } for ( ToolchainModel recessiveModel : recessive ) { Object key = getToolchainModelKey( recessiveModel ); - + ToolchainModel dominantModel = merged.get( key ); if ( dominantModel == null ) { diff --git a/maven-core/src/main/java/org/apache/maven/xml/internal/DefaultConsumerPomXMLFilterFactory.java b/maven-core/src/main/java/org/apache/maven/xml/internal/DefaultConsumerPomXMLFilterFactory.java index b27a87b3fe..73ba87926a 100644 --- a/maven-core/src/main/java/org/apache/maven/xml/internal/DefaultConsumerPomXMLFilterFactory.java +++ b/maven-core/src/main/java/org/apache/maven/xml/internal/DefaultConsumerPomXMLFilterFactory.java @@ -25,7 +25,7 @@ import org.apache.maven.xml.sax.filter.ConsumerPomXMLFilterFactory; /** * The default implementation of the {@link ConsumerPomXMLFilterFactory} * It will provide several values for the consumer pom based on its context. - * + * * @author Robert Scholte * @since 4.0.0 */ diff --git a/maven-core/src/main/mdo/toolchains.mdo b/maven-core/src/main/mdo/toolchains.mdo index 9a8b0c4426..29f742ccaa 100644 --- a/maven-core/src/main/mdo/toolchains.mdo +++ b/maven-core/src/main/mdo/toolchains.mdo @@ -182,7 +182,7 @@ diff --git a/maven-core/src/main/resources/META-INF/maven/extension.xml b/maven-core/src/main/resources/META-INF/maven/extension.xml index 9007dc78c2..2962983056 100644 --- a/maven-core/src/main/resources/META-INF/maven/extension.xml +++ b/maven-core/src/main/resources/META-INF/maven/extension.xml @@ -106,7 +106,7 @@ under the License. javax.annotation.* javax.annotation.security.* - org.sonatype.aether:aether-api org.sonatype.aether:aether-spi @@ -188,7 +188,7 @@ under the License. | NOTE: Don't exclude the wagons or any of their dependencies (apart from the wagon API). This would otherwise | provoke linkage errors for wagons contributed by build extensions. We also don't need to exclude the wagons | from plugins. Plugins that use wagons directly and declare the corresponding dependency will simply use a - | wagon from their plugin realm. + | wagon from their plugin realm. --> diff --git a/maven-core/src/test/java/org/apache/maven/AbstractCoreMavenComponentTestCase.java b/maven-core/src/test/java/org/apache/maven/AbstractCoreMavenComponentTestCase.java index 9f41b3c5f1..8df987e5c0 100644 --- a/maven-core/src/test/java/org/apache/maven/AbstractCoreMavenComponentTestCase.java +++ b/maven-core/src/test/java/org/apache/maven/AbstractCoreMavenComponentTestCase.java @@ -138,7 +138,7 @@ public abstract class AbstractCoreMavenComponentTestCase { return createMavenSession( pom, executionProperties, false ); } - + protected MavenSession createMavenSession( File pom, Properties executionProperties, boolean includeModules ) throws Exception { @@ -155,7 +155,7 @@ public abstract class AbstractCoreMavenComponentTestCase if ( pom != null ) { MavenProject project = projectBuilder.build( pom, configuration ).getProject(); - + projects.add( project ); if ( includeModules ) { diff --git a/maven-core/src/test/java/org/apache/maven/artifact/resolver/filter/ExclusionArtifactFilterTest.java b/maven-core/src/test/java/org/apache/maven/artifact/resolver/filter/ExclusionArtifactFilterTest.java index 53b6aade89..c504c96bb9 100644 --- a/maven-core/src/test/java/org/apache/maven/artifact/resolver/filter/ExclusionArtifactFilterTest.java +++ b/maven-core/src/test/java/org/apache/maven/artifact/resolver/filter/ExclusionArtifactFilterTest.java @@ -121,36 +121,36 @@ public class ExclusionArtifactFilterTest assertThat( filter.include( artifact ), is( false ) ); } - + @Test public void testMultipleExclusionsExcludeArtifactIdWildcard() { Exclusion exclusion1 = new Exclusion(); exclusion1.setGroupId( "org.apache.groovy" ); exclusion1.setArtifactId( "*" ); - + Exclusion exclusion2 = new Exclusion(); exclusion2.setGroupId( "org.apache.maven" ); exclusion2.setArtifactId( "maven-core" ); - + ExclusionArtifactFilter filter = new ExclusionArtifactFilter( Arrays.asList( exclusion1, exclusion2 ) ); - + assertThat( filter.include( artifact ), is( false ) ); } - + @Test public void testMultipleExclusionsExcludeGroupIdWildcard() { Exclusion exclusion1 = new Exclusion(); exclusion1.setGroupId( "*" ); exclusion1.setArtifactId( "maven-model" ); - + Exclusion exclusion2 = new Exclusion(); exclusion2.setGroupId( "org.apache.maven" ); exclusion2.setArtifactId( "maven-core" ); - + ExclusionArtifactFilter filter = new ExclusionArtifactFilter( Arrays.asList( exclusion1, exclusion2 ) ); - + assertThat( filter.include( artifact ), is( false ) ); } } \ No newline at end of file diff --git a/maven-core/src/test/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulatorTest.java b/maven-core/src/test/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulatorTest.java index 15a7a7b3b6..bcc5895b7b 100644 --- a/maven-core/src/test/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulatorTest.java +++ b/maven-core/src/test/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulatorTest.java @@ -34,7 +34,7 @@ public class DefaultMavenExecutionRequestPopulatorTest { @Inject MavenExecutionRequestPopulator testee; - + public void testPluginRepositoryInjection() throws Exception { diff --git a/maven-core/src/test/java/org/apache/maven/internal/aether/ConsumerModelSourceTransformerTest.java b/maven-core/src/test/java/org/apache/maven/internal/aether/ConsumerModelSourceTransformerTest.java index 2828610dd5..0f1f634f4e 100644 --- a/maven-core/src/test/java/org/apache/maven/internal/aether/ConsumerModelSourceTransformerTest.java +++ b/maven-core/src/test/java/org/apache/maven/internal/aether/ConsumerModelSourceTransformerTest.java @@ -39,7 +39,7 @@ public class ConsumerModelSourceTransformerTest Path beforePomFile = Paths.get( "src/test/resources/projects/transform/before.pom").toAbsolutePath(); Path afterPomFile = Paths.get( "src/test/resources/projects/transform/after.pom").toAbsolutePath(); - try( InputStream expected = Files.newInputStream( afterPomFile ); + try( InputStream expected = Files.newInputStream( afterPomFile ); InputStream result = transformer.transform( beforePomFile, new NoTransformerContext() ) ) { XmlAssert.assertThat( result ).and( expected ).areIdentical(); @@ -53,14 +53,14 @@ public class ConsumerModelSourceTransformerTest { return null; } - + @Override public Model getRawModel( String groupId, String artifactId ) throws IllegalStateException { return null; } - + @Override public Model getRawModel( Path p ) { diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/DefaultLifecyclesTest.java b/maven-core/src/test/java/org/apache/maven/lifecycle/DefaultLifecyclesTest.java index e911bf1abb..dfc5a8a983 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/DefaultLifecyclesTest.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/DefaultLifecyclesTest.java @@ -98,27 +98,27 @@ public class DefaultLifecyclesTest assertThat( lifecycle.getId(), is( "wrapper" ) ); assertThat( lifecycle.getPhases(), hasSize( 1 ) ); } - + public void testCustomLifecycle() { List myLifecycles = new ArrayList<>(); - Lifecycle myLifecycle = new Lifecycle( "etl", + Lifecycle myLifecycle = new Lifecycle( "etl", Arrays.asList( "extract", "transform", "load" ), Collections.emptyMap() ); myLifecycles.add( myLifecycle ); myLifecycles.addAll( defaultLifeCycles.getLifeCycles() ); - + DefaultLifecycles dl = new DefaultLifecycles( myLifecycles.stream() - .collect( Collectors.toMap( l -> l.getId(), l -> l ) ), + .collect( Collectors.toMap( l -> l.getId(), l -> l ) ), null ); - + assertThat( dl.getLifeCycles().get( 0 ).getId(), is( "default" ) ); assertThat( dl.getLifeCycles().get( 1 ).getId(), is( "clean" ) ); assertThat( dl.getLifeCycles().get( 2 ).getId(), is( "site" ) ); assertThat( dl.getLifeCycles().get( 3 ).getId(), is( "wrapper" ) ); assertThat( dl.getLifeCycles().get( 4 ).getId(), is( "etl" ) ); } - + private Lifecycle getLifeCycleById( String id ) { return defaultLifeCycles.getLifeCycles().stream() diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/BuilderCommonTest.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/BuilderCommonTest.java index a0a4430352..b1af3aa520 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/BuilderCommonTest.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/BuilderCommonTest.java @@ -36,7 +36,7 @@ import java.util.HashSet; public class BuilderCommonTest { private Logger logger = mock( Logger.class ); - + @Test public void testResolveBuildPlan() throws Exception @@ -53,7 +53,7 @@ public class BuilderCommonTest new HashSet<>() ); assertEquals( LifecycleExecutionPlanCalculatorStub.getProjectAExceutionPlan().size(), plan.size() ); } - + @Test public void testDefaultBindingPluginsWarning() throws Exception @@ -65,7 +65,7 @@ public class BuilderCommonTest session1.setCurrentProject( ProjectDependencyGraphStub.A ); getBuilderCommon().resolveBuildPlan( session1, ProjectDependencyGraphStub.A, taskSegment1, new HashSet<>() ); - + verify( logger ).warn("Version not locked for default bindings plugins [" + "stub-plugin-initialize, " + "stub-plugin-process-resources, " @@ -77,7 +77,7 @@ public class BuilderCommonTest + "stub-plugin-install], " + "you should define versions in pluginManagement section of your pom.xml or parent"); } - + public void testHandleBuildError() throws Exception { diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/ProjectBuildListTest.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/ProjectBuildListTest.java index a321e09078..3e3f8922f9 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/ProjectBuildListTest.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/ProjectBuildListTest.java @@ -36,7 +36,7 @@ public class ProjectBuildListTest final MavenSession session = ProjectDependencyGraphStub.getMavenSession(); ProjectBuildList projectBuildList = ProjectDependencyGraphStub.getProjectBuildList( session ); TaskSegment taskSegment = projectBuildList.get( 0 ).getTaskSegment(); - assertThat( "This test assumes there are at least 6 elements in projectBuilds", + assertThat( "This test assumes there are at least 6 elements in projectBuilds", projectBuildList.size(), is( greaterThanOrEqualTo( 6 ) ) ); final ProjectBuildList byTaskSegment = projectBuildList.getByTaskSegment( taskSegment ); diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleExecutionPlanCalculatorStub.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleExecutionPlanCalculatorStub.java index 1b945d90aa..0357071715 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleExecutionPlanCalculatorStub.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleExecutionPlanCalculatorStub.java @@ -212,7 +212,7 @@ public class LifecycleExecutionPlanCalculatorStub { InputSource defaultBindings = new InputSource(); defaultBindings.setModelId( DefaultLifecyclePluginAnalyzer.DEFAULTLIFECYCLEBINDINGS_MODELID ); - + final Plugin plugin = mojoDescriptor.getPluginDescriptor().getPlugin(); plugin.setLocation( "version", new InputLocation( 12, 34, defaultBindings ) ); MojoExecution result = new MojoExecution( plugin, goal, executionId ); diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/mapping/LifecyclePhaseTest.java b/maven-core/src/test/java/org/apache/maven/lifecycle/mapping/LifecyclePhaseTest.java index 0d8cbdc689..f60eace0a8 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/mapping/LifecyclePhaseTest.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/mapping/LifecyclePhaseTest.java @@ -33,38 +33,38 @@ public class LifecyclePhaseTest { LifecyclePhase phase = new LifecyclePhase(); assertEquals( "", phase.toString() ); - + LifecycleMojo mojo1 = new LifecycleMojo(); mojo1.setGoal( "jar:jar" ); phase.setMojos( Arrays.asList( mojo1 ) ); assertEquals( "jar:jar", phase.toString() ); - + LifecycleMojo mojo2 = new LifecycleMojo(); mojo2.setGoal( "war:war" ); phase.setMojos( Arrays.asList( mojo1, mojo2 ) ); assertEquals( "jar:jar,war:war", phase.toString() ); } - + @Test public void testSet() { LifecyclePhase phase = new LifecyclePhase(); assertNull( phase.getMojos() ); - + phase.set( "" ); assertNotNull( phase.getMojos() ); assertEquals( 0, phase.getMojos().size() ); - + phase.set( "jar:jar, war:war" ); - + List mojos = phase.getMojos(); assertNotNull( mojos ); assertEquals( 2, mojos.size() ); - + LifecycleMojo mojo1 = mojos.get(0); assertNotNull( mojo1 ); assertEquals( "jar:jar", mojo1.getGoal() ); - + LifecycleMojo mojo2 = mojos.get(1); assertNotNull( mojo2 ); assertEquals( "war:war", mojo2.getGoal() ); diff --git a/maven-core/src/test/java/org/apache/maven/plugin/PluginManagerTest.java b/maven-core/src/test/java/org/apache/maven/plugin/PluginManagerTest.java index 3d8306e530..8ef5c84491 100644 --- a/maven-core/src/test/java/org/apache/maven/plugin/PluginManagerTest.java +++ b/maven-core/src/test/java/org/apache/maven/plugin/PluginManagerTest.java @@ -314,7 +314,7 @@ public class PluginManagerTest pluginManager.loadPlugin( plugin, session.getCurrentProject().getRemotePluginRepositories(), session.getRepositorySession() ); ClassRealm pluginRealm = pluginManager.getPluginRealm( session, pluginDescriptor ); - + assertEquals(pluginRealm, pluginDescriptor.getComponents().get(0).getRealm()); } } diff --git a/maven-core/src/test/java/org/apache/maven/project/ProjectSorterTest.java b/maven-core/src/test/java/org/apache/maven/project/ProjectSorterTest.java index cae60cf393..1ca124f130 100644 --- a/maven-core/src/test/java/org/apache/maven/project/ProjectSorterTest.java +++ b/maven-core/src/test/java/org/apache/maven/project/ProjectSorterTest.java @@ -209,7 +209,7 @@ public class ProjectSorterTest projects.add( project1 ); MavenProject project2 = createProject( "groupId", "artifactId", "1.0" ); projects.add( project2 ); - + expectedException.expect( DuplicateProjectException.class ); expectedException.reportMissingExceptionWithMessage( "Duplicate projects should fail" ); diff --git a/maven-core/src/test/java/org/apache/maven/project/artifact/DefaultProjectArtifactsCacheTest.java b/maven-core/src/test/java/org/apache/maven/project/artifact/DefaultProjectArtifactsCacheTest.java index dfc4d8010c..cbe4b35865 100644 --- a/maven-core/src/test/java/org/apache/maven/project/artifact/DefaultProjectArtifactsCacheTest.java +++ b/maven-core/src/test/java/org/apache/maven/project/artifact/DefaultProjectArtifactsCacheTest.java @@ -31,7 +31,7 @@ import junit.framework.TestCase; public class DefaultProjectArtifactsCacheTest extends TestCase { - + private ProjectArtifactsCache cache; @Override @@ -41,32 +41,32 @@ public class DefaultProjectArtifactsCacheTest extends TestCase super.setUp(); cache = new DefaultProjectArtifactsCache(); } - + public void testProjectDependencyOrder() throws Exception { ProjectArtifactsCache.Key project1 = new ProjectArtifactsCache.Key(){}; - + Set artifacts = new LinkedHashSet<>( 4 ); artifacts.add( new DefaultArtifact( "g", "a1", "v", "compile", "jar", "", null ) ); artifacts.add( new DefaultArtifact( "g", "a2", "v", "compile", "jar", "", null ) ); artifacts.add( new DefaultArtifact( "g", "a3", "v", "compile", "jar", "", null ) ); artifacts.add( new DefaultArtifact( "g", "a4", "v", "compile", "jar", "", null ) ); - + cache.put( project1, artifacts ); - + assertArrayEquals( artifacts.toArray( new Artifact[0] ), cache.get( project1 ).getArtifacts().toArray( new Artifact[0] ) ); - + ProjectArtifactsCache.Key project2 = new ProjectArtifactsCache.Key(){}; - + Set reversedArtifacts = new LinkedHashSet<>( 4 ); artifacts.add( new DefaultArtifact( "g", "a4", "v", "compile", "jar", "", null ) ); artifacts.add( new DefaultArtifact( "g", "a3", "v", "compile", "jar", "", null ) ); artifacts.add( new DefaultArtifact( "g", "a2", "v", "compile", "jar", "", null ) ); artifacts.add( new DefaultArtifact( "g", "a1", "v", "compile", "jar", "", null ) ); - + cache.put( project2, reversedArtifacts ); - + assertArrayEquals( reversedArtifacts.toArray( new Artifact[0] ), cache.get( project2 ).getArtifacts().toArray( new Artifact[0] ) ); } diff --git a/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivateTest.java b/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivateTest.java index c937564635..896b59c327 100644 --- a/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivateTest.java +++ b/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivateTest.java @@ -53,7 +53,7 @@ public class DefaultToolchainManagerPrivateTest @Mock private ToolchainFactory toolchainFactory_basicType; - + @Mock private ToolchainFactory toolchainFactory_rareType; @@ -112,7 +112,7 @@ public class DefaultToolchainManagerPrivateTest verify( logger ).error( "Missing toolchain factory for type: unknown. Possibly caused by misconfigured project." ); assertEquals( 0, toolchains.length ); } - + @Test public void testToolchainsForConfiguredType() throws Exception diff --git a/maven-core/src/test/projects/lifecycle-dependency-resolver/pom.xml b/maven-core/src/test/projects/lifecycle-dependency-resolver/pom.xml index 8c7cfec1d2..3fa14bac77 100644 --- a/maven-core/src/test/projects/lifecycle-dependency-resolver/pom.xml +++ b/maven-core/src/test/projects/lifecycle-dependency-resolver/pom.xml @@ -31,7 +31,7 @@ under the License. Check that war packages the jar instead of a directory - + @@ -50,7 +50,7 @@ under the License. - + lib war diff --git a/maven-core/src/test/projects/lifecycle-dependency-resolver/war/pom.xml b/maven-core/src/test/projects/lifecycle-dependency-resolver/war/pom.xml index e168833713..a49376febb 100644 --- a/maven-core/src/test/projects/lifecycle-dependency-resolver/war/pom.xml +++ b/maven-core/src/test/projects/lifecycle-dependency-resolver/war/pom.xml @@ -29,7 +29,7 @@ under the License. mng6300-war war - + @@ -41,7 +41,7 @@ under the License. - + org.apache.maven.its.mng6300 diff --git a/maven-core/src/test/remote-repo/org/apache/maven/its/a/0.1/a-0.1.pom b/maven-core/src/test/remote-repo/org/apache/maven/its/a/0.1/a-0.1.pom index f451418856..03caa12ee8 100644 --- a/maven-core/src/test/remote-repo/org/apache/maven/its/a/0.1/a-0.1.pom +++ b/maven-core/src/test/remote-repo/org/apache/maven/its/a/0.1/a-0.1.pom @@ -29,7 +29,7 @@ under the License. Maven Integration Test :: Dummy Artifact - + diff --git a/maven-core/src/test/remote-repo/org/apache/maven/its/b/0.1/b-0.1.pom b/maven-core/src/test/remote-repo/org/apache/maven/its/b/0.1/b-0.1.pom index ca20cbf5a9..149a241088 100644 --- a/maven-core/src/test/remote-repo/org/apache/maven/its/b/0.1/b-0.1.pom +++ b/maven-core/src/test/remote-repo/org/apache/maven/its/b/0.1/b-0.1.pom @@ -29,7 +29,7 @@ under the License. Maven Integration Test :: Dummy Artifact - + diff --git a/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.pom b/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.pom index 9ebbbb4373..4c344c836f 100644 --- a/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.pom +++ b/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.pom @@ -31,11 +31,11 @@ under the License. maven-artifact 3.0-SNAPSHOT Maven Artifact - - scm:svn:http://svn.apache.org/repos/asf/maven/artifact/trunk - scm:svn:https://svn.apache.org/repos/asf/maven/artifact/trunk - http://svn.apache.org/viewcvs.cgi/maven/artifact/trunk - + + scm:svn:http://svn.apache.org/repos/asf/maven/artifact/trunk + scm:svn:https://svn.apache.org/repos/asf/maven/artifact/trunk + http://svn.apache.org/viewcvs.cgi/maven/artifact/trunk + org.codehaus.plexus @@ -56,7 +56,7 @@ under the License. org.apache.maven.wagon wagon-provider-api 1.0-beta-2 - + org.apache.maven.wagon wagon-file @@ -68,7 +68,7 @@ under the License. easymock 1.2_Java1.3 test - +
    @@ -80,25 +80,25 @@ under the License. 1.0.0 src/main/mdo/metadata.mdo - - - site-docs - pre-site - - xdoc - xsd - - - - standard - - java - xpp3-reader - xpp3-writer - - - - + + + site-docs + pre-site + + xdoc + xsd + + + + standard + + java + xpp3-reader + xpp3-writer + + + + maven-surefire-plugin diff --git a/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/core/test/test-extension/1/test-extension-1.pom b/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/core/test/test-extension/1/test-extension-1.pom index 784b315997..fee83c92a1 100644 --- a/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/core/test/test-extension/1/test-extension-1.pom +++ b/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/core/test/test-extension/1/test-extension-1.pom @@ -35,7 +35,7 @@ 1.0-alpha-16
    - + @@ -62,12 +62,12 @@ - + dummy file:///tmp/dummy-repo - + diff --git a/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.pom b/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.pom index 535b3be968..01aaa425c5 100644 --- a/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.pom +++ b/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.pom @@ -33,12 +33,12 @@ - + dummy file:///tmp/dummy-repo - + diff --git a/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/maven-parent/5/maven-parent-5.pom b/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/maven-parent/5/maven-parent-5.pom index 9718a64655..a512366b97 100644 --- a/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/maven-parent/5/maven-parent-5.pom +++ b/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/maven-parent/5/maven-parent-5.pom @@ -291,9 +291,9 @@ under the License. - org.apache.maven.plugins + org.apache.maven.plugins maven-release-plugin - 2.0-beta-4 + 2.0-beta-4 https://svn.apache.org/repos/asf/maven/pom/tags @@ -379,7 +379,7 @@ under the License. -
    + release @@ -451,10 +451,10 @@ under the License. - + - +
    diff --git a/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.pom b/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.pom index 7423d7f62f..62a4f45a6a 100644 --- a/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.pom +++ b/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.pom @@ -88,7 +88,7 @@ scm:svn:http://svn.codehaus.org/plexus/plexus-classworlds/tags/plexus-classworlds-1.2-alpha-10 - scm:svn:https://svn.codehaus.org/plexus/plexus-classworlds/tags/plexus-classworlds-1.2-alpha-10 + scm:svn:https://svn.codehaus.org/plexus/plexus-classworlds/tags/plexus-classworlds-1.2-alpha-10 http://fisheye.codehaus.org/browse/plexus/plexus-classworlds/tags/plexus-classworlds-1.2-alpha-10 diff --git a/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-components/1.1.6/plexus-components-1.1.6.pom b/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-components/1.1.6/plexus-components-1.1.6.pom index 0afa80217f..2adef07e6e 100644 --- a/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-components/1.1.6/plexus-components-1.1.6.pom +++ b/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-components/1.1.6/plexus-components-1.1.6.pom @@ -21,7 +21,7 @@ pom 1.1.6 Plexus Components Parent Project - @@ -35,25 +35,25 @@ plexus-action plexus-archiver - plexus-bayesian + plexus-bayesian plexus-command plexus-compiler - plexus-drools + plexus-drools plexus-formica plexus-formica-web plexus-hibernate - plexus-i18n - plexus-interactivity - plexus-ircbot + plexus-i18n + plexus-interactivity + plexus-ircbot plexus-jdo - plexus-jetty-httpd + plexus-jetty-httpd plexus-jetty - plexus-mimetyper + plexus-mimetyper plexus-notification plexus-resource plexus-security plexus-summit - plexus-taskqueue + plexus-taskqueue plexus-velocity plexus-xmlrpc diff --git a/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.pom b/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.pom index 2904ba91eb..f8b0705415 100644 --- a/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.pom +++ b/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.pom @@ -36,8 +36,8 @@ classworlds:classworlds junit:junit jmock:jmock - org.codehaus.plexus:plexus-classworlds - org.codehaus.plexus:plexus-utils + org.codehaus.plexus:plexus-classworlds + org.codehaus.plexus:plexus-utils diff --git a/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.10/plexus-1.0.10.pom b/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.10/plexus-1.0.10.pom index cf2df39a80..ee904a03df 100644 --- a/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.10/plexus-1.0.10.pom +++ b/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.10/plexus-1.0.10.pom @@ -20,7 +20,7 @@ 6667 #plexus - + 2001 diff --git a/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.11/plexus-1.0.11.pom b/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.11/plexus-1.0.11.pom index 0414c65d2f..1f491ae4f7 100644 --- a/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.11/plexus-1.0.11.pom +++ b/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.11/plexus-1.0.11.pom @@ -20,7 +20,7 @@ 6667 #plexus - + 2001 @@ -30,7 +30,7 @@ http://www.apache.org/licenses/LICENSE-2.0.txt repo - + Plexus User List @@ -88,7 +88,7 @@ - + jvanzyl @@ -303,6 +303,6 @@ - + diff --git a/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.4/plexus-1.0.4.pom b/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.4/plexus-1.0.4.pom index d782b15c0d..0867e8bc0e 100644 --- a/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.4/plexus-1.0.4.pom +++ b/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.4/plexus-1.0.4.pom @@ -20,7 +20,7 @@ 6667 #plexus - + 2001 diff --git a/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.8/plexus-1.0.8.pom b/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.8/plexus-1.0.8.pom index 7bc976d1a9..c6afe11423 100644 --- a/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.8/plexus-1.0.8.pom +++ b/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.8/plexus-1.0.8.pom @@ -23,7 +23,7 @@ 6667 #plexus - + 2001 @@ -223,7 +223,7 @@ - + jdk diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/CliRequest.java b/maven-embedder/src/main/java/org/apache/maven/cli/CliRequest.java index 34937e8f78..7dca59169a 100644 --- a/maven-embedder/src/main/java/org/apache/maven/cli/CliRequest.java +++ b/maven-embedder/src/main/java/org/apache/maven/cli/CliRequest.java @@ -116,8 +116,8 @@ public class CliRequest return request; } - public void setUserProperties( Properties properties ) + public void setUserProperties( Properties properties ) { - this.userProperties.putAll( properties ); + this.userProperties.putAll( properties ); } } \ No newline at end of file diff --git a/maven-embedder/src/site/apt/index.apt.vm b/maven-embedder/src/site/apt/index.apt.vm index d327717ff7..93af61b6ac 100644 --- a/maven-embedder/src/site/apt/index.apt.vm +++ b/maven-embedder/src/site/apt/index.apt.vm @@ -45,5 +45,4 @@ ${project.name} * since 3.5.0, output is colorized by default, with color disabled in batch mode: see {{{/shared/maven-shared-utils/apidocs/org/apache/maven/shared/utils/logging/package-summary.html}styled message API}} for more details on adding color to a plugin output or customizing colors. - - \ No newline at end of file + diff --git a/maven-embedder/src/test/java/org/apache/maven/cli/event/ExecutionEventLoggerTest.java b/maven-embedder/src/test/java/org/apache/maven/cli/event/ExecutionEventLoggerTest.java index ca4c8a47cb..3abb872f60 100644 --- a/maven-embedder/src/test/java/org/apache/maven/cli/event/ExecutionEventLoggerTest.java +++ b/maven-embedder/src/test/java/org/apache/maven/cli/event/ExecutionEventLoggerTest.java @@ -37,7 +37,7 @@ public class ExecutionEventLoggerTest private ExecutionEventLogger executionEventLogger; @BeforeClass - public static void setUp() + public static void setUp() { MessageUtils.setColorEnabled( false ); } diff --git a/maven-model-builder/src/main/java/org/apache/maven/feature/Features.java b/maven-model-builder/src/main/java/org/apache/maven/feature/Features.java index 5097b98731..0387163341 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/feature/Features.java +++ b/maven-model-builder/src/main/java/org/apache/maven/feature/Features.java @@ -21,26 +21,26 @@ package org.apache.maven.feature; /** * Centralized class for feature information - * + * * @author Robert Scholte * @since 4.0.0 */ public final class Features { - private Features() + private Features() { } - + private static final Feature BUILDCONSUMER = new Feature( "maven.experimental.buildconsumer", "true" ); - + public static Feature buildConsumer() { return BUILDCONSUMER; } - + /** * Represents some feature - * + * * @author Robert Scholte * @since 4.0.0 */ @@ -52,12 +52,12 @@ public final class Features { active = "true".equals( System.getProperty( name, defaultValue ) ); } - + public boolean isActive() { - return active; + return active; } - + } - + } diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/AbstractModelSourceTransformer.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/AbstractModelSourceTransformer.java index 4aee0d6726..8090562055 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/building/AbstractModelSourceTransformer.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/AbstractModelSourceTransformer.java @@ -51,7 +51,7 @@ import org.xml.sax.ext.LexicalHandler; /** * Offers a transformation implementation based on PipelineStreams. * Subclasses are responsible for providing the right SAXFilter. - * + * * @author Robert Scholte * @since 4.0.0 */ @@ -59,10 +59,10 @@ public abstract class AbstractModelSourceTransformer implements ModelSourceTransformer { private static final AtomicInteger TRANSFORM_THREAD_COUNTER = new AtomicInteger(); - + private final TransformerFactory transformerFactory = Factories.newTransformerFactory(); - - protected abstract AbstractSAXFilter getSAXFilter( Path pomFile, + + protected abstract AbstractSAXFilter getSAXFilter( Path pomFile, TransformerContext context, Consumer lexicalHandlerConsumer ) throws TransformerConfigurationException, SAXException, ParserConfigurationException; @@ -71,12 +71,12 @@ public abstract class AbstractModelSourceTransformer { return outputStream; } - + public SAXTransformerFactory getTransformerFactory() { return ( SAXTransformerFactory ) transformerFactory; } - + protected TransformerHandler getTransformerHandler( Path pomFile ) throws IOException, org.apache.maven.model.building.TransformerException { @@ -112,7 +112,7 @@ public abstract class AbstractModelSourceTransformer filter = getSAXFilter( pomFile, context, lexConsumer ); filter.setLexicalHandler( transformerHandler ); // By default errors are written to stderr. - // Hence set custom errorHandler to reduce noice + // Hence set custom errorHandler to reduce noice filter.setErrorHandler( new ErrorHandler() { @Override @@ -121,14 +121,14 @@ public abstract class AbstractModelSourceTransformer { throw exception; } - + @Override public void fatalError( SAXParseException exception ) throws SAXException { throw exception; } - + @Override public void error( SAXParseException exception ) throws SAXException @@ -141,7 +141,7 @@ public abstract class AbstractModelSourceTransformer { throw new org.apache.maven.model.building.TransformerException( e ); } - + final SAXSource transformSource = new SAXSource( filter, new org.xml.sax.InputSource( Files.newInputStream( pomFile ) ) ); @@ -150,7 +150,7 @@ public abstract class AbstractModelSourceTransformer // Ensure pipedStreams are connected before the transformThread starts!! final PipedInputStream pipedInputStream = new PipedInputStream( pout ); - Thread transformThread = new Thread( () -> + Thread transformThread = new Thread( () -> { try ( PipedOutputStream pos = pout ) { @@ -164,7 +164,7 @@ public abstract class AbstractModelSourceTransformer transformThread.setUncaughtExceptionHandler( eh ); transformThread.setDaemon( true ); transformThread.start(); - + return new ThreadAwareInputStream( pipedInputStream, eh ); } diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/ArtifactModelSource.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/ArtifactModelSource.java index a8e45d085e..06d4faf3f4 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/building/ArtifactModelSource.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/ArtifactModelSource.java @@ -26,18 +26,18 @@ import org.apache.maven.building.FileSource; /** * Represents a model pulled from a repository - * + * * @author Robert Scholte * @since 4.0.0 */ public class ArtifactModelSource extends FileSource implements ModelSource { private final String groupId; - + private final String artifactId; - + private final String version; - + private final int hashCode; public ArtifactModelSource( File file, String groupId, String artifactId, String version ) @@ -82,13 +82,13 @@ public class ArtifactModelSource extends FileSource implements ModelSource return false; } - if ( !ArtifactModelSource.class.equals( obj.getClass() ) ) + if ( !ArtifactModelSource.class.equals( obj.getClass() ) ) { return false; } ArtifactModelSource other = (ArtifactModelSource) obj; - return Objects.equals( artifactId, other.artifactId ) + return Objects.equals( artifactId, other.artifactId ) && Objects.equals( groupId, other.groupId ) && Objects.equals( version, other.version ); } diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/BuildModelSourceTransformer.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/BuildModelSourceTransformer.java index 11196234ee..eb0ebbb70c 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/building/BuildModelSourceTransformer.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/BuildModelSourceTransformer.java @@ -40,7 +40,7 @@ import org.xml.sax.ext.LexicalHandler; /** * ModelSourceTransformer for the build pom - * + * * @author Robert Scholte * @since 4.0.0 */ @@ -51,7 +51,7 @@ class BuildModelSourceTransformer extends AbstractModelSourceTransformer @Inject @Nullable private BuildPomXMLFilterListener xmlFilterListener; - + protected AbstractSAXFilter getSAXFilter( Path pomFile, TransformerContext context, Consumer lexicalHandlerConsumer ) @@ -62,7 +62,7 @@ class BuildModelSourceTransformer extends AbstractModelSourceTransformer return buildPomXMLFilterFactory.get( pomFile ); } - + @Override protected OutputStream filterOutputStream( OutputStream outputStream, Path pomFile ) { @@ -77,7 +77,7 @@ class BuildModelSourceTransformer extends AbstractModelSourceTransformer { super.write( b, off, len ); xmlFilterListener.write( pomFile, b, off, len ); - } + } }; } else diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultBuildPomXMLFilterFactory.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultBuildPomXMLFilterFactory.java index 2424874d22..04e4fcfe5b 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultBuildPomXMLFilterFactory.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultBuildPomXMLFilterFactory.java @@ -48,7 +48,7 @@ public class DefaultBuildPomXMLFilterFactory extends BuildPomXMLFilterFactory * @param consume {@code true} if this factory is being used for creating the consumer pom, otherwise {@code false} */ public DefaultBuildPomXMLFilterFactory( TransformerContext context, - Consumer lexicalHandlerConsumer, + Consumer lexicalHandlerConsumer, boolean consume ) { super( lexicalHandlerConsumer, consume ); diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuildingRequest.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuildingRequest.java index 44ad4250b8..a012786341 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuildingRequest.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuildingRequest.java @@ -71,7 +71,7 @@ public class DefaultModelBuildingRequest private ModelCache modelCache; private WorkspaceModelResolver workspaceResolver; - + private TransformerContextBuilder contextBuilder; /** @@ -389,7 +389,7 @@ public class DefaultModelBuildingRequest { return fileModel; } - + @Override public ModelBuildingRequest setFileModel( Model fileModel ) { @@ -427,7 +427,7 @@ public class DefaultModelBuildingRequest { return contextBuilder; } - + @Override public ModelBuildingRequest setTransformerContextBuilder( TransformerContextBuilder contextBuilder ) { diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelSourceTransformer.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelSourceTransformer.java index 1f26e8ae11..7c57f302eb 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelSourceTransformer.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelSourceTransformer.java @@ -25,8 +25,8 @@ import java.nio.file.Files; import java.nio.file.Path; /** - * Default ModelSourceTransformer, provides pomFile as inputStream and ignores the context - * + * Default ModelSourceTransformer, provides pomFile as inputStream and ignores the context + * * @author Robert Scholte * @since 4.0.0 */ diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/FileModelSource.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/FileModelSource.java index c5a8e0d5c4..215de36381 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/building/FileModelSource.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/FileModelSource.java @@ -41,11 +41,11 @@ public class FileModelSource extends FileSource implements ModelSource2 { super( pomFile ); } - + /** - * + * * @return the file of this source - * + * * @deprecated instead use {@link #getFile()} */ @Deprecated @@ -53,7 +53,7 @@ public class FileModelSource extends FileSource implements ModelSource2 { return getFile(); } - + @Override public ModelSource2 getRelatedSource( String relPath ) { @@ -82,9 +82,9 @@ public class FileModelSource extends FileSource implements ModelSource2 } @Override - public boolean equals( Object obj ) + public boolean equals( Object obj ) { - if ( this == obj ) + if ( this == obj ) { return true; } @@ -94,7 +94,7 @@ public class FileModelSource extends FileSource implements ModelSource2 return false; } - if ( !FileModelSource.class.equals( obj.getClass() ) ) + if ( !FileModelSource.class.equals( obj.getClass() ) ) { return false; } @@ -103,9 +103,9 @@ public class FileModelSource extends FileSource implements ModelSource2 } @Override - public int hashCode() + public int hashCode() { - return getFile().hashCode(); + return getFile().hashCode(); } } diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/FilterModelBuildingRequest.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/FilterModelBuildingRequest.java index 1374cbb239..d12a89a420 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/building/FilterModelBuildingRequest.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/FilterModelBuildingRequest.java @@ -261,7 +261,7 @@ class FilterModelBuildingRequest { return request.getFileModel(); } - + @Override public ModelBuildingRequest setFileModel( Model fileModel ) { @@ -300,7 +300,7 @@ class FilterModelBuildingRequest { return request.getTransformerContextBuilder(); } - + @Override public ModelBuildingRequest setTransformerContextBuilder( TransformerContextBuilder contextBuilder ) { diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/ModelCache.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/ModelCache.java index 952ef46806..3962fe0bfa 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/building/ModelCache.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/ModelCache.java @@ -35,26 +35,26 @@ public interface ModelCache { /** * Puts the specified data into the cache. - * + * * @param path The path of the cache record, must not be {@code null}. * @param tag The tag of the cache record, must not be {@code null}. * @param data The data to store in the cache, must not be {@code null}. * @since 4.0.0 */ - default void put( Source path, String tag, Object data ) + default void put( Source path, String tag, Object data ) { // only useful for ReactorModelCache } /** * Gets the specified data from the cache. - * + * * @param path The path of the cache record, must not be {@code null}. * @param tag The tag of the cache record, must not be {@code null}. * @return The requested data or {@code null} if none was present in the cache. * @since 4.0.0 */ - default Object get( Source path, String tag ) + default Object get( Source path, String tag ) { // only useful for ReactorModelCache return null; diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/StringModelSource.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/StringModelSource.java index cf9c4ce19b..409714669b 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/building/StringModelSource.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/StringModelSource.java @@ -25,7 +25,7 @@ import org.apache.maven.building.StringSource; * Wraps an ordinary {@link CharSequence} as a model source. * * @author Benjamin Bentmann - * + * * @deprecated instead use {@link StringSource} */ @Deprecated diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/TransformerContext.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/TransformerContext.java index d7a43dcc6c..e041af4912 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/building/TransformerContext.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/TransformerContext.java @@ -25,8 +25,8 @@ import org.apache.maven.model.Model; /** * Context used to transform a pom file. - * - * + * + * * @author Robert Scholte * @since 4.0.0 */ @@ -36,25 +36,25 @@ public interface TransformerContext * Key to get the TransformerContext from the SessionData */ Object KEY = TransformerContext.class; - + /** * Get the value of the commandline argument {@code -Dkey=value} * @param key * @return */ String getUserProperty( String key ); - + /** * Get the model based on the path, will be used to resolve the parent based on relativePath - * + * * @param pomFile the path to the pomFile * @return the model, otherwise {@code null} */ Model getRawModel( Path pomFile ); - + /** * Get the model from the reactor based on the groupId and artifactId, will be used for reactor dependencies - * + * * @param groupId the groupId * @param artifactId the artifactId * @return the model, otherwise {@code null} diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/TransformerException.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/TransformerException.java index cb8f6a8142..0644afe940 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/building/TransformerException.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/TransformerException.java @@ -20,7 +20,7 @@ package org.apache.maven.model.building; */ /** - * + * * @author Robert Scholte * @since 4.0.0 */ diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/UrlModelSource.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/UrlModelSource.java index e41d74b384..dcbbc52f4f 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/building/UrlModelSource.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/UrlModelSource.java @@ -27,7 +27,7 @@ import org.apache.maven.building.UrlSource; * Wraps an ordinary {@link URL} as a model source. * * @author Benjamin Bentmann - * + * * @deprecated instead use {@link UrlSource} */ @Deprecated diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/StringVisitorModelInterpolator.java b/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/StringVisitorModelInterpolator.java index 313c4f7416..a12eb1024b 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/StringVisitorModelInterpolator.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/StringVisitorModelInterpolator.java @@ -80,7 +80,7 @@ import org.codehaus.plexus.util.xml.Xpp3Dom; /** * StringVisitorModelInterpolator - * + * * @since 3.6.2 */ @Named 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 f789333fe7..a4c3cda3ce 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 @@ -229,12 +229,12 @@ public class DefaultModelValidator } } } - + @Override public void validateRawModel( Model m, ModelBuildingRequest request, ModelProblemCollector problems ) { Parent parent = m.getParent(); - + if ( parent != null ) { validateStringNotEmpty( "parent.version", problems, Severity.FATAL, Version.BASE, parent.getVersion(), diff --git a/maven-model-builder/src/test/java/org/apache/maven/model/building/FileModelSourceTest.java b/maven-model-builder/src/test/java/org/apache/maven/model/building/FileModelSourceTest.java index 9b0ecd9ddf..996adf83d8 100644 --- a/maven-model-builder/src/test/java/org/apache/maven/model/building/FileModelSourceTest.java +++ b/maven-model-builder/src/test/java/org/apache/maven/model/building/FileModelSourceTest.java @@ -38,7 +38,7 @@ public class FileModelSourceTest */ @Test public void testEquals() - throws Exception + throws Exception { File tempFile = createTempFile( "pomTest" ); FileModelSource instance = new FileModelSource( tempFile ); @@ -50,19 +50,19 @@ public class FileModelSourceTest } @Test - public void testWindowsPaths() - throws Exception + public void testWindowsPaths() + throws Exception { assumeTrue( SystemUtils.IS_OS_WINDOWS ); File upperCaseFile = createTempFile( "TESTE" ); String absolutePath = upperCaseFile.getAbsolutePath(); File lowerCaseFile = new File( absolutePath.toLowerCase() ); - + FileModelSource upperCaseFileSouce = new FileModelSource( upperCaseFile ); FileModelSource lowerCaseFileSouce = new FileModelSource( lowerCaseFile ); - assertTrue( upperCaseFileSouce.equals( lowerCaseFileSouce ) ); + assertTrue( upperCaseFileSouce.equals( lowerCaseFileSouce ) ); } private File createTempFile( String name ) throws IOException diff --git a/maven-model-builder/src/test/java/org/apache/maven/model/building/FileToRawModelMergerTest.java b/maven-model-builder/src/test/java/org/apache/maven/model/building/FileToRawModelMergerTest.java index 485dc4c83d..9dd3f555b9 100644 --- a/maven-model-builder/src/test/java/org/apache/maven/model/building/FileToRawModelMergerTest.java +++ b/maven-model-builder/src/test/java/org/apache/maven/model/building/FileToRawModelMergerTest.java @@ -45,7 +45,7 @@ public class FileToRawModelMergerTest List methodNames = Stream.of( ModelMerger.class.getDeclaredMethods() ) .filter( m -> m.getName().startsWith( "merge" ) ) - .filter( m -> + .filter( m -> { String baseName = m.getName().substring( 5 /* merge */ ); String entity = baseName.substring( baseName.indexOf( '_' ) + 1 ); @@ -77,6 +77,6 @@ public class FileToRawModelMergerTest assertThat( overriddenMethods, hasItems( methodNames.toArray( new String[0] ) ) ); } - + } diff --git a/maven-model-builder/src/test/java/org/apache/maven/model/inheritance/DefaultInheritanceAssemblerTest.java b/maven-model-builder/src/test/java/org/apache/maven/model/inheritance/DefaultInheritanceAssemblerTest.java index 131b762c5c..25abf0fb09 100644 --- a/maven-model-builder/src/test/java/org/apache/maven/model/inheritance/DefaultInheritanceAssemblerTest.java +++ b/maven-model-builder/src/test/java/org/apache/maven/model/inheritance/DefaultInheritanceAssemblerTest.java @@ -189,12 +189,12 @@ public class DefaultInheritanceAssemblerTest } } - public void testWithEmptyUrl() + public void testWithEmptyUrl() throws IOException { testInheritance( "empty-urls", false ); } - + public void testInheritance( String baseName ) throws IOException { diff --git a/maven-model-builder/src/test/java/org/apache/maven/model/merge/MavenModelMergerTest.java b/maven-model-builder/src/test/java/org/apache/maven/model/merge/MavenModelMergerTest.java index 3832b0c2d9..c23be0fdf5 100644 --- a/maven-model-builder/src/test/java/org/apache/maven/model/merge/MavenModelMergerTest.java +++ b/maven-model-builder/src/test/java/org/apache/maven/model/merge/MavenModelMergerTest.java @@ -73,7 +73,7 @@ public class MavenModelMergerTest Model model = new Model(); modelMerger.mergeModel_Prerequisites( model, parent, false, null ); assertNull( model.getPrerequisites() ); - + Prerequisites modelPrerequisites = new Prerequisites(); modelPrerequisites.setMaven( "3.0" ); model.setPrerequisites( modelPrerequisites ); @@ -90,7 +90,7 @@ public class MavenModelMergerTest Model model = new Model(); modelMerger.mergeModel_Profiles( model, parent, false, null ); assertEquals( 0, model.getProfiles().size() ); - + Profile modelProfile = new Profile(); modelProfile.setId( "MODEL" ); model.setProfiles( Collections.singletonList( modelProfile ) ); diff --git a/maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java b/maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java index 252b1d95f9..7e94234f23 100644 --- a/maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java +++ b/maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java @@ -64,11 +64,11 @@ public class DefaultModelValidatorTest throws Exception { ModelBuildingRequest request = new DefaultModelBuildingRequest().setValidationLevel( level ); - + Model model = read( pom ); SimpleProblemCollector problems = new SimpleProblemCollector( model ); - + validator.validateEffectiveModel( model, request, problems ); return problems; @@ -80,11 +80,11 @@ public class DefaultModelValidatorTest ModelBuildingRequest request = new DefaultModelBuildingRequest().setValidationLevel( level ); Model model = read( pom ); - + SimpleProblemCollector problems = new SimpleProblemCollector( model ); validator.validateFileModel( model, request, problems ); - + validator.validateRawModel( model, request, problems ); return problems; diff --git a/maven-model-builder/src/test/resources/poms/inheritance/module-path-not-artifactId-child.xml b/maven-model-builder/src/test/resources/poms/inheritance/module-path-not-artifactId-child.xml index 1c3ff21132..f39f75edb4 100644 --- a/maven-model-builder/src/test/resources/poms/inheritance/module-path-not-artifactId-child.xml +++ b/maven-model-builder/src/test/resources/poms/inheritance/module-path-not-artifactId-child.xml @@ -34,7 +34,7 @@ under the License. artifactId == "child-artifact-id" but expect path on SCM and site == "child" - feature: support "project.directory" property, ressembling future model addition of "directory" element along "artifactId" + feature: support "project.directory" property, ressembling future model addition of "directory" element along "artifactId" diff --git a/maven-model-builder/src/test/resources/poms/inheritance/module-path-not-artifactId-expected.xml b/maven-model-builder/src/test/resources/poms/inheritance/module-path-not-artifactId-expected.xml index 78b9cb34c1..04e6e1da5a 100644 --- a/maven-model-builder/src/test/resources/poms/inheritance/module-path-not-artifactId-expected.xml +++ b/maven-model-builder/src/test/resources/poms/inheritance/module-path-not-artifactId-expected.xml @@ -36,7 +36,7 @@ under the License. artifactId == "child-artifact-id" but expect path on SCM and site == "child" - feature: support "project.directory" property, ressembling future model addition of "directory" element along "artifactId" + feature: support "project.directory" property, ressembling future model addition of "directory" element along "artifactId" diff --git a/maven-model-builder/src/test/resources/poms/validation/raw-model/self-referencing.xml b/maven-model-builder/src/test/resources/poms/validation/raw-model/self-referencing.xml index b5e0383682..de0ac3a8ee 100644 --- a/maven-model-builder/src/test/resources/poms/validation/raw-model/self-referencing.xml +++ b/maven-model-builder/src/test/resources/poms/validation/raw-model/self-referencing.xml @@ -25,7 +25,7 @@ under the License. 0.0.1-SNAPSHOT - This will test if the module validator recognized that this + This will test if the module validator recognized that this dependency is the same as the module itself. diff --git a/maven-model/src/main/java/org/apache/maven/model/merge/ModelMerger.java b/maven-model/src/main/java/org/apache/maven/model/merge/ModelMerger.java index 956f67a796..e02942fa80 100644 --- a/maven-model/src/main/java/org/apache/maven/model/merge/ModelMerger.java +++ b/maven-model/src/main/java/org/apache/maven/model/merge/ModelMerger.java @@ -1494,8 +1494,8 @@ public class ModelMerger protected void mergeMailingList_OtherArchives( MailingList target, MailingList source, boolean sourceDominant, Map context ) { - target.setOtherArchives( merge( target.getOtherArchives(), - source.getOtherArchives(), + target.setOtherArchives( merge( target.getOtherArchives(), + source.getOtherArchives(), sourceDominant, e -> e ) ); } @@ -2557,7 +2557,7 @@ public class ModelMerger { return exclusion; } - + protected KeyComputer getDependencyKey() { return d -> d; @@ -2710,8 +2710,8 @@ public class ModelMerger { if ( map == null ) { - map = list.stream().collect( Collectors.toMap( keyComputer, - Function.identity(), + map = list.stream().collect( Collectors.toMap( keyComputer, + Function.identity(), null, LinkedHashMap::new ) ); @@ -2732,7 +2732,7 @@ public class ModelMerger for ( V v : vs ) { Object key = keyComputer.apply( v ); - + map.merge( key, v, remapping ); } } diff --git a/maven-model/src/test/java/org/apache/maven/model/merge/ModelMergerTest.java b/maven-model/src/test/java/org/apache/maven/model/merge/ModelMergerTest.java index 2c8eb59498..732c277894 100644 --- a/maven-model/src/test/java/org/apache/maven/model/merge/ModelMergerTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/merge/ModelMergerTest.java @@ -40,15 +40,15 @@ import org.apache.maven.model.Repository; import org.junit.Test; /** - * ModelMerger is based on same instances, subclasses should override KeyComputer per type - * + * ModelMerger is based on same instances, subclasses should override KeyComputer per type + * * @author Robert Scholte - * + * */ public class ModelMergerTest { private ModelMerger modelMerger = new ModelMerger(); - + @Test public void mergeArtifactId() { @@ -57,7 +57,7 @@ public class ModelMergerTest Model source = new Model(); source.setArtifactId( "SOURCE" ); - + modelMerger.merge( target, source, true, null ); assertThat( target.getArtifactId(), is( "SOURCE" ) ); @@ -65,7 +65,7 @@ public class ModelMergerTest modelMerger.merge( target, source, false, null ); assertThat( target.getArtifactId(), is( "TARGET" ) ); } - + @Test public void mergeSameContributors() { @@ -77,7 +77,7 @@ public class ModelMergerTest Model source = new Model(); source.setContributors( Arrays.asList( contributor ) ); - + modelMerger.merge( target, source, true, null ); assertThat( target.getContributors(), contains( contributor ) ); @@ -90,18 +90,18 @@ public class ModelMergerTest dependency.setGroupId( "groupId" ); dependency.setArtifactId( "artifactId" ); dependency.setType( "type" ); - + Model target = new Model(); target.setDependencies( Arrays.asList( dependency ) ); Model source = new Model(); source.setDependencies( Arrays.asList( dependency ) ); - + modelMerger.merge( target, source, true, null ); assertThat( target.getDependencies(), contains( dependency ) ); } - + @Test public void mergeDescription() { @@ -110,7 +110,7 @@ public class ModelMergerTest Model source = new Model(); source.setDescription( "SOURCE" ); - + modelMerger.merge( target, source, true, null ); assertThat( target.getDescription(), is( "SOURCE" ) ); @@ -118,19 +118,19 @@ public class ModelMergerTest modelMerger.merge( target, source, false, null ); assertThat( target.getDescription(), is( "TARGET" ) ); } - + @Test public void mergeSameDevelopers() { Developer developer = new Developer(); developer.setId( "devid" ); - + Model target = new Model(); target.setDevelopers( Arrays.asList( developer ) ); Model source = new Model(); source.setDevelopers( Arrays.asList( developer ) ); - + modelMerger.merge( target, source, true, null ); assertThat( target.getDevelopers(), contains( developer ) ); @@ -183,7 +183,7 @@ public class ModelMergerTest Model source = new Model(); source.setGroupId( "SOURCE" ); - + modelMerger.merge( target, source, true, null ); assertThat( target.getGroupId(), is( "SOURCE" ) ); @@ -191,7 +191,7 @@ public class ModelMergerTest modelMerger.merge( target, source, false, null ); assertThat( target.getGroupId(), is( "TARGET" ) ); } - + @Test public void mergeInceptionYear() { @@ -200,7 +200,7 @@ public class ModelMergerTest Model source = new Model(); source.setInceptionYear( "SOURCE" ); - + modelMerger.merge( target, source, true, null ); assertThat( target.getInceptionYear(), is( "SOURCE" ) ); @@ -227,18 +227,18 @@ public class ModelMergerTest { MailingList mailingList = new MailingList(); mailingList.setName( "name" ); - + Model target = new Model(); target.setMailingLists( Arrays.asList( mailingList ) ); Model source = new Model(); source.setMailingLists( Arrays.asList( mailingList ) ); - + modelMerger.merge( target, source, true, null ); assertThat( target.getMailingLists(), contains( mailingList ) ); } - + @Test public void mergeModelVersion() { @@ -247,7 +247,7 @@ public class ModelMergerTest Model source = new Model(); source.setModelVersion( "SOURCE" ); - + modelMerger.merge( target, source, true, null ); assertThat( target.getModelVersion(), is( "SOURCE" ) ); @@ -277,7 +277,7 @@ public class ModelMergerTest Model source = new Model(); source.setName( "SOURCE" ); - + modelMerger.merge( target, source, true, null ); assertThat( target.getName(), is( "SOURCE" ) ); @@ -307,7 +307,7 @@ public class ModelMergerTest Model source = new Model(); source.setPackaging( "SOURCE" ); - + modelMerger.merge( target, source, true, null ); assertThat( target.getPackaging(), is( "SOURCE" ) ); @@ -321,13 +321,13 @@ public class ModelMergerTest { Repository repository = new Repository(); repository.setId( "repository" ); - + Model target = new Model(); target.setPluginRepositories( Arrays.asList( repository ) ); Model source = new Model(); source.setPluginRepositories( Arrays.asList( repository ) ); - + modelMerger.merge( target, source, true, null ); assertThat( target.getPluginRepositories(), contains( repository ) ); @@ -338,13 +338,13 @@ public class ModelMergerTest { Profile profile = new Profile(); profile.setId( "profile" ); - + Model target = new Model(); target.setProfiles( Arrays.asList( profile ) ); Model source = new Model(); source.setProfiles( Arrays.asList( profile ) ); - + modelMerger.merge( target, source, true, null ); assertThat( target.getProfiles(), contains( profile ) ); @@ -368,13 +368,13 @@ public class ModelMergerTest { Repository repository = new Repository(); repository.setId( "repository" ); - + Model target = new Model(); target.setRepositories( Arrays.asList( repository ) ); Model source = new Model(); source.setRepositories( Arrays.asList( repository ) ); - + modelMerger.merge( target, source, true, null ); assertThat( target.getRepositories(), contains( repository ) ); @@ -401,7 +401,7 @@ public class ModelMergerTest Model source = new Model(); source.setUrl( "SOURCE" ); - + modelMerger.merge( target, source, true, null ); assertThat( target.getUrl(), is( "SOURCE" ) ); @@ -418,7 +418,7 @@ public class ModelMergerTest Model source = new Model(); source.setVersion( "SOURCE" ); - + modelMerger.merge( target, source, true, null ); assertThat( target.getVersion(), is( "SOURCE" ) ); diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorReaderDelegate.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorReaderDelegate.java index 82192058c8..517441f013 100644 --- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorReaderDelegate.java +++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorReaderDelegate.java @@ -45,7 +45,7 @@ import org.eclipse.aether.resolution.ArtifactDescriptorResult; /** * Populates Aether {@link ArtifactDescriptorResult} from Maven project {@link Model}. - * + * * Note: This class is part of work in progress and can be changed or removed without notice. * @since 3.2.4 */ diff --git a/maven-settings-builder/src/main/java/org/apache/maven/settings/building/FileSettingsSource.java b/maven-settings-builder/src/main/java/org/apache/maven/settings/building/FileSettingsSource.java index 3c2d32acb9..711261d511 100644 --- a/maven-settings-builder/src/main/java/org/apache/maven/settings/building/FileSettingsSource.java +++ b/maven-settings-builder/src/main/java/org/apache/maven/settings/building/FileSettingsSource.java @@ -27,7 +27,7 @@ import org.apache.maven.building.FileSource; * Wraps an ordinary {@link File} as a settings source. * * @author Benjamin Bentmann - * + * * @deprecated instead use {@link FileSource} */ @Deprecated diff --git a/maven-settings-builder/src/main/java/org/apache/maven/settings/building/SettingsSource.java b/maven-settings-builder/src/main/java/org/apache/maven/settings/building/SettingsSource.java index 413a3570af..a933b097c9 100644 --- a/maven-settings-builder/src/main/java/org/apache/maven/settings/building/SettingsSource.java +++ b/maven-settings-builder/src/main/java/org/apache/maven/settings/building/SettingsSource.java @@ -25,7 +25,7 @@ import org.apache.maven.building.Source; * Provides access to the contents of settings independently of the backing store (e.g. file system, database, memory). * * @author Benjamin Bentmann - * + * * @deprecated instead use {@link Source} */ @Deprecated diff --git a/maven-settings-builder/src/main/java/org/apache/maven/settings/building/StringSettingsSource.java b/maven-settings-builder/src/main/java/org/apache/maven/settings/building/StringSettingsSource.java index dbe9758069..989fc0ef87 100644 --- a/maven-settings-builder/src/main/java/org/apache/maven/settings/building/StringSettingsSource.java +++ b/maven-settings-builder/src/main/java/org/apache/maven/settings/building/StringSettingsSource.java @@ -25,7 +25,7 @@ import org.apache.maven.building.StringSource; * Wraps an ordinary {@link CharSequence} as a settings source. * * @author Benjamin Bentmann - * + * * @deprecated instead use {@link StringSource} */ @Deprecated diff --git a/maven-settings-builder/src/main/java/org/apache/maven/settings/building/UrlSettingsSource.java b/maven-settings-builder/src/main/java/org/apache/maven/settings/building/UrlSettingsSource.java index 2b40f648b8..1adc4bf07d 100644 --- a/maven-settings-builder/src/main/java/org/apache/maven/settings/building/UrlSettingsSource.java +++ b/maven-settings-builder/src/main/java/org/apache/maven/settings/building/UrlSettingsSource.java @@ -27,7 +27,7 @@ import org.apache.maven.building.UrlSource; * Wraps an ordinary {@link URL} as a settings source. * * @author Benjamin Bentmann - * + * * @deprecated instead use {@link UrlSource} */ @Deprecated @@ -56,5 +56,5 @@ public class UrlSettingsSource extends UrlSource { return getUrl(); } - + } diff --git a/maven-settings-builder/src/main/java/org/apache/maven/settings/validation/DefaultSettingsValidator.java b/maven-settings-builder/src/main/java/org/apache/maven/settings/validation/DefaultSettingsValidator.java index 2aec1e1103..f0886421a3 100644 --- a/maven-settings-builder/src/main/java/org/apache/maven/settings/validation/DefaultSettingsValidator.java +++ b/maven-settings-builder/src/main/java/org/apache/maven/settings/validation/DefaultSettingsValidator.java @@ -151,7 +151,7 @@ public class DefaultSettingsValidator if ( proxies != null ) { Set proxyIds = new HashSet<>(); - + for ( Proxy proxy : proxies ) { if ( !proxyIds.add( proxy.getId() ) ) diff --git a/maven-wrapper/pom.xml b/maven-wrapper/pom.xml index 248adc7dbf..53cd3c3ed0 100644 --- a/maven-wrapper/pom.xml +++ b/maven-wrapper/pom.xml @@ -26,10 +26,10 @@ under the License. maven 4.0.0-alpha-1-SNAPSHOT - + maven-wrapper Maven Wrapper - + ${project.artifactId} diff --git a/maven-wrapper/src/main/java/org/apache/maven/wrapper/BootstrapMainStarter.java b/maven-wrapper/src/main/java/org/apache/maven/wrapper/BootstrapMainStarter.java index f4a5d73eb6..515de10f3c 100644 --- a/maven-wrapper/src/main/java/org/apache/maven/wrapper/BootstrapMainStarter.java +++ b/maven-wrapper/src/main/java/org/apache/maven/wrapper/BootstrapMainStarter.java @@ -52,7 +52,7 @@ public class BootstrapMainStarter return Files.list( mavenHome.resolve( "boot" ) ) .filter( p -> p.getFileName().toString().matches( "plexus-classworlds-.*\\.jar" ) ) .findFirst() - .orElseThrow( () -> new RuntimeException( + .orElseThrow( () -> new RuntimeException( String.format( "Couldn't locate the Maven launcher JAR in Maven distribution '%s'.", mavenHome ) ) ); } diff --git a/maven-wrapper/src/main/java/org/apache/maven/wrapper/Installer.java b/maven-wrapper/src/main/java/org/apache/maven/wrapper/Installer.java index 3a0b46f502..16188cb3a7 100644 --- a/maven-wrapper/src/main/java/org/apache/maven/wrapper/Installer.java +++ b/maven-wrapper/src/main/java/org/apache/maven/wrapper/Installer.java @@ -123,7 +123,7 @@ public class Installer dirs = listDirs( distDir ); if ( dirs.isEmpty() ) { - throw new RuntimeException( String.format( + throw new RuntimeException( String.format( "Maven distribution '%s' does not contain any directories. Expected to find exactly 1 directory.", distributionUrl ) ); } @@ -131,7 +131,7 @@ public class Installer } if ( dirs.size() != 1 ) { - throw new IllegalStateException( String.format( + throw new IllegalStateException( String.format( "Maven distribution '%s' contains too many directories. Expected to find exactly 1 directory.", distributionUrl ) ); } @@ -214,7 +214,7 @@ public class Installer Path targetFile = dest.resolve( entry.getName() ).normalize(); // prevent Zip Slip - if ( targetFile.startsWith( dest ) ) + if ( targetFile.startsWith( dest ) ) { Files.createDirectories( targetFile.getParent() ); diff --git a/maven-wrapper/src/main/java/org/apache/maven/wrapper/MavenWrapperMain.java b/maven-wrapper/src/main/java/org/apache/maven/wrapper/MavenWrapperMain.java index cf80b2adde..35aebf7473 100644 --- a/maven-wrapper/src/main/java/org/apache/maven/wrapper/MavenWrapperMain.java +++ b/maven-wrapper/src/main/java/org/apache/maven/wrapper/MavenWrapperMain.java @@ -33,7 +33,7 @@ import java.util.Properties; public class MavenWrapperMain { private static final String POM_PROPERTIES = "/META-INF/maven/org.apache.maven/maven-wrapper/pom.properties"; - + public static final String DEFAULT_MAVEN_USER_HOME = System.getProperty( "user.home" ) + "/.m2"; public static final String MVNW_VERBOSE = "MVNW_VERBOSE"; diff --git a/maven-wrapper/src/test/java/org/apache/maven/wrapper/WrapperExecutorTest.java b/maven-wrapper/src/test/java/org/apache/maven/wrapper/WrapperExecutorTest.java index 2373fafc7f..b160be0352 100644 --- a/maven-wrapper/src/test/java/org/apache/maven/wrapper/WrapperExecutorTest.java +++ b/maven-wrapper/src/test/java/org/apache/maven/wrapper/WrapperExecutorTest.java @@ -57,7 +57,7 @@ public class WrapperExecutorTest throws Exception { mockInstallDir = testDir.newFolder( "mock-dir" ).toPath(); - + install = mock( Installer.class ); when( install.createDist( Mockito.any( WrapperConfiguration.class ) ) ).thenReturn( mockInstallDir ); start = mock( BootstrapMainStarter.class ); diff --git a/maven-xml/src/main/java/org/apache/maven/xml/Factories.java b/maven-xml/src/main/java/org/apache/maven/xml/Factories.java index e9749aee83..c653d8f3a2 100644 --- a/maven-xml/src/main/java/org/apache/maven/xml/Factories.java +++ b/maven-xml/src/main/java/org/apache/maven/xml/Factories.java @@ -31,7 +31,7 @@ import org.xml.sax.helpers.XMLReaderFactory; /** * Creates XML related factories with OWASP advices applied - * + * * @author Robert Scholte * @since 4.0.0 */ @@ -40,13 +40,13 @@ public final class Factories private Factories() { } - + /** - * + * * @return * @see https://cheatsheetseries.owasp.org/cheatsheets/XML_External_Entity_Prevention_Cheat_Sheet.html#transformerfactory */ - public static TransformerFactory newTransformerFactory() + public static TransformerFactory newTransformerFactory() { TransformerFactory tf = TransformerFactory.newInstance(); tf.setAttribute( XMLConstants.ACCESS_EXTERNAL_DTD, "" ); @@ -54,16 +54,16 @@ public final class Factories return tf; } - + public static XMLReader newXMLReader() throws SAXException, ParserConfigurationException { XMLReader reader = XMLReaderFactory.createXMLReader(); - + try { // Xerces 1 - http://xerces.apache.org/xerces-j/features.html#external-general-entities // Xerces 2 - http://xerces.apache.org/xerces2-j/features.html#external-general-entities - + // Using the XMLReader's setFeature reader.setFeature( "http://xml.org/sax/features/external-general-entities", false ); } diff --git a/maven-xml/src/main/java/org/apache/maven/xml/sax/SAXEvent.java b/maven-xml/src/main/java/org/apache/maven/xml/sax/SAXEvent.java index 3ffbcbac72..903e53f6f5 100644 --- a/maven-xml/src/main/java/org/apache/maven/xml/sax/SAXEvent.java +++ b/maven-xml/src/main/java/org/apache/maven/xml/sax/SAXEvent.java @@ -23,7 +23,7 @@ import org.xml.sax.SAXException; /** * Command pattern to gather events which can be executed later on. - * + * * @author Robert Scholte * @since 4.0.0 */ diff --git a/maven-xml/src/main/java/org/apache/maven/xml/sax/SAXEventFactory.java b/maven-xml/src/main/java/org/apache/maven/xml/sax/SAXEventFactory.java index cdd3653013..463264aa96 100644 --- a/maven-xml/src/main/java/org/apache/maven/xml/sax/SAXEventFactory.java +++ b/maven-xml/src/main/java/org/apache/maven/xml/sax/SAXEventFactory.java @@ -26,14 +26,14 @@ import org.xml.sax.ext.LexicalHandler; /** * Factory for SAXEvents - * + * * @author Robert Scholte * @since 4.0.0 */ public final class SAXEventFactory { private final ContentHandler contentHandler; - + private final LexicalHandler lexicalHandler; protected SAXEventFactory( ContentHandler contentHandler, LexicalHandler lexicalHandler ) @@ -98,7 +98,7 @@ public final class SAXEventFactory { return () -> contentHandler.startPrefixMapping( prefix, uri ); } - + public static SAXEventFactory newInstance( ContentHandler contentHandler, LexicalHandler lexicalHandler ) { return new SAXEventFactory( contentHandler, lexicalHandler ); @@ -122,7 +122,7 @@ public final class SAXEventFactory public SAXEvent endEntity( String name ) { return () -> lexicalHandler.endEntity( name ); - + } public SAXEvent startCDATA() diff --git a/maven-xml/src/main/java/org/apache/maven/xml/sax/SAXEventUtils.java b/maven-xml/src/main/java/org/apache/maven/xml/sax/SAXEventUtils.java index b29a6b1aea..6283b82ce3 100644 --- a/maven-xml/src/main/java/org/apache/maven/xml/sax/SAXEventUtils.java +++ b/maven-xml/src/main/java/org/apache/maven/xml/sax/SAXEventUtils.java @@ -23,21 +23,21 @@ import java.util.regex.Pattern; /** * Utility class for SAXEvents - * + * * @author Robert Scholte * @since 4.0.0 */ public final class SAXEventUtils { private static final Pattern PATTERN = Pattern.compile( "[^:]+$" ); - + private SAXEventUtils() { } - + /** - * Returns the newLocalName prefixed with the namespace of the oldQName if present - * + * Returns the newLocalName prefixed with the namespace of the oldQName if present + * * @param oldQName the QName, used for its namespace * @param newLocalName the preferred localName * @return the new QName diff --git a/maven-xml/src/main/java/org/apache/maven/xml/sax/ext/CommentRenormalizer.java b/maven-xml/src/main/java/org/apache/maven/xml/sax/ext/CommentRenormalizer.java index 880c62d850..d108d1c018 100644 --- a/maven-xml/src/main/java/org/apache/maven/xml/sax/ext/CommentRenormalizer.java +++ b/maven-xml/src/main/java/org/apache/maven/xml/sax/ext/CommentRenormalizer.java @@ -25,15 +25,15 @@ import org.xml.sax.ext.LexicalHandler; /** * During parsing the line separators are transformed to \n * Unlike characters(), comments don't use the systems line separator for serialization. - * Hence use this class in the LexicalHandler chain to do so - * + * Hence use this class in the LexicalHandler chain to do so + * * @author Robert Scholte * @since 4.0.0 */ public class CommentRenormalizer implements LexicalHandler { private final LexicalHandler lexicalHandler; - + private final String lineSeparator; public CommentRenormalizer( LexicalHandler lexicalHandler ) @@ -59,7 +59,7 @@ public class CommentRenormalizer implements LexicalHandler else { char[] ca = new String( ch, start, length ).replaceAll( "\n", lineSeparator ).toCharArray(); - + lexicalHandler.comment( ca, 0, ca.length ); } } diff --git a/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/AbstractEventXMLFilter.java b/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/AbstractEventXMLFilter.java index 7911d23ee6..39abf23f06 100644 --- a/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/AbstractEventXMLFilter.java +++ b/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/AbstractEventXMLFilter.java @@ -32,31 +32,31 @@ import org.xml.sax.SAXException; /** * Builds up a list of SAXEvents, which will be executed with {@link #executeEvents()} - * + * * @author Robert Scholte * @since 4.0.0 */ abstract class AbstractEventXMLFilter extends AbstractSAXFilter { private Queue saxEvents = new ArrayDeque<>(); - + private SAXEventFactory eventFactory; - + // characters BEFORE startElement must get state of startingElement // this way removing based on state keeps correct formatting private List charactersSegments = new ArrayList<>(); - + private boolean lockCharacters = false; - + protected abstract boolean isParsing(); - + protected abstract String getState(); - + protected boolean acceptEvent( String state ) { return true; } - + AbstractEventXMLFilter() { super(); @@ -75,19 +75,19 @@ abstract class AbstractEventXMLFilter extends AbstractSAXFilter } return eventFactory; } - + private void processEvent( final SAXEvent event ) throws SAXException { if ( isParsing() ) { final String eventState = getState(); - + if ( !lockCharacters ) { - charactersSegments.stream().forEach( e -> + charactersSegments.stream().forEach( e -> { - saxEvents.add( () -> + saxEvents.add( () -> { if ( acceptEvent( eventState ) ) { @@ -98,7 +98,7 @@ abstract class AbstractEventXMLFilter extends AbstractSAXFilter charactersSegments.clear(); } - saxEvents.add( () -> + saxEvents.add( () -> { if ( acceptEvent( eventState ) ) { @@ -115,22 +115,22 @@ abstract class AbstractEventXMLFilter extends AbstractSAXFilter /** * Should be used to include extra events before a closing element. * This is a lightweight solution to keep the correct indentation. - * + * * @return */ - protected Includer include() + protected Includer include() { this.lockCharacters = true; - + return () -> lockCharacters = false; } protected final void executeEvents() throws SAXException { final String eventState = getState(); - charactersSegments.stream().forEach( e -> + charactersSegments.stream().forEach( e -> { - saxEvents.add( () -> + saxEvents.add( () -> { if ( acceptEvent( eventState ) ) { @@ -139,14 +139,14 @@ abstract class AbstractEventXMLFilter extends AbstractSAXFilter } ); } ); charactersSegments.clear(); - + // not with streams due to checked SAXException while ( !saxEvents.isEmpty() ) { saxEvents.poll().execute(); } } - + @Override public void setDocumentLocator( Locator locator ) { @@ -266,7 +266,7 @@ abstract class AbstractEventXMLFilter extends AbstractSAXFilter public void endCDATA() throws SAXException { - processEvent( getEventFactory().endCDATA() ); + processEvent( getEventFactory().endCDATA() ); } @Override @@ -275,10 +275,10 @@ abstract class AbstractEventXMLFilter extends AbstractSAXFilter { processEvent( getEventFactory().comment( ch, start, length ) ); } - + /** * AutoCloseable with a close method that doesn't throw an exception - * + * * @author Robert Scholte * */ diff --git a/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/AbstractSAXFilter.java b/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/AbstractSAXFilter.java index 144b84ab88..5ce2799703 100644 --- a/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/AbstractSAXFilter.java +++ b/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/AbstractSAXFilter.java @@ -27,14 +27,14 @@ import org.xml.sax.helpers.XMLFilterImpl; * XMLFilter with LexicalHandler. * Since some filters collect events before processing them, the LexicalHandler events must be collected too. * Otherwise the LexicalHandler events might end up before all collected XMLReader events. - * + * * @author Robert Scholte * @since 4.0.0 */ public class AbstractSAXFilter extends XMLFilterImpl implements LexicalHandler { private LexicalHandler lexicalHandler; - + public AbstractSAXFilter() { super(); @@ -45,22 +45,22 @@ public class AbstractSAXFilter extends XMLFilterImpl implements LexicalHandler super( parent ); parent.setLexicalHandler( this ); } - + public LexicalHandler getLexicalHandler() { return lexicalHandler; } - + public void setLexicalHandler( LexicalHandler lexicalHandler ) { this.lexicalHandler = lexicalHandler; } - + @Override public void startDTD( String name, String publicId, String systemId ) throws SAXException { - if ( lexicalHandler != null ) + if ( lexicalHandler != null ) { lexicalHandler.startDTD( name, publicId, systemId ); } @@ -70,7 +70,7 @@ public class AbstractSAXFilter extends XMLFilterImpl implements LexicalHandler public void endDTD() throws SAXException { - if ( lexicalHandler != null ) + if ( lexicalHandler != null ) { lexicalHandler.endDTD(); } @@ -80,7 +80,7 @@ public class AbstractSAXFilter extends XMLFilterImpl implements LexicalHandler public void startEntity( String name ) throws SAXException { - if ( lexicalHandler != null ) + if ( lexicalHandler != null ) { lexicalHandler.startEntity( name ); } @@ -90,7 +90,7 @@ public class AbstractSAXFilter extends XMLFilterImpl implements LexicalHandler public void endEntity( String name ) throws SAXException { - if ( lexicalHandler != null ) + if ( lexicalHandler != null ) { lexicalHandler.endEntity( name ); } @@ -100,7 +100,7 @@ public class AbstractSAXFilter extends XMLFilterImpl implements LexicalHandler public void startCDATA() throws SAXException { - if ( lexicalHandler != null ) + if ( lexicalHandler != null ) { lexicalHandler.startCDATA(); } @@ -110,7 +110,7 @@ public class AbstractSAXFilter extends XMLFilterImpl implements LexicalHandler public void endCDATA() throws SAXException { - if ( lexicalHandler != null ) + if ( lexicalHandler != null ) { lexicalHandler.endCDATA(); } @@ -120,16 +120,16 @@ public class AbstractSAXFilter extends XMLFilterImpl implements LexicalHandler public void comment( char[] ch, int start, int length ) throws SAXException { - if ( lexicalHandler != null ) + if ( lexicalHandler != null ) { lexicalHandler.comment( ch, start, length ); } } - - + + protected static String nullSafeAppend( String originalValue, String charSegment ) { - if ( originalValue == null ) + if ( originalValue == null ) { return charSegment; } diff --git a/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/BuildPomXMLFilter.java b/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/BuildPomXMLFilter.java index d8c656855b..47c24eb0f8 100644 --- a/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/BuildPomXMLFilter.java +++ b/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/BuildPomXMLFilter.java @@ -26,12 +26,12 @@ import org.xml.sax.XMLReader; * There should only be 1 BuildPomXMLFilter, so the same is being used by both * org.apache.maven.model.building.DefaultModelBuilder.transformData(InputStream) and * org.apache.maven.internal.aether.DefaultRepositorySystemSessionFactory.newFileTransformerManager() - * - * + * + * * @author Robert Scholte * @since 4.0.0 */ -public class BuildPomXMLFilter extends AbstractSAXFilter +public class BuildPomXMLFilter extends AbstractSAXFilter { BuildPomXMLFilter() { @@ -42,7 +42,7 @@ public class BuildPomXMLFilter extends AbstractSAXFilter { super( parent ); } - + /** * Don't allow overwriting parent */ diff --git a/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/BuildPomXMLFilterFactory.java b/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/BuildPomXMLFilterFactory.java index 2a194d11d1..307c88037a 100644 --- a/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/BuildPomXMLFilterFactory.java +++ b/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/BuildPomXMLFilterFactory.java @@ -35,7 +35,7 @@ import org.xml.sax.ext.LexicalHandler; /** * Base implementation for providing the BuildPomXML. - * + * * @author Robert Scholte * @since 4.0.0 */ @@ -57,7 +57,7 @@ public class BuildPomXMLFilterFactory } /** - * + * * @param projectFile will be used by ConsumerPomXMLFilter to get the right filter * @return * @throws SAXException @@ -106,8 +106,8 @@ public class BuildPomXMLFilterFactory return new BuildPomXMLFilter( parent ); } - - private XMLReader getXMLReader() throws SAXException, ParserConfigurationException + + private XMLReader getXMLReader() throws SAXException, ParserConfigurationException { XMLReader xmlReader = Factories.newXMLReader(); xmlReader.setFeature( "http://xml.org/sax/features/namespaces", true ); @@ -121,7 +121,7 @@ public class BuildPomXMLFilterFactory { return null; } - + protected BiFunction getDependencyKeyToVersionMapper() { return null; diff --git a/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/BuildPomXMLFilterListener.java b/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/BuildPomXMLFilterListener.java index fbcbe4394a..3058b98126 100644 --- a/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/BuildPomXMLFilterListener.java +++ b/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/BuildPomXMLFilterListener.java @@ -23,7 +23,7 @@ import java.nio.file.Path; /** * Listener can be used to capture the result of the build pom - * + * * @author Robert Scholte * @since 4.0.0 */ @@ -32,7 +32,7 @@ public interface BuildPomXMLFilterListener { /** * Captures the result of the XML transformation - * + * * @param pomFile the original to being transformed * @param b the byte array * @param off the offset diff --git a/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/ConsumerPomXMLFilter.java b/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/ConsumerPomXMLFilter.java index bb82a9cddc..bd4186d4e2 100644 --- a/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/ConsumerPomXMLFilter.java +++ b/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/ConsumerPomXMLFilter.java @@ -26,10 +26,10 @@ import org.xml.sax.ext.LexicalHandler; * XML Filter to transform pom.xml to consumer pom. * This often means stripping of build-specific information. * When extra information is required during filtering it is probably a member of the BuildPomXMLFilter - * + * * This filter is used at 1 locations: * - {@link org.apache.maven.internal.aether.DefaultRepositorySystemSessionFactory} when publishing pom files. - * + * * @author Robert Scholte * @since 4.0.0 */ @@ -39,7 +39,7 @@ public class ConsumerPomXMLFilter extends AbstractSAXFilter { super( filter ); } - + /** * Don't allow overwriting parent */ @@ -51,7 +51,7 @@ public class ConsumerPomXMLFilter extends AbstractSAXFilter super.setParent( parent ); } } - + @Override public LexicalHandler getLexicalHandler() { diff --git a/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/ConsumerPomXMLFilterFactory.java b/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/ConsumerPomXMLFilterFactory.java index 0f2bd7e3c0..b8981a6ca2 100644 --- a/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/ConsumerPomXMLFilterFactory.java +++ b/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/ConsumerPomXMLFilterFactory.java @@ -27,24 +27,24 @@ import javax.xml.transform.TransformerConfigurationException; import org.xml.sax.SAXException; /** - * + * * @author Robert Scholte * @since 4.0.0 */ public class ConsumerPomXMLFilterFactory { private BuildPomXMLFilterFactory buildPomXMLFilterFactory; - + public ConsumerPomXMLFilterFactory( BuildPomXMLFilterFactory buildPomXMLFilterFactory ) { this.buildPomXMLFilterFactory = buildPomXMLFilterFactory; } - + public final ConsumerPomXMLFilter get( Path projectPath ) throws SAXException, ParserConfigurationException, TransformerConfigurationException { BuildPomXMLFilter parent = buildPomXMLFilterFactory.get( projectPath ); - + // Ensure that xs:any elements aren't touched by next filters AbstractSAXFilter filter = new FastForwardFilter( parent ); @@ -53,7 +53,7 @@ public class ConsumerPomXMLFilterFactory filter = new ModulesXMLFilter( filter ); // Adjust relativePath filter = new RelativePathXMLFilter( filter ); - + return new ConsumerPomXMLFilter( filter ); } } diff --git a/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/DependencyKey.java b/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/DependencyKey.java index 97e108ff4c..0ebda3a208 100644 --- a/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/DependencyKey.java +++ b/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/DependencyKey.java @@ -22,31 +22,31 @@ package org.apache.maven.xml.sax.filter; import java.util.Objects; /** - * + * * @author Robert Scholte * @since 4.0.0 */ public class DependencyKey { private final String groupId; - + private final String artifactId; - + private final int hashCode; public DependencyKey( String groupId, String artifactId ) { this.groupId = groupId; this.artifactId = artifactId; - + this.hashCode = Objects.hash( artifactId, groupId ); } - + public String getGroupId() { return groupId; } - + public String getArtifactId() { return artifactId; @@ -61,7 +61,7 @@ public class DependencyKey @Override public boolean equals( Object obj ) { - if ( this == obj ) + if ( this == obj ) { return true; } @@ -73,9 +73,9 @@ public class DependencyKey { return false; } - + DependencyKey other = (DependencyKey) obj; - + if ( !Objects.equals( artifactId, other.artifactId ) ) { return false; @@ -84,9 +84,9 @@ public class DependencyKey { return false; } - + return true; } - - + + } diff --git a/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/FastForwardFilter.java b/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/FastForwardFilter.java index 81747512b3..3296ae3365 100644 --- a/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/FastForwardFilter.java +++ b/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/FastForwardFilter.java @@ -29,8 +29,8 @@ import org.xml.sax.XMLFilter; /** * This filter will skip all following filters and write directly to the output. - * Should be used in case of a DOM that should not be effected by other filters, even though the elements match - * + * Should be used in case of a DOM that should not be effected by other filters, even though the elements match + * * @author Robert Scholte * @since 4.0.0 */ @@ -38,7 +38,7 @@ class FastForwardFilter extends AbstractSAXFilter { /** * DOM elements of pom - * + * *
      *
    • execution.configuration
    • *
    • plugin.configuration
    • @@ -49,11 +49,11 @@ class FastForwardFilter extends AbstractSAXFilter *
        */ private final Deque state = new ArrayDeque<>(); - + private int domDepth = 0; - + private ContentHandler originalHandler; - + FastForwardFilter() { super(); @@ -101,7 +101,7 @@ class FastForwardFilter extends AbstractSAXFilter state.push( localName ); } } - + @Override public void endElement( String uri, String localName, String qName ) throws SAXException @@ -109,7 +109,7 @@ class FastForwardFilter extends AbstractSAXFilter if ( domDepth > 0 ) { domDepth--; - + if ( domDepth == 0 ) { setContentHandler( originalHandler ); @@ -121,6 +121,6 @@ class FastForwardFilter extends AbstractSAXFilter } super.endElement( uri, localName, qName ); } - - + + } \ No newline at end of file diff --git a/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/ModulesXMLFilter.java b/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/ModulesXMLFilter.java index 7c33e0655f..3e71033623 100644 --- a/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/ModulesXMLFilter.java +++ b/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/ModulesXMLFilter.java @@ -24,7 +24,7 @@ import org.xml.sax.SAXException; /** * Remove all modules, this is just buildtime information - * + * * @author Robert Scholte * @since 4.0.0 */ @@ -32,9 +32,9 @@ class ModulesXMLFilter extends AbstractEventXMLFilter { private boolean parsingModules; - + private String state; - + ModulesXMLFilter() { super(); @@ -58,10 +58,10 @@ class ModulesXMLFilter { state = localName; } - + super.startElement( uri, localName, qName, atts ); } - + @Override public void endElement( String uri, String localName, String qName ) throws SAXException @@ -72,7 +72,7 @@ class ModulesXMLFilter { case "modules": executeEvents(); - + parsingModules = false; break; default: @@ -84,11 +84,11 @@ class ModulesXMLFilter { super.endElement( uri, localName, qName ); } - + // for this simple structure resetting to modules it sufficient - state = "modules"; + state = "modules"; } - + @Override protected boolean isParsing() { diff --git a/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/ReactorDependencyXMLFilter.java b/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/ReactorDependencyXMLFilter.java index 0ac1ee8db9..60d3c6ef4a 100644 --- a/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/ReactorDependencyXMLFilter.java +++ b/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/ReactorDependencyXMLFilter.java @@ -27,7 +27,7 @@ import org.xml.sax.SAXException; /** * Will apply the version if the dependency is part of the reactor - * + * * @author Robert Scholte * @since 4.0.0 */ @@ -37,7 +37,7 @@ public class ReactorDependencyXMLFilter extends AbstractEventXMLFilter // states private String state; - + // whiteSpace after , to be used to position private String dependencyWhitespace; @@ -62,7 +62,7 @@ public class ReactorDependencyXMLFilter extends AbstractEventXMLFilter { parsingDependency = true; } - + if ( parsingDependency ) { state = localName; @@ -123,7 +123,7 @@ public class ReactorDependencyXMLFilter extends AbstractEventXMLFilter } String versionQName = SAXEventUtils.renameQName( qName, "version" ); - + super.startElement( uri, "version", versionQName, null ); super.characters( version.toCharArray(), 0, version.length() ); super.endElement( uri, "version", versionQName ); @@ -131,23 +131,23 @@ public class ReactorDependencyXMLFilter extends AbstractEventXMLFilter } } super.executeEvents(); - + parsingDependency = false; - + // reset hasVersion = false; dependencyWhitespace = null; groupId = null; artifactId = null; - + break; - default: + default: break; } } super.endElement( uri, localName, qName ); - + state = ""; } @@ -167,5 +167,5 @@ public class ReactorDependencyXMLFilter extends AbstractEventXMLFilter { return state; } - + } diff --git a/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/RelativePathXMLFilter.java b/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/RelativePathXMLFilter.java index 23a03f110d..05506f12be 100644 --- a/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/RelativePathXMLFilter.java +++ b/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/RelativePathXMLFilter.java @@ -24,7 +24,7 @@ import org.xml.sax.SAXException; /** * Remove relativePath element, has no value for consumer pom - * + * * @author Robert Scholte * @since 4.0.0 */ @@ -32,9 +32,9 @@ class RelativePathXMLFilter extends AbstractEventXMLFilter { private boolean parsingParent; - + private String state; - + RelativePathXMLFilter() { super(); @@ -44,7 +44,7 @@ class RelativePathXMLFilter { super( parent ); } - + @Override public void startElement( String uri, final String localName, String qName, Attributes atts ) throws SAXException @@ -58,10 +58,10 @@ class RelativePathXMLFilter { state = localName; } - + super.startElement( uri, localName, qName, atts ); } - + @Override public void endElement( String uri, String localName, String qName ) throws SAXException @@ -72,14 +72,14 @@ class RelativePathXMLFilter { case "parent": executeEvents(); - + parsingParent = false; break; default: break; } } - + super.endElement( uri, localName, qName ); // for this simple structure resetting to parent it sufficient diff --git a/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/RelativeProject.java b/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/RelativeProject.java index bbfd7791be..26fe2cf6dd 100644 --- a/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/RelativeProject.java +++ b/maven-xml/src/main/java/org/apache/maven/xml/sax/filter/RelativeProject.java @@ -20,18 +20,18 @@ package org.apache.maven.xml.sax.filter; */ /** - * + * * @author Robert Scholte * @since 4.0.0 */ public class RelativeProject { private final String groupId; - + private final String artifactId; - + private final String version; - + public RelativeProject( String groupId, String artifactId, String version ) { this.groupId = groupId; @@ -43,12 +43,12 @@ public class RelativeProject { return groupId; } - + public String getArtifactId() { return artifactId; } - + public String getVersion() { return version; diff --git a/maven-xml/src/test/java/org/apache/maven/xml/sax/ChainedFilterTest.java b/maven-xml/src/test/java/org/apache/maven/xml/sax/ChainedFilterTest.java index 8ac2ca1626..47ac4562a1 100644 --- a/maven-xml/src/test/java/org/apache/maven/xml/sax/ChainedFilterTest.java +++ b/maven-xml/src/test/java/org/apache/maven/xml/sax/ChainedFilterTest.java @@ -40,7 +40,7 @@ import org.xml.sax.SAXException; /** * A small example of a pipeline of 2 XML Filters, to understand how to get the expected result - * + * * @author Robert Scholte * @since 4.0.0 */ @@ -64,10 +64,10 @@ public class ChainedFilterTest // Watch the order of filters! In reverse order the values would be 'AweSome' AbstractSAXFilter filter = new Awesome(); - + // AbstractSAXFilter doesn't have a constructor with XMLReader, otherwise the LexicalHandler pipeline will be broken filter.setParent( Factories.newXMLReader() ); - + // LexicalHandler of transformerResult must be the first filter transformResult.setLexicalHandler( filter ); diff --git a/maven-xml/src/test/java/org/apache/maven/xml/sax/ext/CommentRenormalizerTest.java b/maven-xml/src/test/java/org/apache/maven/xml/sax/ext/CommentRenormalizerTest.java index b6bc381c7b..c1885e216b 100644 --- a/maven-xml/src/test/java/org/apache/maven/xml/sax/ext/CommentRenormalizerTest.java +++ b/maven-xml/src/test/java/org/apache/maven/xml/sax/ext/CommentRenormalizerTest.java @@ -35,18 +35,18 @@ import org.xml.sax.ext.LexicalHandler; public class CommentRenormalizerTest { private LexicalHandler lexicalHandler; - + private final String lineSeparator; - + @Parameters public static Collection data() { - return Arrays.asList(new Object[][] { - { "\n" }, - { "\r\n" }, + return Arrays.asList(new Object[][] { + { "\n" }, + { "\r\n" }, { "\r" } }); } - + public CommentRenormalizerTest( String lineSeparator ) { this.lineSeparator = lineSeparator; @@ -65,7 +65,7 @@ public class CommentRenormalizerTest verify( lexicalHandler ).comment( ch, 0, ch.length ); } - + @Test public void multiLine() throws Exception diff --git a/maven-xml/src/test/java/org/apache/maven/xml/sax/filter/AbstractXMLFilterTests.java b/maven-xml/src/test/java/org/apache/maven/xml/sax/filter/AbstractXMLFilterTests.java index 862cb76385..d5281c7405 100644 --- a/maven-xml/src/test/java/org/apache/maven/xml/sax/filter/AbstractXMLFilterTests.java +++ b/maven-xml/src/test/java/org/apache/maven/xml/sax/filter/AbstractXMLFilterTests.java @@ -48,16 +48,16 @@ public abstract class AbstractXMLFilterTests { throw new UnsupportedOperationException( "Override one of the getFilter() methods" ); } - + protected AbstractSAXFilter getFilter( Consumer result ) throws TransformerException, SAXException, ParserConfigurationException { return getFilter(); } - + protected String omitXmlDeclaration() { return "yes"; } - + protected String indentAmount() { return null; } @@ -70,7 +70,7 @@ public abstract class AbstractXMLFilterTests /** * Use this method only for testing a single filter. - * + * * @param input * @param filter * @return @@ -78,14 +78,14 @@ public abstract class AbstractXMLFilterTests * @throws SAXException * @throws ParserConfigurationException */ - protected String transform( String input, AbstractSAXFilter filter ) + protected String transform( String input, AbstractSAXFilter filter ) throws TransformerException, SAXException, ParserConfigurationException { setParent( filter ); - + SAXTransformerFactory transformerFactory = (SAXTransformerFactory) Factories.newTransformerFactory(); TransformerHandler transformerHandler = transformerFactory.newTransformerHandler(); - + transformerHandler.getTransformer().setOutputProperty( OutputKeys.OMIT_XML_DECLARATION, omitXmlDeclaration() ); if ( indentAmount() != null ) { @@ -93,16 +93,16 @@ public abstract class AbstractXMLFilterTests transformerHandler.getTransformer().setOutputProperty( "{http://xml.apache.org/xslt}indent-amount", indentAmount() ); } - + Transformer transformer = transformerFactory.newTransformer(); - + Writer writer = new StringWriter(); StreamResult result = new StreamResult( writer ); transformerHandler.setResult( result ); SAXResult transformResult = new SAXResult( transformerHandler ); SAXSource transformSource = new SAXSource( filter, new InputSource( new StringReader( input ) ) ); - + transformResult.setLexicalHandler( filter ); transformer.transform( transformSource, transformResult ); @@ -115,7 +115,7 @@ public abstract class AbstractXMLFilterTests { SAXTransformerFactory transformerFactory = (SAXTransformerFactory) Factories.newTransformerFactory(); TransformerHandler transformerHandler = transformerFactory.newTransformerHandler(); - + transformerHandler.getTransformer().setOutputProperty( OutputKeys.OMIT_XML_DECLARATION, omitXmlDeclaration() ); if ( indentAmount() != null ) { @@ -123,7 +123,7 @@ public abstract class AbstractXMLFilterTests transformerHandler.getTransformer().setOutputProperty( "{http://xml.apache.org/xslt}indent-amount", indentAmount() ); } - + Transformer transformer = transformerFactory.newTransformer(); Writer writer = new StringWriter(); @@ -131,30 +131,30 @@ public abstract class AbstractXMLFilterTests transformerHandler.setResult( result ); SAXResult transformResult = new SAXResult( transformerHandler ); - + AbstractSAXFilter filter = getFilter( l -> transformResult.setLexicalHandler( l ) ); setParent( filter ); - + filter = new PerCharXMLFilter( filter ); filter.setLexicalHandler( transformerHandler ); - + SAXSource transformSource = new SAXSource( filter, new InputSource( input ) ); - + transformer.transform( transformSource, transformResult ); return writer.toString(); } - + private void setParent( AbstractSAXFilter filter ) throws SAXException, ParserConfigurationException { if( filter.getParent() == null ) { XMLReader r = Factories.newXMLReader(); - + AbstractSAXFilter perChar = new PerCharXMLFilter(); perChar.setParent( r ); - + filter.setParent( perChar ); filter.setFeature( "http://xml.org/sax/features/namespaces", true ); } @@ -162,11 +162,11 @@ public abstract class AbstractXMLFilterTests /** * From {@link ContentHandler} - * Your code should not assume that algorithms using char-at-a-time idioms will be working in characterunits; - * in some cases they will split characters. This is relevant wherever XML permits arbitrary characters, such as - * attribute values,processing instruction data, and comments as well as in data reported from this method. It's + * Your code should not assume that algorithms using char-at-a-time idioms will be working in characterunits; + * in some cases they will split characters. This is relevant wherever XML permits arbitrary characters, such as + * attribute values,processing instruction data, and comments as well as in data reported from this method. It's * also generally relevant whenever Java code manipulates internationalized text; the issue isn't unique to XML. - * + * * @author Robert Scholte */ class PerCharXMLFilter @@ -176,7 +176,7 @@ public abstract class AbstractXMLFilterTests { super(); } - + public PerCharXMLFilter( AbstractSAXFilter parent ) { super( parent ); @@ -191,7 +191,7 @@ public abstract class AbstractXMLFilterTests super.characters( ch, start + i, 1 ); } } - + @Override public void ignorableWhitespace( char[] ch, int start, int length ) throws SAXException diff --git a/maven-xml/src/test/java/org/apache/maven/xml/sax/filter/CiFriendlyXMLFilterTest.java b/maven-xml/src/test/java/org/apache/maven/xml/sax/filter/CiFriendlyXMLFilterTest.java index 7dcdc4f5d8..e51b76db35 100644 --- a/maven-xml/src/test/java/org/apache/maven/xml/sax/filter/CiFriendlyXMLFilterTest.java +++ b/maven-xml/src/test/java/org/apache/maven/xml/sax/filter/CiFriendlyXMLFilterTest.java @@ -31,14 +31,14 @@ import org.xml.sax.SAXException; public class CiFriendlyXMLFilterTest extends AbstractXMLFilterTests { private CiFriendlyXMLFilter filter; - + @Before public void setUp() { filter = new CiFriendlyXMLFilter( true ); filter.setChangelist( "CHANGELIST" ); } - + @Override protected AbstractSAXFilter getFilter() throws TransformerException, SAXException, ParserConfigurationException diff --git a/maven-xml/src/test/java/org/apache/maven/xml/sax/filter/ConsumerPomXMLFilterTest.java b/maven-xml/src/test/java/org/apache/maven/xml/sax/filter/ConsumerPomXMLFilterTest.java index 5ea73a4846..300246ae66 100644 --- a/maven-xml/src/test/java/org/apache/maven/xml/sax/filter/ConsumerPomXMLFilterTest.java +++ b/maven-xml/src/test/java/org/apache/maven/xml/sax/filter/ConsumerPomXMLFilterTest.java @@ -42,7 +42,7 @@ public class ConsumerPomXMLFilterTest extends AbstractXMLFilterTests { return "no"; } - + @Override protected AbstractSAXFilter getFilter( Consumer lexicalHandlerConsumer ) throws SAXException, ParserConfigurationException, TransformerConfigurationException @@ -54,7 +54,7 @@ public class ConsumerPomXMLFilterTest extends AbstractXMLFilterTests { return null; } - + @Override protected BiFunction getDependencyKeyToVersionMapper() { @@ -66,13 +66,13 @@ public class ConsumerPomXMLFilterTest extends AbstractXMLFilterTests { return Optional.empty(); } - + @Override protected Optional getRevision() { return Optional.empty(); } - + @Override protected Optional getChangelist() { @@ -86,7 +86,7 @@ public class ConsumerPomXMLFilterTest extends AbstractXMLFilterTests filter.setFeature( "http://xml.org/sax/features/namespaces", true ); return filter; } - + @Test public void aggregatorWithParent() throws Exception { String input = "\n" @@ -113,125 +113,125 @@ public class ConsumerPomXMLFilterTest extends AbstractXMLFilterTests String actual = transform( input ); assertThat( actual ).and( expected ).ignoreWhitespace().areIdentical(); } - + @Test public void aggregatorWithCliFriendlyVersion() throws Exception { - String input = "\n" + + String input = "\n" + "\n" + - " 4.0.0\n" + - " org.sonatype.mavenbook.multispring\n" + - " parent\n" + - " 0.9-${changelist}-SNAPSHOT\n" + - " pom\n" + - " Multi-Spring Chapter Parent Project\n" + - " \n" + - " simple-parent\n" + - " \n" + - " \n" + - " \n" + - " \n" + - " apache.snapshots\n" + - " http://repository.apache.org/snapshots/\n" + - " \n" + - " \n" + + " http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n" + + " 4.0.0\n" + + " org.sonatype.mavenbook.multispring\n" + + " parent\n" + + " 0.9-${changelist}-SNAPSHOT\n" + + " pom\n" + + " Multi-Spring Chapter Parent Project\n" + + " \n" + + " simple-parent\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " apache.snapshots\n" + + " http://repository.apache.org/snapshots/\n" + + " \n" + + " \n" + ""; - String expected = "\n" + + String expected = "\n" + "\n" + - " 4.0.0\n" + - " org.sonatype.mavenbook.multispring\n" + - " parent\n" + - " 0.9-CL-SNAPSHOT\n" + - " pom\n" + - " Multi-Spring Chapter Parent Project\n" + - " \n" + - " \n" + - " \n" + - " apache.snapshots\n" + - " http://repository.apache.org/snapshots/\n" + - " \n" + - " \n" + + " http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n" + + " 4.0.0\n" + + " org.sonatype.mavenbook.multispring\n" + + " parent\n" + + " 0.9-CL-SNAPSHOT\n" + + " pom\n" + + " Multi-Spring Chapter Parent Project\n" + + " \n" + + " \n" + + " \n" + + " apache.snapshots\n" + + " http://repository.apache.org/snapshots/\n" + + " \n" + + " \n" + ""; String actual = transform( input ); assertThat( actual ).and( expected ).ignoreWhitespace().areIdentical(); } - + @Test public void licenseHeader() throws Exception { - String input = "\n" + - "\n" + - "\n" + - "\n" + - "\n" + - " 4.0.0\n" + - " \n" + - " org.apache.maven\n" + - " maven\n" + - " 4.0.0-SNAPSHOT\n" + - " \n" + - " maven-xml\n" + - " Maven XML\n" + - " \n" + - " \n" + - " 1.8\n" + - " 1.8\n" + - " \n" + - "\n" + - " \n" + - " \n" + - " \n" + - " org.codehaus.mojo\n" + - " animal-sniffer-maven-plugin\n" + - " \n" + - " \n" + - " org.codehaus.mojo.signature\n" + - " java18\n" + - " 1.0\n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " javax.inject\n" + - " javax.inject\n" + - " true\n" + - " \n" + - " \n" + - " org.xmlunit\n" + - " xmlunit-assertj\n" + - " test\n" + - " \n" + - " \n" + + String input = "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + " 4.0.0\n" + + " \n" + + " org.apache.maven\n" + + " maven\n" + + " 4.0.0-SNAPSHOT\n" + + " \n" + + " maven-xml\n" + + " Maven XML\n" + + " \n" + + " \n" + + " 1.8\n" + + " 1.8\n" + + " \n" + + "\n" + + " \n" + + " \n" + + " \n" + + " org.codehaus.mojo\n" + + " animal-sniffer-maven-plugin\n" + + " \n" + + " \n" + + " org.codehaus.mojo.signature\n" + + " java18\n" + + " 1.0\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " javax.inject\n" + + " javax.inject\n" + + " true\n" + + " \n" + + " \n" + + " org.xmlunit\n" + + " xmlunit-assertj\n" + + " test\n" + + " \n" + + " \n" + ""; String expected = input; - + String actual = transform( input ); assertThat( actual ).and( expected ).areIdentical(); } diff --git a/maven-xml/src/test/java/org/apache/maven/xml/sax/filter/ModulesXMLFilterTest.java b/maven-xml/src/test/java/org/apache/maven/xml/sax/filter/ModulesXMLFilterTest.java index 103794c4aa..0306b943aa 100644 --- a/maven-xml/src/test/java/org/apache/maven/xml/sax/filter/ModulesXMLFilterTest.java +++ b/maven-xml/src/test/java/org/apache/maven/xml/sax/filter/ModulesXMLFilterTest.java @@ -65,7 +65,7 @@ public class ModulesXMLFilterTest extends AbstractXMLFilterTests { @Test public void comment() throws Exception { - + String input = "" + "" + "ab" diff --git a/maven-xml/src/test/java/org/apache/maven/xml/sax/filter/ReactorDependencyXMLFilterTest.java b/maven-xml/src/test/java/org/apache/maven/xml/sax/filter/ReactorDependencyXMLFilterTest.java index 49f7354898..21a1742699 100644 --- a/maven-xml/src/test/java/org/apache/maven/xml/sax/filter/ReactorDependencyXMLFilterTest.java +++ b/maven-xml/src/test/java/org/apache/maven/xml/sax/filter/ReactorDependencyXMLFilterTest.java @@ -49,9 +49,9 @@ public class ReactorDependencyXMLFilterTest extends AbstractXMLFilterTests + "VERSION" + ""; String expected = input; - + String actual = transform( input ); - + assertThat( actual ).isEqualTo( expected ); } @@ -59,15 +59,15 @@ public class ReactorDependencyXMLFilterTest extends AbstractXMLFilterTests public void testManagedDependency() throws Exception { ReactorDependencyXMLFilter filter = new ReactorDependencyXMLFilter( (g, a) -> null ); - + String input = "" + "GROUPID" + "ARTIFACTID" + ""; String expected = input; - + String actual = transform( input, filter ); - + assertThat( actual ).isEqualTo( expected ); } @@ -83,9 +83,9 @@ public class ReactorDependencyXMLFilterTest extends AbstractXMLFilterTests + "ARTIFACTID" + "1.0.0" + ""; - + String actual = transform( input ); - + assertThat( actual ).isEqualTo( expected ); } @@ -95,56 +95,56 @@ public class ReactorDependencyXMLFilterTest extends AbstractXMLFilterTests String input = "\n" + " GROUPID\n" + " ARTIFACTID\n" - + " " + + " " + ""; String expected = "\n" + " GROUPID\n" + " ARTIFACTID\n" - + " \n" + + " \n" + " 1.0.0\n" + ""; - + String actual = transform( input ); - + assertThat( actual ).and( expected ).ignoreWhitespace().areIdentical(); } @Test public void multipleDependencies() throws Exception { - String input = "\n" + - " 4.0.0\n" + - " tests.project\n" + - " duplicate-plugin-defs-merged\n" + - " 1\n" + - " \n" + - " \n" + - " \n" + - " maven-compiler-plugin\n" + - " \n" + - " \n" + - " group\n" + - " first\n" + - " 1\n" + - " \n" + - " \n" + - " \n" + - " \n" + - " maven-compiler-plugin\n" + - " \n" + - " \n" + - " group\n" + - " second\n" + - " 1\n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + + String input = "\n" + + " 4.0.0\n" + + " tests.project\n" + + " duplicate-plugin-defs-merged\n" + + " 1\n" + + " \n" + + " \n" + + " \n" + + " maven-compiler-plugin\n" + + " \n" + + " \n" + + " group\n" + + " first\n" + + " 1\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " maven-compiler-plugin\n" + + " \n" + + " \n" + + " group\n" + + " second\n" + + " 1\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + ""; String expected = input; - + String actual = transform( input ); - + assertThat( actual ).and( expected ).areIdentical(); } } diff --git a/maven-xml/src/test/java/org/apache/maven/xml/sax/filter/RelativePathXMLFilterTest.java b/maven-xml/src/test/java/org/apache/maven/xml/sax/filter/RelativePathXMLFilterTest.java index 00655b38f7..51ee41d215 100644 --- a/maven-xml/src/test/java/org/apache/maven/xml/sax/filter/RelativePathXMLFilterTest.java +++ b/maven-xml/src/test/java/org/apache/maven/xml/sax/filter/RelativePathXMLFilterTest.java @@ -31,7 +31,7 @@ public class RelativePathXMLFilterTest extends AbstractXMLFilterTests { return new RelativePathXMLFilter(); } - + @Test public void testRelativePath() throws Exception { @@ -55,12 +55,12 @@ public class RelativePathXMLFilterTest extends AbstractXMLFilterTests String actual = transform( input ); assertThat( actual ).and( expected ).areIdentical(); } - + @Test public void testRelativePathNS() throws Exception { - String input = "\n" + " \n" + " GROUPID\n" @@ -70,8 +70,8 @@ public class RelativePathXMLFilterTest extends AbstractXMLFilterTests + " \n" + " PROJECT\n" + ""; - String expected = "\n" + " \n" + " GROUPID\n" @@ -83,12 +83,12 @@ public class RelativePathXMLFilterTest extends AbstractXMLFilterTests String actual = transform( input ); assertThat( actual ).and( expected ).areIdentical(); } - + @Test public void testRelativePathPasNS() throws Exception { - String input = "\n" + " \n" + " GROUPID\n" @@ -98,8 +98,8 @@ public class RelativePathXMLFilterTest extends AbstractXMLFilterTests + " \n" + " PROJECT\n" + ""; - String expected = "\n" + " \n" + " GROUPID\n"