diff options
author | Evgeny Mandrikov <mandrikov@gmail.com> | 2012-01-19 19:15:43 +0400 |
---|---|---|
committer | Evgeny Mandrikov <mandrikov@gmail.com> | 2012-01-20 12:40:41 +0400 |
commit | 7e8f15bbae7bee07d6b0845743fbb79f5ae5b1f0 (patch) | |
tree | 922842493849d045214a3532b546a60b8f23232b /sonar-plugin-api/src | |
parent | 13641737034aa84507d349c92183815c0b226764 (diff) | |
download | sonarqube-7e8f15bbae7bee07d6b0845743fbb79f5ae5b1f0.tar.gz sonarqube-7e8f15bbae7bee07d6b0845743fbb79f5ae5b1f0.zip |
SONAR-3179 Use naming convention for localization of qualifiers
Change localization for "qualifier.BRK" from "Module" to "Sub-project".
Diffstat (limited to 'sonar-plugin-api/src')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/resources/ResourceDefinition.java | 22 | ||||
-rw-r--r-- | sonar-plugin-api/src/test/java/org/sonar/api/resources/ResourceDefinitionTest.java | 3 |
2 files changed, 2 insertions, 23 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/ResourceDefinition.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/ResourceDefinition.java index 899ba0b6c84..09a057373cc 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/resources/ResourceDefinition.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/ResourceDefinition.java @@ -32,7 +32,6 @@ public final class ResourceDefinition implements ServerExtension { public static class Builder { private String qualifier; - private String name; private String iconPath; private boolean availableForFilters = false; @@ -41,14 +40,6 @@ public final class ResourceDefinition implements ServerExtension { } /** - * @param name name which would be used for localization - */ - public Builder setName(String name) { - this.name = name; - return this; - } - - /** * @param iconPath path to icon, relative to context of web-application (e.g. "/images/q/DIR.png") */ public Builder setIconPath(String iconPath) { @@ -62,13 +53,10 @@ public final class ResourceDefinition implements ServerExtension { } public ResourceDefinition build() { - if (Strings.isNullOrEmpty(name)) { - name = qualifier; - } if (Strings.isNullOrEmpty(iconPath)) { iconPath = "/images/q/" + qualifier + ".png"; } - return new ResourceDefinition(qualifier, name, iconPath, availableForFilters); + return new ResourceDefinition(qualifier, iconPath, availableForFilters); } } @@ -79,13 +67,11 @@ public final class ResourceDefinition implements ServerExtension { } private final String qualifier; - private final String name; private final String iconPath; private final boolean availableForFilters; - private ResourceDefinition(String qualifier, String name, String iconPath, boolean availableForFilters) { + private ResourceDefinition(String qualifier, String iconPath, boolean availableForFilters) { this.qualifier = qualifier; - this.name = name; this.iconPath = iconPath; this.availableForFilters = availableForFilters; } @@ -94,10 +80,6 @@ public final class ResourceDefinition implements ServerExtension { return qualifier; } - public String getName() { - return name; - } - public String getIconPath() { return iconPath; } diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/resources/ResourceDefinitionTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/resources/ResourceDefinitionTest.java index 852919406b1..c18d59a7f58 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/resources/ResourceDefinitionTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/resources/ResourceDefinitionTest.java @@ -31,7 +31,6 @@ public class ResourceDefinitionTest { ResourceDefinition def = ResourceDefinition.builder("qualifier") .build(); assertThat(def.getQualifier(), is("qualifier")); - assertThat(def.getName(), is("qualifier")); assertThat(def.getIconPath(), is("/images/q/qualifier.png")); } @@ -39,10 +38,8 @@ public class ResourceDefinitionTest { public void shouldCreate() { ResourceDefinition def = ResourceDefinition.builder("qualifier") .setIconPath("/custom-icon.png") - .setName("custom-name") .build(); assertThat(def.getQualifier(), is("qualifier")); - assertThat(def.getName(), is("custom-name")); assertThat(def.getIconPath(), is("/custom-icon.png")); } |