Skip to content

Commit

Permalink
Merge pull request #11 from vistaprint/master
Browse files Browse the repository at this point in the history
findbugs output
  • Loading branch information
badriance committed Aug 8, 2017
2 parents ec7bfd9 + 764b781 commit 6f86384
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ private DescriptorImpl getDescriptorImpl() {
return ((DescriptorImpl)getDescriptor());
}


/**
* Write the startup header for the logs to show what our inputs are.
* @param log The logger
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package hudson.plugins.octopusdeploy;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.Extension;
import hudson.model.Descriptor;
import hudson.util.FormValidation;
Expand Down Expand Up @@ -36,6 +37,7 @@ public static final class DescriptorImpl extends Descriptor<GlobalConfiguration>

/**
* Get the default OctopusDeployServer instance
* @return the default server
*/
public OctopusDeployServer getDefaultOctopusDeployServer() {

Expand Down Expand Up @@ -71,17 +73,18 @@ public DescriptorImpl() {
* Load legacy OctopusPlugin configuration format
*/
private void loadLegacyOctopusDeployServerConfig() {
if (isLegacyOctopusDeployServerExist()){
OctopusDeployServer server = new OctopusDeployServer("default",octopusHost,apiKey,true);
if (doesLegacyOctopusDeployServerExist()){
@SuppressFBWarnings(value = "UWF_UNWRITTEN_FIELD", justification = "This is for backwards compatiblity on Jenkins plugin upgrade" )
OctopusDeployServer server = new OctopusDeployServer("default", octopusHost, apiKey, true);
if(octopusDeployServers == null)
{
octopusDeployServers = new ArrayList<>();
}
octopusDeployServers.add(0,server);
octopusDeployServers.add(0, server);
}
}

private boolean isLegacyOctopusDeployServerExist() {
private boolean doesLegacyOctopusDeployServerExist() {
return octopusHost != null && apiKey !=null;
}

Expand Down Expand Up @@ -178,7 +181,6 @@ public boolean configure(StaplerRequest req, JSONObject formData) throws Descrip
}
setOctopusDeployServers(servers);


save();
return super.configure(req, formData);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
* @author wbenayed
*/
public class OctopusDeployServer implements Serializable {
// This value should be incremented every time that this serializable's contract changes
private static final long serialVersionUID = 1;

private final boolean isDefault;
public boolean isDefault() {
return isDefault;
Expand Down

0 comments on commit 6f86384

Please sign in to comment.