aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api/src/main/java
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2014-03-14 11:28:48 +0100
committerSimon Brandhof <simon.brandhof@gmail.com>2014-03-14 11:28:48 +0100
commit2135b8bb236fc67d3af992bbef69dcbe7df42376 (patch)
tree247d669cae1fab5e2d37ced3c68676554a0af946 /sonar-plugin-api/src/main/java
parent472d569a5a820dfe6a11072f233f117fa37b2cd2 (diff)
downloadsonarqube-2135b8bb236fc67d3af992bbef69dcbe7df42376.tar.gz
sonarqube-2135b8bb236fc67d3af992bbef69dcbe7df42376.zip
SONAR-4908 rename the methods newXxx() of RuleDefinitions to createXxx()
Diffstat (limited to 'sonar-plugin-api/src/main/java')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RuleDefinitions.java10
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RuleDefinitionsFromAnnotations.java4
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RuleDefinitionsFromXml.java4
3 files changed, 9 insertions, 9 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RuleDefinitions.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RuleDefinitions.java
index 3c7cfc9f251..0233e286a31 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RuleDefinitions.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RuleDefinitions.java
@@ -45,7 +45,7 @@ import java.util.Set;
* <p/>
* This interface replaces the deprecated class org.sonar.api.rules.RuleRepository.
*
- * @since 4.2
+ * @since 4.3
*/
public interface RuleDefinitions extends ServerExtension {
@@ -57,7 +57,7 @@ public interface RuleDefinitions extends ServerExtension {
private final ListMultimap<String, ExtendedRepository> extendedRepositoriesByKey = ArrayListMultimap.create();
- public NewRepository newRepository(String key, String language) {
+ public NewRepository createRepository(String key, String language) {
return new NewRepositoryImpl(this, key, language, false);
}
@@ -95,7 +95,7 @@ public interface RuleDefinitions extends ServerExtension {
}
interface NewExtendedRepository {
- NewRule newRule(String ruleKey);
+ NewRule createRule(String ruleKey);
/**
* Reads definition of rule from the annotations provided by the library sonar-check-api.
@@ -183,7 +183,7 @@ public interface RuleDefinitions extends ServerExtension {
}
@Override
- public NewRule newRule(String ruleKey) {
+ public NewRule createRule(String ruleKey) {
if (newRules.containsKey(ruleKey)) {
// Should fail in a perfect world, but at the time being the Findbugs plugin
// defines several times the rule EC_INCOMPATIBLE_ARRAY_COMPARE
@@ -403,7 +403,7 @@ public interface RuleDefinitions extends ServerExtension {
return this;
}
- public NewParam newParam(String paramKey) {
+ public NewParam createParam(String paramKey) {
if (paramsByKey.containsKey(paramKey)) {
throw new IllegalArgumentException(String.format("The parameter '%s' is declared several times on the rule %s", paramKey, this));
}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RuleDefinitionsFromAnnotations.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RuleDefinitionsFromAnnotations.java
index e973bbf18f2..a9b1143ce15 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RuleDefinitionsFromAnnotations.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RuleDefinitionsFromAnnotations.java
@@ -70,7 +70,7 @@ class RuleDefinitionsFromAnnotations {
String ruleName = StringUtils.defaultIfEmpty(ruleAnnotation.name(), null);
String description = StringUtils.defaultIfEmpty(ruleAnnotation.description(), null);
- RuleDefinitions.NewRule rule = repo.newRule(ruleKey);
+ RuleDefinitions.NewRule rule = repo.createRule(ruleKey);
rule.setName(ruleName).setHtmlDescription(description);
rule.setSeverity(ruleAnnotation.priority().name());
rule.setTemplate(ruleAnnotation.cardinality() == Cardinality.MULTIPLE);
@@ -89,7 +89,7 @@ class RuleDefinitionsFromAnnotations {
org.sonar.check.RuleProperty propertyAnnotation = field.getAnnotation(org.sonar.check.RuleProperty.class);
if (propertyAnnotation != null) {
String fieldKey = StringUtils.defaultIfEmpty(propertyAnnotation.key(), field.getName());
- RuleDefinitions.NewParam param = rule.newParam(fieldKey)
+ RuleDefinitions.NewParam param = rule.createParam(fieldKey)
.setDescription(propertyAnnotation.description())
.setDefaultValue(propertyAnnotation.defaultValue());
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RuleDefinitionsFromXml.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RuleDefinitionsFromXml.java
index 73b96df75d2..1fbba08db7a 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RuleDefinitionsFromXml.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RuleDefinitionsFromXml.java
@@ -135,7 +135,7 @@ class RuleDefinitionsFromXml {
tags.add(StringUtils.trim(cursor.collectDescendantText(false)));
}
}
- RuleDefinitions.NewRule rule = repo.newRule(key)
+ RuleDefinitions.NewRule rule = repo.createRule(key)
.setHtmlDescription(description)
.setSeverity(severity)
.setName(name)
@@ -146,7 +146,7 @@ class RuleDefinitionsFromXml {
rule.setStatus(RuleStatus.valueOf(status));
}
for (ParamStruct param : params) {
- rule.newParam(param.key)
+ rule.createParam(param.key)
.setDefaultValue(param.defaultValue)
.setType(param.type)
.setDescription(param.description);