Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removal of not needed calls to toString() in the code base #468

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -106,7 +106,7 @@ public void render()
try
{
pw = new PrintWriter( outputFileName, "UTF8" );
pw.print( sb.toString() );
pw.print( sb );
pw.close();
}
catch ( IOException e )
Expand Down
Expand Up @@ -434,7 +434,7 @@ private void logUpdates( Map<Dependency, ArtifactVersions> updates, String secti
latest = null;
}
}
String right = " " + ( latest == null ? current : current + " -> " + latest.toString() );
String right = " " + ( latest == null ? current : current + " -> " + latest );
List<String> t = latest == null ? usingCurrent : withUpdates;
if ( right.length() + left.length() + 3 > INFO_PAD_SIZE )
{
Expand Down
Expand Up @@ -121,7 +121,7 @@ public void execute()
buf.append( ' ' );
buf.append( currentVersion );
buf.append( " -> " );
buf.append( artifactVersion.toString() );
buf.append( artifactVersion );
logLine( false, buf.toString() );
}
}
Expand Down
Expand Up @@ -147,7 +147,7 @@ private void lockParentSnapshot( ModifiedPomXMLEventReader pom, MavenProject par
{
if ( PomHelper.setProjectParentVersion( pom, lockedParentVersion ) )
{
getLog().info( "Locked parent " + parentArtifact.toString() + " to version "
getLog().info( "Locked parent " + parentArtifact + " to version "
+ lockedParentVersion );
}
}
Expand Down
Expand Up @@ -95,7 +95,7 @@ public void render()
try
{
pw = new PrintWriter( outputFileName, "UTF8" );
pw.print( sb.toString() );
pw.print( sb );
pw.close();
}
catch ( IOException e )
Expand Down
Expand Up @@ -141,7 +141,7 @@ private void unlockParentSnapshot( ModifiedPomXMLEventReader pom, MavenProject p
String unlockedParentVersion = versionMatcher.replaceFirst( "-SNAPSHOT" );
if ( PomHelper.setProjectParentVersion( pom, unlockedParentVersion ) )
{
getLog().info( "Unlocked parent " + parentArtifact.toString() + " to version "
getLog().info( "Unlocked parent " + parentArtifact + " to version "
+ unlockedParentVersion );
}
}
Expand Down
Expand Up @@ -120,7 +120,7 @@ protected void update( ModifiedPomXMLEventReader pom )

if ( PomHelper.setProjectParentVersion( pom, artifactVersion.toString() ) )
{
getLog().debug( "Made an update from " + currentVersion + " to " + artifactVersion.toString() );
getLog().debug( "Made an update from " + currentVersion + " to " + artifactVersion );
}
}

Expand Down
Expand Up @@ -157,7 +157,7 @@ private void useLatestReleases( ModifiedPomXMLEventReader pom, Collection<Depend
}

ArtifactVersion selectedVersion = new DefaultArtifactVersion( version );
getLog().debug( "Selected version:" + selectedVersion.toString() );
getLog().debug( "Selected version: " + selectedVersion );

getLog().debug( "Looking for newer versions of " + toString( dep ) );
ArtifactVersions versions = getHelper().lookupArtifactVersions( artifact, false );
Expand All @@ -172,9 +172,9 @@ private void useLatestReleases( ModifiedPomXMLEventReader pom, Collection<Depend
{
if ( artifact.getId().equals( getProject().getParentArtifact().getId() ) && isProcessingParent() )
{
if ( PomHelper.setProjectParentVersion( pom, newVersion.toString() ) )
if ( PomHelper.setProjectParentVersion( pom, newVersion ) )
{
getLog().debug( "Made parent update from " + version + " to " + newVersion.toString() );
getLog().debug( "Made parent update from " + version + " to " + newVersion );
}
}
}
Expand Down
Expand Up @@ -183,7 +183,7 @@ private void useLatestSnapshots( ModifiedPomXMLEventReader pom, Collection<Depen
snapshotsOnly.add( artifactVersion );
}
}
getLog().debug("Snapshot Only versions " + snapshotsOnly);
getLog().debug( "Snapshot Only versions " + snapshotsOnly );

ArtifactVersion[] filteredVersions = majorMinorIncfilter.filter( selectedVersion,
(ArtifactVersion[]) snapshotsOnly.toArray(
Expand All @@ -200,7 +200,7 @@ private void useLatestSnapshots( ModifiedPomXMLEventReader pom, Collection<Depen
{
if ( PomHelper.setProjectParentVersion( pom, latestVersion ) )
{
getLog().debug( "Made parent update from " + version + " to " + latestVersion.toString() );
getLog().debug( "Made parent update from " + version + " to " + latestVersion );
}
}
}
Expand Down
Expand Up @@ -150,7 +150,7 @@ private void useLatestVersions( ModifiedPomXMLEventReader pom, Collection<Depend
}

ArtifactVersion selectedVersion = new DefaultArtifactVersion( version );
getLog().debug( "Selected version:" + selectedVersion.toString() );
getLog().debug( "Selected version:" + selectedVersion );

getLog().debug( "Looking for newer versions of " + toString( dep ) );
ArtifactVersions versions = getHelper().lookupArtifactVersions( artifact, false );
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/codehaus/mojo/versions/UseReleasesMojo.java
Expand Up @@ -174,7 +174,7 @@ else if ( failIfNotReplaced )
{
if ( PomHelper.setProjectParentVersion( pom, finalVersion.toString() ) )
{
getLog().info( "Updated " + toString( project ) + " to version " + finalVersion.toString() );
getLog().info( "Updated " + toString( project ) + " to version " + finalVersion );
}
}
else
Expand Down Expand Up @@ -255,7 +255,7 @@ private void rangeMatching( ModifiedPomXMLEventReader pom, Dependency dep, Strin
if ( PomHelper.setDependencyVersion( pom, dep.getGroupId(), dep.getArtifactId(), version,
finalVersion.toString(), getProject().getModel() ) )
{
getLog().info( "Updated " + toString( dep ) + " to version " + finalVersion.toString() );
getLog().info( "Updated " + toString( dep ) + " to version " + finalVersion );
}
}
else
Expand Down
Expand Up @@ -64,7 +64,7 @@ public void assertLater(String version, VersionComparator instance) {
int count = instance.getSegmentCount( v1 );
for (int i = 0; i < count; i++) {
ArtifactVersion v2 = instance.incrementSegment( v1, i );
assertTrue(v1.toString() + " < " + v2.toString(), instance.compare( v1, v2 ) < 0);
assertTrue(v1 + " < " + v2, instance.compare(v1, v2 ) < 0);
}
}
}