Skip to content

Commit

Permalink
JENKINS-28590 Fixed few checkstyle errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Bue Petersen committed Jun 29, 2015
1 parent 79f125e commit 8702ef4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,16 @@ public class AccumulatedCommitStrategy extends IntegrationStrategy {
private static final String B_NAME = "Accumulated commit";
private static final Logger logger = Logger.getLogger(AccumulatedCommitStrategy.class.getName());
private static final String LOG_PREFIX = "[PREINT] ";
private static final int unLikelyExitCode = -999; // An very unlikely exit code, that we use as default

@DataBoundConstructor
public AccumulatedCommitStrategy() { }

@Override
public void integrate(AbstractBuild<?,?> build, Launcher launcher, BuildListener listener, AbstractSCMBridge bridge) throws IntegationFailedExeception, NothingToDoException, UnsupportedConfigurationException {
logger.entering("AccumulatedCommitStrategy", "integrate", new Object[] { build, listener, bridge, launcher });// Generated code DONT TOUCH! Bookmark: ee74dbf7df6fa51582ccc15f5fee72da
int exitCodeMerge = -999;
int exitCodeCommit = -999;
int exitCodeMerge = unLikelyExitCode;
int exitCodeCommit = unLikelyExitCode;

GitClient client;

Expand Down Expand Up @@ -162,8 +163,7 @@ public void integrate(AbstractBuild<?,?> build, Launcher launcher, BuildListener
listener.getLogger().println(String.format(LOG_PREFIX + "Merge was successful"));


try
{
try {
logger.info("Starting to commit accumulated merge changes:");
listener.getLogger().println(String.format(LOG_PREFIX + "Starting to commit accumulated merge changes:"));
exitCodeCommit = gitbridge.git(build, launcher, listener, out, "commit", "--no-edit", "--author=" + commitAuthor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public class GitBridge extends AbstractSCMBridge {

private String revId;
private String repoName;
private static final int unLikelyExitCode = -999; // An very unlikely exit code, that we use as default


@DataBoundConstructor
public GitBridge(IntegrationStrategy integrationStrategy, final String branch, String repoName) {
Expand Down Expand Up @@ -368,7 +370,7 @@ public void deleteIntegratedBranch(AbstractBuild<?, ?> build, Launcher launcher,
//At this point in time the lastBuild is also the latests. So thats what we use
Branch gitDataBranch = gitBuildData.lastBuild.revision.getBranches().iterator().next();
ByteArrayOutputStream out = new ByteArrayOutputStream();
int delRemote = -99999;
int delRemote = unLikelyExitCode;

if(build.getResult().isBetterOrEqualTo(getRequiredResult())) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,17 @@ public class SquashCommitStrategy extends IntegrationStrategy {
private static final String B_NAME = "Squashed commit";
private static final Logger logger = Logger.getLogger(SquashCommitStrategy.class.getName());
private static final String LOG_PREFIX = "[PREINT] ";
private static final int unLikelyExitCode = -999; // An very unlikely exit code, that we use as default


@DataBoundConstructor
public SquashCommitStrategy() { }

@Override
public void integrate(AbstractBuild<?,?> build, Launcher launcher, BuildListener listener, AbstractSCMBridge bridge) throws IntegationFailedExeception, NothingToDoException, UnsupportedConfigurationException {
logger.entering("SquashCommitStrategy", "integrate", new Object[]{build, listener, bridge, launcher});// Generated code DONT TOUCH! Bookmark: 36174744d49c892c3aeed5e2bc933991
int exitCodeMerge = -999;
int exitCodeCommit = -999;
int exitCodeMerge = unLikelyExitCode;
int exitCodeCommit = unLikelyExitCode;
GitBridge gitbridge = (GitBridge) bridge;


Expand Down Expand Up @@ -160,8 +162,7 @@ public void integrate(AbstractBuild<?,?> build, Launcher launcher, BuildListener
listener.getLogger().println(String.format(LOG_PREFIX + "Merge was successful"));


try
{
try {
logger.info("Starting to commit squash merge changes:");
listener.getLogger().println(String.format(LOG_PREFIX + "Starting to commit squash merge changes:"));
exitCodeCommit = gitbridge.git(build, launcher, listener, out, "commit", "--no-edit", "--author=" + commitAuthor);
Expand Down

0 comments on commit 8702ef4

Please sign in to comment.