Skip to content

Commit

Permalink
Remove unused formal parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
pzygielo committed Dec 12, 2021
1 parent cb55288 commit fa6d15f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ private void transformDocument( MavenProject project, Model modelTarget, Release

String projectId = ArtifactUtils.versionlessKey( project.getGroupId(), project.getArtifactId() );

rewriteVersion( modelTarget, releaseDescriptor, projectId, project, parentVersion );
rewriteVersion( modelTarget, releaseDescriptor, projectId, project );

Build buildTarget = modelTarget.getBuild();
if ( buildTarget != null )
Expand Down Expand Up @@ -400,7 +400,7 @@ else if ( buildOutputTimestamp.length() <= 1 )
}

private void rewriteVersion( Model modelTarget, ReleaseDescriptor releaseDescriptor, String projectId,
MavenProject project, String parentVersion )
MavenProject project )
throws ReleaseFailureException
{
String version = getNextVersion( releaseDescriptor, projectId );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,22 +134,20 @@ private void generateReleasePoms( ReleaseDescriptor releaseDescriptor, ReleaseEn
{
logInfo( result, "Generating release POM for '" + project.getName() + "'..." );

releasePoms.add( generateReleasePom( project, releaseDescriptor, releaseEnvironment, reactorProjects,
simulate, result ) );
releasePoms.add( generateReleasePom( project, releaseDescriptor, releaseEnvironment, result ) );
}

addReleasePomsToScm( releaseDescriptor, releaseEnvironment, reactorProjects, simulate, result, releasePoms );
}

private File generateReleasePom( MavenProject project, ReleaseDescriptor releaseDescriptor,
ReleaseEnvironment releaseEnvironment, List<MavenProject> reactorProjects,
boolean simulate, ReleaseResult result )
ReleaseEnvironment releaseEnvironment,
ReleaseResult result )
throws ReleaseExecutionException, ReleaseFailureException
{
// create release pom

Model releasePom = createReleaseModel( project, releaseDescriptor, releaseEnvironment, reactorProjects,
result );
Model releasePom = createReleaseModel( project, releaseDescriptor, releaseEnvironment, result );

// write release pom to file

Expand Down Expand Up @@ -212,7 +210,7 @@ private void addReleasePomsToScm( ReleaseDescriptor releaseDescriptor, ReleaseEn
}

private Model createReleaseModel( MavenProject project, ReleaseDescriptor releaseDescriptor,
ReleaseEnvironment releaseEnvironment, List<MavenProject> reactorProjects,
ReleaseEnvironment releaseEnvironment,
ReleaseResult result )
throws ReleaseFailureException, ReleaseExecutionException
{
Expand All @@ -229,7 +227,7 @@ private Model createReleaseModel( MavenProject project, ReleaseDescriptor releas
// update project version
String projectVersion = releaseModel.getVersion();
String releaseVersion =
getNextVersion( releaseDescriptor, project.getGroupId(), project.getArtifactId(), projectVersion );
getNextVersion( releaseDescriptor, project.getGroupId(), project.getArtifactId() );
releaseModel.setVersion( releaseVersion );

String originalFinalName = releaseModel.getBuild().getFinalName();
Expand Down Expand Up @@ -416,8 +414,7 @@ public ReleaseResult simulate( ReleaseDescriptor releaseDescriptor, ReleaseEnvir
return execute( releaseDescriptor, releaseEnvironment, reactorProjects, true );
}

private String getNextVersion( ReleaseDescriptor releaseDescriptor, String groupId, String artifactId,
String version )
private String getNextVersion( ReleaseDescriptor releaseDescriptor, String groupId, String artifactId )
throws ReleaseFailureException
{
// TODO: share with RewritePomsForReleasePhase.rewriteVersion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public ReleaseResult execute( ReleaseDescriptor releaseDescriptor, ReleaseEnviro

String projectId = ArtifactUtils.versionlessKey( project.getGroupId(), project.getArtifactId() );

String nextVersion = resolveNextVersion( project, projectId, releaseDescriptor, result );
String nextVersion = resolveNextVersion( project, projectId, releaseDescriptor );

if ( !convertToSnapshot )
{
Expand Down Expand Up @@ -169,7 +169,7 @@ else if ( releaseDescriptor.isBranchCreation() && convertToBranch )
{
String projectId = ArtifactUtils.versionlessKey( project.getGroupId(), project.getArtifactId() );

String nextVersion = resolveNextVersion( project, projectId, releaseDescriptor, result );
String nextVersion = resolveNextVersion( project, projectId, releaseDescriptor );

if ( !convertToSnapshot )
{
Expand All @@ -193,8 +193,7 @@ else if ( releaseDescriptor.isBranchCreation() && convertToBranch )

private String resolveNextVersion( MavenProject project,
String projectId,
ReleaseDescriptor releaseDescriptor,
ReleaseResult result )
ReleaseDescriptor releaseDescriptor )
throws ReleaseExecutionException
{
String defaultVersion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ public ReleaseResult execute( ReleaseDescriptor releaseDescriptor, ReleaseEnviro
List<MavenProject> reactorProjects )
throws ReleaseExecutionException
{
return runLogic( releaseDescriptor, releaseEnvironment, reactorProjects, false );
return runLogic( releaseDescriptor, releaseEnvironment, false );
}

private ReleaseResult runLogic( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment,
List<MavenProject> reactorProjects, boolean simulate )
boolean simulate )
throws ReleaseExecutionException
{
String additionalArguments = getAdditionalArguments( releaseDescriptor );
Expand Down Expand Up @@ -134,7 +134,7 @@ public ReleaseResult simulate( ReleaseDescriptor releaseDescriptor, ReleaseEnvir
List<MavenProject> reactorProjects )
throws ReleaseExecutionException
{
return runLogic( releaseDescriptor, releaseEnvironment, reactorProjects, true );
return runLogic( releaseDescriptor, releaseEnvironment, true );
}

@Override
Expand Down

0 comments on commit fa6d15f

Please sign in to comment.