From 8125b3131f2e0f88837040b0baf4e0aaa8210679 Mon Sep 17 00:00:00 2001 From: Marc Wrobel Date: Mon, 18 Jul 2022 23:21:50 +0200 Subject: [PATCH] Fix typos in code Fix minor typos in code : - test method names, - method parameter names, - variable names. --- .../maven/repository/MetadataResolutionRequest.java | 4 ++-- .../legacy/DefaultUpdateCheckManagerTest.java | 4 ++-- maven-core/plugin-manager.txt | 2 +- .../maven/DefaultProjectDependenciesResolver.java | 4 ++-- .../apache/maven/ProjectDependenciesResolver.java | 12 ++++++------ .../maven/plugin/internal/MavenPluginValidator.java | 2 +- .../maven/project/artifact/MavenMetadataSource.java | 4 ++-- .../maven/lifecycle/LifecycleExecutorTest.java | 2 +- .../maven/lifecycle/MavenExecutionPlanTest.java | 8 ++++---- .../maven/lifecycle/internal/PhaseRecorderTest.java | 2 +- .../internal/builder/BuilderCommonTest.java | 2 +- .../stub/LifecycleExecutionPlanCalculatorStub.java | 4 ++-- .../stub/ProjectDependenciesResolverStub.java | 2 +- .../stub/ProjectDependencyGraphStubTest.java | 6 +++--- .../src/main/java/org/apache/maven/cli/MavenCli.java | 6 +++--- .../test/java/org/apache/maven/cli/MavenCliTest.java | 6 +++--- .../maven/model/building/FileModelSourceTest.java | 6 +++--- 17 files changed, 38 insertions(+), 38 deletions(-) diff --git a/maven-compat/src/main/java/org/apache/maven/repository/MetadataResolutionRequest.java b/maven-compat/src/main/java/org/apache/maven/repository/MetadataResolutionRequest.java index 75d9ddc264..ea0cd73431 100644 --- a/maven-compat/src/main/java/org/apache/maven/repository/MetadataResolutionRequest.java +++ b/maven-compat/src/main/java/org/apache/maven/repository/MetadataResolutionRequest.java @@ -126,9 +126,9 @@ public class MetadataResolutionRequest * @deprecated instead use {@link #setRemoteRepositories(List)} */ @Deprecated - public MetadataResolutionRequest setRemoteRepostories( List remoteRepostories ) + public MetadataResolutionRequest setRemoteRepostories( List remoteRepositories ) { - this.remoteRepositories = remoteRepostories; + this.remoteRepositories = remoteRepositories; return this; } diff --git a/maven-compat/src/test/java/org/apache/maven/repository/legacy/DefaultUpdateCheckManagerTest.java b/maven-compat/src/test/java/org/apache/maven/repository/legacy/DefaultUpdateCheckManagerTest.java index e826505124..85041ee435 100644 --- a/maven-compat/src/test/java/org/apache/maven/repository/legacy/DefaultUpdateCheckManagerTest.java +++ b/maven-compat/src/test/java/org/apache/maven/repository/legacy/DefaultUpdateCheckManagerTest.java @@ -240,14 +240,14 @@ public class DefaultUpdateCheckManagerTest { ArtifactRepository localRepository = localRepository(); - Artifact a = artifactFactory.createArtifactWithClassifier( "groupdId", "a", "0.0.1-SNAPSHOT", "jar", null ); + Artifact a = artifactFactory.createArtifactWithClassifier( "groupId", "a", "0.0.1-SNAPSHOT", "jar", null ); File file = new File( localRepository.getBasedir(), localRepository.pathOf( a ) ); a.setFile( file ); assertEquals( "a-0.0.1-SNAPSHOT.jar.lastUpdated", updateCheckManager.getTouchfile( a ).getName() ); - a = artifactFactory.createArtifactWithClassifier( "groupdId", "a", "0.0.1-SNAPSHOT", "jar", "classifier" ); + a = artifactFactory.createArtifactWithClassifier( "groupId", "a", "0.0.1-SNAPSHOT", "jar", "classifier" ); file = new File( localRepository.getBasedir(), localRepository.pathOf( a ) ); a.setFile( file ); diff --git a/maven-core/plugin-manager.txt b/maven-core/plugin-manager.txt index 37a9489a97..795494ce43 100644 --- a/maven-core/plugin-manager.txt +++ b/maven-core/plugin-manager.txt @@ -11,7 +11,7 @@ h3. Plugins * Maven test harness for plugin execution model * Eclipse IDE tooling for plugin execution model and metadata model -- we also seem to have information like the plugin lifecycle model that's burried inside the maven execution model +- we also seem to have information like the plugin lifecycle model that's buried inside the maven execution model - we also seem to have artifact information tangled inside the plugin model - we have to deal with scripting implementations (groovy, beanshell, ruby) - we need to deal with a shared context for plugins, like the guarded mojos 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 4402d7e0ed..41255e78de 100644 --- a/maven-core/src/main/java/org/apache/maven/DefaultProjectDependenciesResolver.java +++ b/maven-core/src/main/java/org/apache/maven/DefaultProjectDependenciesResolver.java @@ -93,11 +93,11 @@ public class DefaultProjectDependenciesResolver public Set resolve( MavenProject project, Collection scopesToCollect, Collection scopesToResolve, MavenSession session, - Set ignoreableArtifacts ) + Set ignorableArtifacts ) throws ArtifactResolutionException, ArtifactNotFoundException { return resolveImpl( Collections.singleton( project ), scopesToCollect, scopesToResolve, session, - getIgnorableArtifacts( ignoreableArtifacts ) ); + getIgnorableArtifacts( ignorableArtifacts ) ); } diff --git a/maven-core/src/main/java/org/apache/maven/ProjectDependenciesResolver.java b/maven-core/src/main/java/org/apache/maven/ProjectDependenciesResolver.java index 0d8a4c26f3..1537aa731d 100644 --- a/maven-core/src/main/java/org/apache/maven/ProjectDependenciesResolver.java +++ b/maven-core/src/main/java/org/apache/maven/ProjectDependenciesResolver.java @@ -69,17 +69,17 @@ public interface ProjectDependenciesResolver /** * Resolves the transitive dependencies of the specified project. * - * @param project The project whose dependencies should be resolved, must not be {@code null}. - * @param scopesToCollect The dependency scopes that should be collected, may be {@code null}. - * @param scopesToResolve The dependency scopes that should be collected and also resolved, may be {@code null}. - * @param session The current build session, must not be {@code null}. - * @param ignoreableArtifacts Artifacts that need not be resolved + * @param project The project whose dependencies should be resolved, must not be {@code null}. + * @param scopesToCollect The dependency scopes that should be collected, may be {@code null}. + * @param scopesToResolve The dependency scopes that should be collected and also resolved, may be {@code null}. + * @param session The current build session, must not be {@code null}. + * @param ignorableArtifacts Artifacts that need not be resolved * @return The transitive dependencies of the specified project that match the requested scopes, never {@code null}. * @throws ArtifactResolutionException in case of resolution issue * @throws ArtifactNotFoundException if an artifact is not found */ Set resolve( MavenProject project, Collection scopesToCollect, - Collection scopesToResolve, MavenSession session, Set ignoreableArtifacts ) + Collection scopesToResolve, MavenSession session, Set ignorableArtifacts ) throws ArtifactResolutionException, ArtifactNotFoundException; /** diff --git a/maven-core/src/main/java/org/apache/maven/plugin/internal/MavenPluginValidator.java b/maven-core/src/main/java/org/apache/maven/plugin/internal/MavenPluginValidator.java index 435e06e1b9..2e36b4b6aa 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/internal/MavenPluginValidator.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/internal/MavenPluginValidator.java @@ -29,6 +29,6 @@ import org.apache.maven.plugin.descriptor.PluginDescriptor; interface MavenPluginValidator { - void validate( Artifact pluginArtfiact, PluginDescriptor pluginDescriptor, List errors ); + void validate( Artifact pluginArtifact, PluginDescriptor pluginDescriptor, List errors ); } diff --git a/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java b/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java index baf5e7c850..b55110a840 100644 --- a/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java +++ b/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java @@ -592,7 +592,7 @@ public class MavenMetadataSource { message = "Missing POM for " + artifact.getId(); } - else if ( isNonTransferrablePom( e ) ) + else if ( isNonTransferablePom( e ) ) { throw new ArtifactMetadataRetrievalException( "Failed to retrieve POM for " + artifact.getId() + ": " + e.getCause().getMessage(), e.getCause(), @@ -736,7 +736,7 @@ public class MavenMetadataSource && e.getCause().getCause() instanceof ArtifactNotFoundException; } - private boolean isNonTransferrablePom( Exception e ) + private boolean isNonTransferablePom( Exception e ) { if ( e.getCause() instanceof ArtifactResolutionException ) { diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorTest.java b/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorTest.java index 6a112e8dbe..4daf735b27 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorTest.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorTest.java @@ -346,7 +346,7 @@ public class LifecycleExecutorTest // Prefixes @Test - public void testFindingPluginPrefixforCleanClean() + public void testFindingPluginPrefixForCleanClean() throws Exception { File pom = getProject( "project-basic" ); diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/MavenExecutionPlanTest.java b/maven-core/src/test/java/org/apache/maven/lifecycle/MavenExecutionPlanTest.java index e077dc9986..179dfe0719 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/MavenExecutionPlanTest.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/MavenExecutionPlanTest.java @@ -36,7 +36,7 @@ public class MavenExecutionPlanTest public void testFindLastInPhase() throws Exception { - MavenExecutionPlan plan = LifecycleExecutionPlanCalculatorStub.getProjectAExceutionPlan(); + MavenExecutionPlan plan = LifecycleExecutionPlanCalculatorStub.getProjectAExecutionPlan(); ExecutionPlanItem expected = plan.findLastInPhase( "package" ); ExecutionPlanItem beerPhase = plan.findLastInPhase( "BEER" ); // Beer comes straight after package in stub @@ -48,7 +48,7 @@ public class MavenExecutionPlanTest public void testThreadSafeMojos() throws Exception { - MavenExecutionPlan plan = LifecycleExecutionPlanCalculatorStub.getProjectAExceutionPlan(); + MavenExecutionPlan plan = LifecycleExecutionPlanCalculatorStub.getProjectAExecutionPlan(); final Set unSafePlugins = plan.getNonThreadSafePlugins(); // There is only a single threadsafe plugin here... assertEquals( plan.size() - 1, unSafePlugins.size() ); @@ -60,7 +60,7 @@ public class MavenExecutionPlanTest public void testFindLastWhenFirst() throws Exception { - MavenExecutionPlan plan = LifecycleExecutionPlanCalculatorStub.getProjectAExceutionPlan(); + MavenExecutionPlan plan = LifecycleExecutionPlanCalculatorStub.getProjectAExecutionPlan(); ExecutionPlanItem beerPhase = plan.findLastInPhase( LifecycleExecutionPlanCalculatorStub.VALIDATE.getPhase() ); // Beer comes straight after package in stub @@ -71,7 +71,7 @@ public class MavenExecutionPlanTest public void testFindLastInPhaseMisc() throws Exception { - MavenExecutionPlan plan = LifecycleExecutionPlanCalculatorStub.getProjectAExceutionPlan(); + MavenExecutionPlan plan = LifecycleExecutionPlanCalculatorStub.getProjectAExecutionPlan(); assertNull( plan.findLastInPhase( "pacXkage" ) ); // Beer comes straight after package in stub, much like real life. diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/PhaseRecorderTest.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/PhaseRecorderTest.java index 1d0211f225..f995d56e42 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/PhaseRecorderTest.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/PhaseRecorderTest.java @@ -34,7 +34,7 @@ public class PhaseRecorderTest @Test public void testObserveExecution() throws Exception { PhaseRecorder phaseRecorder = new PhaseRecorder( ProjectDependencyGraphStub.A); - MavenExecutionPlan plan = LifecycleExecutionPlanCalculatorStub.getProjectAExceutionPlan(); + MavenExecutionPlan plan = LifecycleExecutionPlanCalculatorStub.getProjectAExecutionPlan(); final List executions = plan.getMojoExecutions(); final MojoExecution mojoExecution1 = executions.get( 0 ); diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/builder/BuilderCommonTest.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/builder/BuilderCommonTest.java index e64d2f004f..edb0892533 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/builder/BuilderCommonTest.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/builder/BuilderCommonTest.java @@ -52,7 +52,7 @@ public class BuilderCommonTest final MavenExecutionPlan plan = builderCommon.resolveBuildPlan( session1, ProjectDependencyGraphStub.A, taskSegment1, new HashSet<>() ); - assertEquals( LifecycleExecutionPlanCalculatorStub.getProjectAExceutionPlan().size(), plan.size() ); + assertEquals( LifecycleExecutionPlanCalculatorStub.getProjectAExecutionPlan().size(), plan.size() ); } @Test 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 0357071715..f7514b788b 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 @@ -137,7 +137,7 @@ public class LifecycleExecutionPlanCalculatorStub { if ( project.equals( ProjectDependencyGraphStub.A ) ) { - return getProjectAExceutionPlan(); + return getProjectAExecutionPlan(); } if ( project.equals( ProjectDependencyGraphStub.B ) ) { @@ -165,7 +165,7 @@ public class LifecycleExecutionPlanCalculatorStub { } - public static MavenExecutionPlan getProjectAExceutionPlan() + public static MavenExecutionPlan getProjectAExecutionPlan() throws PluginNotFoundException, PluginResolutionException, LifecyclePhaseNotFoundException, PluginDescriptorParsingException, MojoNotFoundException, InvalidPluginDescriptorException, NoPluginFoundForPrefixException, LifecycleNotFoundException, PluginVersionResolutionException diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependenciesResolverStub.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependenciesResolverStub.java index 8d01bc1759..8a557d554f 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependenciesResolverStub.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependenciesResolverStub.java @@ -62,7 +62,7 @@ public class ProjectDependenciesResolverStub public Set resolve( MavenProject project, Collection scopesToCollect, Collection scopesToResolve, MavenSession session, - Set ignoreableArtifacts ) + Set ignorableArtifacts ) throws ArtifactResolutionException, ArtifactNotFoundException { return new HashSet<>(); diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependencyGraphStubTest.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependencyGraphStubTest.java index cd2d327a13..56283ad94f 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependencyGraphStubTest.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependencyGraphStubTest.java @@ -41,7 +41,7 @@ public class ProjectDependencyGraphStubTest } @Test - public void testBDepenencies() + public void testBDependencies() { final List bProjects = stub.getUpstreamProjects( ProjectDependencyGraphStub.B, false ); assertEquals( 1, bProjects.size() ); @@ -49,7 +49,7 @@ public class ProjectDependencyGraphStubTest } @Test - public void testCDepenencies() + public void testCDependencies() { final List cProjects = stub.getUpstreamProjects( ProjectDependencyGraphStub.C, false ); assertEquals( 1, cProjects.size() ); @@ -57,7 +57,7 @@ public class ProjectDependencyGraphStubTest } @Test - public void testXDepenencies() + public void testXDependencies() { final List cProjects = stub.getUpstreamProjects( ProjectDependencyGraphStub.X, false ); assertEquals( 2, cProjects.size() ); diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java index 0ac2cc95e0..598dcaa04e 100644 --- a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java +++ b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java @@ -404,10 +404,10 @@ public class MavenCli } mavenConfig = cliManager.parse( args.toArray( new String[0] ) ); - List unrecongized = mavenConfig.getArgList(); - if ( !unrecongized.isEmpty() ) + List unrecognized = mavenConfig.getArgList(); + if ( !unrecognized.isEmpty() ) { - throw new ParseException( "Unrecognized maven.config entries: " + unrecongized ); + throw new ParseException( "Unrecognized maven.config entries: " + unrecognized ); } } } diff --git a/maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java b/maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java index 5c2132f5ab..c4ddcb830a 100644 --- a/maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java +++ b/maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java @@ -424,9 +424,9 @@ public class MavenCliTest customizedMavenCli.container(cliRequest); customizedMavenCli.toolchains(cliRequest); - InOrder orderdEventSpyDispatcherMock = inOrder(eventSpyDispatcherMock); - orderdEventSpyDispatcherMock.verify(eventSpyDispatcherMock, times(1)).onEvent(any(ToolchainsBuildingRequest.class)); - orderdEventSpyDispatcherMock.verify(eventSpyDispatcherMock, times(1)).onEvent(any(ToolchainsBuildingResult.class)); + InOrder orderedEventSpyDispatcherMock = inOrder(eventSpyDispatcherMock); + orderedEventSpyDispatcherMock.verify(eventSpyDispatcherMock, times(1)).onEvent(any(ToolchainsBuildingRequest.class)); + orderedEventSpyDispatcherMock.verify(eventSpyDispatcherMock, times(1)).onEvent(any(ToolchainsBuildingResult.class)); } @Test 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 1f6144154a..8206cee973 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 @@ -63,10 +63,10 @@ public class FileModelSourceTest String absolutePath = upperCaseFile.getAbsolutePath(); File lowerCaseFile = new File( absolutePath.toLowerCase() ); - FileModelSource upperCaseFileSouce = new FileModelSource( upperCaseFile ); - FileModelSource lowerCaseFileSouce = new FileModelSource( lowerCaseFile ); + FileModelSource upperCaseFileSource = new FileModelSource( upperCaseFile ); + FileModelSource lowerCaseFileSource = new FileModelSource( lowerCaseFile ); - assertTrue( upperCaseFileSouce.equals( lowerCaseFileSouce ) ); + assertTrue( upperCaseFileSource.equals( lowerCaseFileSource ) ); } private File createTempFile( String name ) throws IOException