From 94089b77f4417bcd3756f4ea4cb52eca80e3cfb3 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Lievremont Date: Mon, 3 Feb 2014 16:55:19 +0100 Subject: [PATCH] Fix quality flaws --- .../java/org/sonar/server/qualityprofile/ESActiveRule.java | 4 ++-- sonar-server/src/main/webapp/javascripts/resource.js | 6 ++++-- .../sonar/wsclient/rule/internal/DefaultRuleTagClient.java | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/sonar-server/src/main/java/org/sonar/server/qualityprofile/ESActiveRule.java b/sonar-server/src/main/java/org/sonar/server/qualityprofile/ESActiveRule.java index 3ee7b23f0df..4a1b9042e10 100644 --- a/sonar-server/src/main/java/org/sonar/server/qualityprofile/ESActiveRule.java +++ b/sonar-server/src/main/java/org/sonar/server/qualityprofile/ESActiveRule.java @@ -136,13 +136,13 @@ public class ESActiveRule { } catch (IOException e) { bulkWatch.stop("Failed to indes active rules"); throw new IllegalStateException("Unable to index active rules", e); - } finally { } } public void save(ActiveRuleDto activeRule, Collection params) { try { - esIndex.putSynchronous(RuleRegistry.INDEX_RULES, ESActiveRule.TYPE_ACTIVE_RULE, Long.toString(activeRule.getId()), activeRuleDocument(activeRule, params), Long.toString(activeRule.getRulId())); + esIndex.putSynchronous(RuleRegistry.INDEX_RULES, ESActiveRule.TYPE_ACTIVE_RULE, Long.toString(activeRule.getId()), activeRuleDocument(activeRule, params), + Long.toString(activeRule.getRulId())); } catch (IOException ioexception) { throw new IllegalStateException("Unable to index active rule with id=" + activeRule.getId(), ioexception); } diff --git a/sonar-server/src/main/webapp/javascripts/resource.js b/sonar-server/src/main/webapp/javascripts/resource.js index fbdcf590f29..04165488070 100644 --- a/sonar-server/src/main/webapp/javascripts/resource.js +++ b/sonar-server/src/main/webapp/javascripts/resource.js @@ -7,7 +7,8 @@ function loadResourceViewer(resourceId, tab, display_title, period, elt) { display_title = true; } - var url = baseUrl + '/resource/index/' + resourceId + '?tab=' + tab + '&display_title=' + display_title + '&period=' + period; + var url = baseUrl + '/resource/index/' + resourceId + '?tab=' + tab + '&display_title=' + display_title + + '&period=' + period; openAccordionItem(url, elt, true); return false; @@ -16,7 +17,8 @@ function loadResourceViewer(resourceId, tab, display_title, period, elt) { // Display GWT component function loadGWT(gwtId, resourceId, resourceKey, resourceName, resourceScope, resourceQualifier, resourceLanguage) { config["resource"] = [ - {"id":resourceId, "key":resourceKey, "name":resourceName, "scope":resourceScope, "qualifier":resourceQualifier, "lang":resourceLanguage} + {"id":resourceId, "key":resourceKey, "name":resourceName, "scope":resourceScope, "qualifier":resourceQualifier, + "lang":resourceLanguage} ]; config["resource_key"] = resourceId; modules[gwtId](); diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/rule/internal/DefaultRuleTagClient.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/rule/internal/DefaultRuleTagClient.java index 58bbfe72b6c..52fed122c42 100644 --- a/sonar-ws-client/src/main/java/org/sonar/wsclient/rule/internal/DefaultRuleTagClient.java +++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/rule/internal/DefaultRuleTagClient.java @@ -24,6 +24,7 @@ import org.sonar.wsclient.internal.HttpRequestFactory; import org.sonar.wsclient.rule.RuleTagClient; import java.util.Collection; +import java.util.Collections; import java.util.HashMap; import java.util.Map; @@ -45,7 +46,7 @@ public class DefaultRuleTagClient implements RuleTagClient { @Override @SuppressWarnings("unchecked") public Collection list() { - String json = requestFactory.get(LIST_URL, null); + String json = requestFactory.get(LIST_URL, Collections. emptyMap()); return (Collection) JSONValue.parse(json); } -- 2.39.5