Skip to content

Commit

Permalink
Cleaned up some assignments, reformatted the code a little
Browse files Browse the repository at this point in the history
  • Loading branch information
pvince committed Nov 15, 2016
1 parent 993a44a commit 50137ff
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/main/java/hudson/scm/SurroundStep.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,17 @@ public class SurroundStep extends SCMStep {
@DataBoundConstructor
public SurroundStep(String sscm_url, String username, String password)
{
this.sscm_url = sscm_url;
this.username = username;
this.password = password;
this.sscm_url = Util.fixEmptyAndTrim(sscm_url);
this.username = Util.fixEmptyAndTrim(username);
this.password = Util.fixEmptyAndTrim(password);
this.RSAKeyFile = null;

}

@DataBoundSetter
public void setRSAKeyFile(String RSAKeyFile) { this.RSAKeyFile = Util.fixEmptyAndTrim(RSAKeyFile); }

@SuppressWarnings("unused")
@Deprecated
public SurroundStep(String sscm_url, String username, String password, String RSAKeyFile)
{
Expand All @@ -42,15 +46,14 @@ public SurroundStep(String sscm_url, String username, String password, String RS
@Nonnull
@Override
protected SCM createSCM() {
// Parse Server out of combined variable
// Parse Branch out of combined
// Parse Repository path

String server = SSCMUtils.getServerFromURL(sscm_url);
String port = SSCMUtils.getPortFromURL(sscm_url);
String branch = SSCMUtils.getBranchFromURL(sscm_url);
String repository = SSCMUtils.getRepositoryFromURL(sscm_url);
return new SurroundSCM(RSAKeyFile, server, port, username, password, branch, repository);

SurroundSCM sscm = new SurroundSCM(server, port, username, password, branch, repository);
sscm.setRsaKeyPath(RSAKeyFile);
return sscm;
}

public String getSscm_url() {
Expand All @@ -69,8 +72,6 @@ public String getRSAKeyFile() {
return RSAKeyFile;
}

@DataBoundSetter
public void setRSAKeyFile(String RSAKeyFile) { this.RSAKeyFile = Util.fixEmptyAndTrim(RSAKeyFile); }

@Extension
public static final class DescriptorImpl extends SCMStepDescriptor {
Expand Down

0 comments on commit 50137ff

Please sign in to comment.