@@ -52,7 +52,9 @@ public class StashRepository {
5252 private static final String BUILD_START_MESSAGE = "BuildStarted" ;
5353 private static final String BUILD_FINISH_MESSAGE = "BuildFinished" ;
5454 private static final String BUILD_CANCEL_MESSAGE = "BuildCanceled" ;
55- private static final String [] BUILD_STATUSES = {BUILD_START_MESSAGE , BUILD_FINISH_MESSAGE , BUILD_CANCEL_MESSAGE };
55+ private static final String [] BUILD_STATUSES = {
56+ BUILD_START_MESSAGE , BUILD_FINISH_MESSAGE , BUILD_CANCEL_MESSAGE
57+ };
5658 private static final String BUILD_MARKER = "[*%s* **%s**] %s into %s" ;
5759
5860 private static final String BUILD_STATUS_REGEX =
@@ -259,8 +261,10 @@ private List<StashPullRequestBuildTarget> getBuildTargetsWithoutOnlyBuildOnComme
259261
260262 // These will match any start or finish message -- need to check commits
261263 String escapedBuildName = Pattern .quote (job .getDisplayName ());
262- String project_build_start = String .format (BUILD_STATUS_REGEX , BUILD_START_MESSAGE , escapedBuildName );
263- String project_build_finished = String .format (BUILD_STATUS_REGEX , BUILD_FINISH_MESSAGE , escapedBuildName );
264+ String project_build_start =
265+ String .format (BUILD_STATUS_REGEX , BUILD_START_MESSAGE , escapedBuildName );
266+ String project_build_finished =
267+ String .format (BUILD_STATUS_REGEX , BUILD_FINISH_MESSAGE , escapedBuildName );
264268 Matcher startMatcher =
265269 Pattern .compile (project_build_start , Pattern .CASE_INSENSITIVE ).matcher (content );
266270 Matcher finishMatcher =
@@ -331,7 +335,8 @@ private String postBuildStatusComment(
331335 throws StashApiException {
332336 String sourceCommit = pullRequest .getFromRef ().getLatestCommit ();
333337 String destinationCommit = pullRequest .getToRef ().getLatestCommit ();
334- String comment = format (BUILD_MARKER , buildMessage , job .getDisplayName (), sourceCommit , destinationCommit );
338+ String comment =
339+ format (BUILD_MARKER , buildMessage , job .getDisplayName (), sourceCommit , destinationCommit );
335340 StashPullRequestComment commentResponse ;
336341 commentResponse =
337342 this .client .postPullRequestComment (pullRequest .getId (), comment , buildCommandCommentId );
@@ -579,17 +584,12 @@ public void postFinishedComment(
579584 String message = getMessageForBuildResult (buildResult );
580585 String comment =
581586 format (
582- BUILD_MARKER ,
583- BUILD_FINISH_MESSAGE ,
584- job .getDisplayName (),
585- sourceCommit ,
586- destinationCommit )
587- + format (
588- BUILD_FINISH_SENTENCE ,
589- message ,
590- buildUrl ,
591- buildNumber ,
592- duration );
587+ BUILD_MARKER ,
588+ BUILD_FINISH_MESSAGE ,
589+ job .getDisplayName (),
590+ sourceCommit ,
591+ destinationCommit )
592+ + format (BUILD_FINISH_SENTENCE , message , buildUrl , buildNumber , duration );
593593
594594 comment = comment .concat (additionalComment );
595595
@@ -684,7 +684,8 @@ private void deletePreviousBuildFinishedComments(StashPullRequestResponseValue p
684684 continue ;
685685 }
686686
687- String project_build_finished = format (BUILD_STATUS_REGEX , BUILD_FINISH_MESSAGE , job .getDisplayName ());
687+ String project_build_finished =
688+ format (BUILD_STATUS_REGEX , BUILD_FINISH_MESSAGE , job .getDisplayName ());
688689 Matcher finishMatcher =
689690 Pattern .compile (project_build_finished , Pattern .CASE_INSENSITIVE ).matcher (content );
690691
0 commit comments