@@ -52,7 +52,9 @@ public class StashRepository {
52
52
private static final String BUILD_START_MESSAGE = "BuildStarted" ;
53
53
private static final String BUILD_FINISH_MESSAGE = "BuildFinished" ;
54
54
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
+ };
56
58
private static final String BUILD_MARKER = "[*%s* **%s**] %s into %s" ;
57
59
58
60
private static final String BUILD_STATUS_REGEX =
@@ -259,8 +261,10 @@ private List<StashPullRequestBuildTarget> getBuildTargetsWithoutOnlyBuildOnComme
259
261
260
262
// These will match any start or finish message -- need to check commits
261
263
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 );
264
268
Matcher startMatcher =
265
269
Pattern .compile (project_build_start , Pattern .CASE_INSENSITIVE ).matcher (content );
266
270
Matcher finishMatcher =
@@ -331,7 +335,8 @@ private String postBuildStatusComment(
331
335
throws StashApiException {
332
336
String sourceCommit = pullRequest .getFromRef ().getLatestCommit ();
333
337
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 );
335
340
StashPullRequestComment commentResponse ;
336
341
commentResponse =
337
342
this .client .postPullRequestComment (pullRequest .getId (), comment , buildCommandCommentId );
@@ -579,17 +584,12 @@ public void postFinishedComment(
579
584
String message = getMessageForBuildResult (buildResult );
580
585
String comment =
581
586
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 );
593
593
594
594
comment = comment .concat (additionalComment );
595
595
@@ -684,7 +684,8 @@ private void deletePreviousBuildFinishedComments(StashPullRequestResponseValue p
684
684
continue ;
685
685
}
686
686
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 ());
688
689
Matcher finishMatcher =
689
690
Pattern .compile (project_build_finished , Pattern .CASE_INSENSITIVE ).matcher (content );
690
691
0 commit comments