From 8a8788fb4e8eb083935fdca81884f21fb443d6a4 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 23 Oct 2012 11:12:33 +0200 Subject: Fix quality flaws --- .../java/org/sonar/api/checks/CheckFactory.java | 16 ++++++++-------- .../org/sonar/api/measures/PropertiesBuilder.java | 22 +++++++++++----------- .../java/org/sonar/api/utils/KeyValueFormat.java | 6 +++--- 3 files changed, 22 insertions(+), 22 deletions(-) (limited to 'sonar-plugin-api/src/main/java/org') diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/checks/CheckFactory.java b/sonar-plugin-api/src/main/java/org/sonar/api/checks/CheckFactory.java index b6c039e15c8..f4f9f81d514 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/checks/CheckFactory.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/checks/CheckFactory.java @@ -29,10 +29,10 @@ import java.util.Map; /** * @since 2.3 */ -public abstract class CheckFactory { +public abstract class CheckFactory { - private Map checkByActiveRule = Maps.newIdentityHashMap(); - private Map activeRuleByCheck = Maps.newIdentityHashMap(); + private Map checkByActiveRule = Maps.newIdentityHashMap(); + private Map activeRuleByCheck = Maps.newIdentityHashMap(); private RulesProfile profile; private String repositoryKey; @@ -45,27 +45,27 @@ public abstract class CheckFactory { checkByActiveRule.clear(); activeRuleByCheck.clear(); for (ActiveRule activeRule : profile.getActiveRulesByRepository(repositoryKey)) { - CHECK check = createCheck(activeRule); + C check = createCheck(activeRule); checkByActiveRule.put(activeRule, check); activeRuleByCheck.put(check, activeRule); } } - abstract CHECK createCheck(ActiveRule activeRule); + abstract C createCheck(ActiveRule activeRule); public final String getRepositoryKey() { return repositoryKey; } - public final Collection getChecks() { + public final Collection getChecks() { return checkByActiveRule.values(); } - public final CHECK getCheck(ActiveRule activeRule) { + public final C getCheck(ActiveRule activeRule) { return checkByActiveRule.get(activeRule); } - public final ActiveRule getActiveRule(CHECK check) { + public final ActiveRule getActiveRule(C check) { return activeRuleByCheck.get(check); } } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/measures/PropertiesBuilder.java b/sonar-plugin-api/src/main/java/org/sonar/api/measures/PropertiesBuilder.java index d95034ed39c..1adff64c5cb 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/measures/PropertiesBuilder.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/measures/PropertiesBuilder.java @@ -27,30 +27,30 @@ import java.util.TreeMap; /** * @since 1.10 */ -public class PropertiesBuilder { +public class PropertiesBuilder { private Metric metric; - private Map props; + private Map props; - public PropertiesBuilder(Metric metric, Map map) { - this.props = new TreeMap(map); + public PropertiesBuilder(Metric metric, Map map) { + this.props = new TreeMap(map); this.metric = metric; } public PropertiesBuilder(Metric metric) { - this.props = new TreeMap(); + this.props = new TreeMap(); this.metric = metric; } public PropertiesBuilder() { - this.props = new TreeMap(); + this.props = new TreeMap(); } - public PropertiesBuilder clear() { + public PropertiesBuilder clear() { this.props.clear(); return this; } - public Map getProps() { + public Map getProps() { return props; } @@ -58,17 +58,17 @@ public class PropertiesBuilder { return metric; } - public PropertiesBuilder setMetric(Metric metric) { + public PropertiesBuilder setMetric(Metric metric) { this.metric = metric; return this; } - public PropertiesBuilder add(KEY key, VALUE value) { + public PropertiesBuilder add(K key, V value) { props.put(key, value); return this; } - public PropertiesBuilder addAll(Map map) { + public PropertiesBuilder addAll(Map map) { props.putAll(map); return this; } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/KeyValueFormat.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/KeyValueFormat.java index 4b413525d63..411d9dbdce7 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/KeyValueFormat.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/KeyValueFormat.java @@ -326,11 +326,11 @@ public final class KeyValueFormat { * @deprecated since 2.7 */ @Deprecated - public static Map parse(String data, Transformer transformer) { + public static Map parse(String data, Transformer transformer) { Map rawData = parse(data); - Map map = new HashMap(); + Map map = new HashMap(); for (Map.Entry entry : rawData.entrySet()) { - KeyValue keyVal = transformer.transform(entry.getKey(), entry.getValue()); + KeyValue keyVal = transformer.transform(entry.getKey(), entry.getValue()); if (keyVal != null) { map.put(keyVal.getKey(), keyVal.getValue()); } -- cgit v1.2.3