Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use StringBuilder properly in getOpenLink

Inefficient use of concatenated strings with String builder when creating the link to the build job.
  • Loading branch information...
commit 91c54893e47fe5fa8c12261889478f96846eb71c 1 parent 16f705c
@marcins authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/main/java/jenkins/plugins/hipchat/ActiveNotifier.java
View
7 src/main/java/jenkins/plugins/hipchat/ActiveNotifier.java
@@ -191,7 +191,10 @@ private String getStatusMessage(AbstractBuild r) {
private String getOpenLink(AbstractBuild build)
{
- String url = notifier.getBuildServerUrl() + build.getUrl();
- return new StringBuilder("(<a href='").append(url).append("'>Open</a>)").toString();
+ StringBuilder builder = new StringBuilder("(<a href='");
+ builder.append(notifier.getBuildServerUrl());
+ builder.append(build.getUrl());
+ builder.append("'>Open</a>)");
+ return builder.toString();
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.