Repository: commons-release-plugin Updated Branches: refs/heads/master 7505912b8 -> c315ce0ce
use StringBuilder instead of StringBuffer for instances used on a single thread Project: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/commit/c315ce0c Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/c315ce0c Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/c315ce0c Branch: refs/heads/master Commit: c315ce0cee4f3477a9af1070f06b7285e1694c0a Parents: 7505912 Author: Matt Benson <mben...@apache.org> Authored: Wed Aug 29 15:34:20 2018 -0500 Committer: Matt Benson <mben...@apache.org> Committed: Wed Aug 29 15:34:20 2018 -0500 ---------------------------------------------------------------------- .../plugin/mojos/CommonsDistributionDetachmentMojo.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/c315ce0c/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetachmentMojo.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetachmentMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetachmentMojo.java index e569223..8528084 100755 --- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetachmentMojo.java +++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetachmentMojo.java @@ -241,13 +241,12 @@ public class CommonsDistributionDetachmentMojo extends AbstractMojo { * properly wrapped so that Maven can handle it. */ private void copyRemovedArtifactsToWorkingDirectory() throws MojoExecutionException { - StringBuffer copiedArtifactAbsolutePath; final String wdAbsolutePath = workingDirectory.getAbsolutePath(); getLog().info( "Copying " + detachedArtifacts.size() + " detached artifacts to working directory " + wdAbsolutePath); for (Artifact artifact: detachedArtifacts) { File artifactFile = artifact.getFile(); - copiedArtifactAbsolutePath = new StringBuffer(wdAbsolutePath); + StringBuilder copiedArtifactAbsolutePath = new StringBuilder(wdAbsolutePath); copiedArtifactAbsolutePath.append("/"); copiedArtifactAbsolutePath.append(artifactFile.getName()); File copiedArtifact = new File(copiedArtifactAbsolutePath.toString()); @@ -299,7 +298,7 @@ public class CommonsDistributionDetachmentMojo extends AbstractMojo { * @return a {@link String} that is the absolute path to the <code>.sha256</code> file. */ private String getSha256FilePath(File directory, File file) { - StringBuffer buffer = new StringBuffer(directory.getAbsolutePath()); + StringBuilder buffer = new StringBuilder(directory.getAbsolutePath()); buffer.append("/"); buffer.append(file.getName()); buffer.append(".sha256"); @@ -314,7 +313,7 @@ public class CommonsDistributionDetachmentMojo extends AbstractMojo { * @return a {@link String} that is the absolute path to the <code>.sha512</code> file. */ private String getSha512FilePath(File directory, File file) { - StringBuffer buffer = new StringBuffer(directory.getAbsolutePath()); + StringBuilder buffer = new StringBuilder(directory.getAbsolutePath()); buffer.append("/"); buffer.append(file.getName()); buffer.append(".sha512"); @@ -329,7 +328,7 @@ public class CommonsDistributionDetachmentMojo extends AbstractMojo { * @return the generated key */ private String getArtifactKey(Artifact artifact) { - StringBuffer artifactKey = new StringBuffer(); + StringBuilder artifactKey = new StringBuilder(); artifactKey.append(artifact.getArtifactId()).append('-') .append(artifact.getVersion()).append('-'); if (artifact.hasClassifier()) {