aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api/src/main
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2012-10-23 11:12:33 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2012-10-23 11:12:33 +0200
commit8a8788fb4e8eb083935fdca81884f21fb443d6a4 (patch)
treeec0cb8c97db35104b1ceb85562e08616cb1e676c /sonar-plugin-api/src/main
parentc408b3c0bf41d1b897d58f394a9a7133f53bfd1e (diff)
downloadsonarqube-8a8788fb4e8eb083935fdca81884f21fb443d6a4.tar.gz
sonarqube-8a8788fb4e8eb083935fdca81884f21fb443d6a4.zip
Fix quality flaws
Diffstat (limited to 'sonar-plugin-api/src/main')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/checks/CheckFactory.java16
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/measures/PropertiesBuilder.java22
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/utils/KeyValueFormat.java6
3 files changed, 22 insertions, 22 deletions
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<CHECK> {
+public abstract class CheckFactory<C> {
- private Map<ActiveRule, CHECK> checkByActiveRule = Maps.newIdentityHashMap();
- private Map<CHECK, ActiveRule> activeRuleByCheck = Maps.newIdentityHashMap();
+ private Map<ActiveRule, C> checkByActiveRule = Maps.newIdentityHashMap();
+ private Map<C, ActiveRule> activeRuleByCheck = Maps.newIdentityHashMap();
private RulesProfile profile;
private String repositoryKey;
@@ -45,27 +45,27 @@ public abstract class CheckFactory<CHECK> {
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<CHECK> getChecks() {
+ public final Collection<C> 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<KEY, VALUE> {
+public class PropertiesBuilder<K, V> {
private Metric metric;
- private Map<KEY, VALUE> props;
+ private Map<K, V> props;
- public PropertiesBuilder(Metric metric, Map<KEY, VALUE> map) {
- this.props = new TreeMap<KEY, VALUE>(map);
+ public PropertiesBuilder(Metric metric, Map<K, V> map) {
+ this.props = new TreeMap<K, V>(map);
this.metric = metric;
}
public PropertiesBuilder(Metric metric) {
- this.props = new TreeMap<KEY, VALUE>();
+ this.props = new TreeMap<K, V>();
this.metric = metric;
}
public PropertiesBuilder() {
- this.props = new TreeMap<KEY, VALUE>();
+ this.props = new TreeMap<K, V>();
}
- public PropertiesBuilder<KEY, VALUE> clear() {
+ public PropertiesBuilder<K, V> clear() {
this.props.clear();
return this;
}
- public Map<KEY, VALUE> getProps() {
+ public Map<K, V> getProps() {
return props;
}
@@ -58,17 +58,17 @@ public class PropertiesBuilder<KEY, VALUE> {
return metric;
}
- public PropertiesBuilder<KEY, VALUE> setMetric(Metric metric) {
+ public PropertiesBuilder<K, V> setMetric(Metric metric) {
this.metric = metric;
return this;
}
- public PropertiesBuilder<KEY, VALUE> add(KEY key, VALUE value) {
+ public PropertiesBuilder<K, V> add(K key, V value) {
props.put(key, value);
return this;
}
- public PropertiesBuilder<KEY, VALUE> addAll(Map<KEY, VALUE> map) {
+ public PropertiesBuilder<K, V> addAll(Map<K, V> 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 <KEY, VALUE> Map<KEY, VALUE> parse(String data, Transformer<KEY, VALUE> transformer) {
+ public static <K, V> Map<K, V> parse(String data, Transformer<K, V> transformer) {
Map<String, String> rawData = parse(data);
- Map<KEY, VALUE> map = new HashMap<KEY, VALUE>();
+ Map<K, V> map = new HashMap<K, V>();
for (Map.Entry<String, String> entry : rawData.entrySet()) {
- KeyValue<KEY, VALUE> keyVal = transformer.transform(entry.getKey(), entry.getValue());
+ KeyValue<K, V> keyVal = transformer.transform(entry.getKey(), entry.getValue());
if (keyVal != null) {
map.put(keyVal.getKey(), keyVal.getValue());
}