Skip to content

Commit

Permalink
fixed some sonar-issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dhinske committed May 2, 2016
1 parent 608ee3e commit c35d7e6
Showing 1 changed file with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;
//import java.util.logging.Logger;

import javax.servlet.ServletException;

Expand All @@ -45,7 +45,7 @@
@ExportedBean
public class GlobalBuildStatsPlugin extends Plugin {

private static final Logger LOGGER = Logger.getLogger(GlobalBuildStatsPlugin.class.getName());
// private static final Logger LOGGER = Logger.getLogger(GlobalBuildStatsPlugin.class.getName());

/**
* List of aggregated job build results
Expand All @@ -60,7 +60,7 @@ public class GlobalBuildStatsPlugin extends Plugin {
* @deprecated Use jobBuildResultsSharder instead of jobBuildResults (since v8 file format)
*/
@Deprecated
transient private List<JobBuildResult> jobBuildResults = new ArrayList<JobBuildResult>();
private transient List<JobBuildResult> jobBuildResults = new ArrayList<JobBuildResult>();

/**
* List of persisted build statistics configurations used on the
Expand All @@ -76,12 +76,12 @@ public class GlobalBuildStatsPlugin extends Plugin {
/**
* Business layer for global build stats
*/
transient private final GlobalBuildStatsBusiness business = new GlobalBuildStatsBusiness(this);
private transient final GlobalBuildStatsBusiness business = new GlobalBuildStatsBusiness(this);

/**
* Validator layer for global build stats
*/
transient private final GlobalBuildStatsValidator validator = new GlobalBuildStatsValidator();
private transient final GlobalBuildStatsValidator validator = new GlobalBuildStatsValidator();

/**
* Expose {@link GlobalBuildStatsPlugin} to the remote API :
Expand All @@ -95,6 +95,7 @@ public Api getApi() {
/**
* Highered visibility of load method
*/
@Override
public void load() throws IOException {
super.load();
}
Expand Down Expand Up @@ -127,7 +128,7 @@ public void doPython(StaplerRequest req, StaplerResponse rsp)
}
}

private boolean exposeChartData(StaplerRequest req, StaplerResponse rsp, Flavor flavor) throws ServletException, IOException{
private static boolean exposeChartData(StaplerRequest req, StaplerResponse rsp, Flavor flavor) throws ServletException, IOException{
boolean chartDataHasBeenExposed = false;
String buildStatConfigId = req.getParameter("buildStatConfigId");
if(buildStatConfigId != null){
Expand Down Expand Up @@ -164,14 +165,17 @@ public void onLoaded() {
@Extension
public static class GlobalBuildStatsManagementLink extends ManagementLink {

@Override
public String getIconFileName() {
return "/plugin/global-build-stats/icons/global-build-stats.png";
}

@Override
public String getDisplayName() {
return Messages.Global_Builds_Stats();
}

@Override
public String getUrlName() {
return "plugin/global-build-stats/";
}
Expand Down Expand Up @@ -273,6 +277,7 @@ public HttpResponse doRecordBuildInfos() throws IOException {
business.recordBuildInfos();

return new HttpResponse() {
@Override
public void generateResponse(StaplerRequest req, StaplerResponse rsp,
Object node) throws IOException, ServletException {
}
Expand Down Expand Up @@ -304,7 +309,7 @@ public void doCreateChartMap(StaplerRequest req, StaplerResponse res) throws Ser
Hudson.getInstance().checkPermission(getRequiredPermission());

String buildStatId = req.getParameter("buildStatId");
BuildStatConfiguration config = null;
BuildStatConfiguration config;
if(buildStatId != null){
config = business.searchBuildStatConfigById(buildStatId);
} else {
Expand All @@ -331,7 +336,7 @@ public void doBuildHistory(StaplerRequest req, StaplerResponse res) throws Servl
public void doUpdateBuildStatConfiguration(StaplerRequest req, StaplerResponse res) throws ServletException, IOException {
Hudson.getInstance().checkPermission(getRequiredPermission());

boolean regenerateId = Boolean.valueOf(req.getParameter("regenerateId")).booleanValue();
boolean regenerateId = Boolean.parseBoolean(req.getParameter("regenerateId"));

BuildStatConfiguration config = FromRequestObjectFactory.createBuildStatConfiguration(req.getParameter("buildStatId"), req);
business.updateBuildStatConfiguration(req.getParameter("buildStatId"), config, regenerateId);
Expand Down

0 comments on commit c35d7e6

Please sign in to comment.