diff options
author | Fabrice Bellingard <bellingard@gmail.com> | 2012-07-04 11:20:20 +0200 |
---|---|---|
committer | Fabrice Bellingard <bellingard@gmail.com> | 2012-07-04 11:20:20 +0200 |
commit | 5ad5e21f77cb69707c610aef5fc62bdfd2e558c5 (patch) | |
tree | 3d90a1e91b15f6d3fedd8d2b24e85f71b1713678 | |
parent | 95bd81b84dbf58ee2a072eb1570ffc34d183c0b5 (diff) | |
download | sonarqube-5ad5e21f77cb69707c610aef5fc62bdfd2e558c5.tar.gz sonarqube-5ad5e21f77cb69707c610aef5fc62bdfd2e558c5.zip |
Fix violations
-rw-r--r-- | plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/DefaultResourceTypes.java | 12 | ||||
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/resource/ResourceDto.java | 15 |
2 files changed, 17 insertions, 10 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/DefaultResourceTypes.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/DefaultResourceTypes.java index 78ff963e9e0..cbd4aa570f2 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/DefaultResourceTypes.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/DefaultResourceTypes.java @@ -30,18 +30,20 @@ import org.sonar.api.resources.ResourceTypeTree; @InstantiationStrategy(InstantiationStrategy.PER_BATCH) public final class DefaultResourceTypes extends ExtensionProvider implements BatchExtension, ServerExtension { + private static final String TRUE = "true"; + @Override public ResourceTypeTree provide() { return ResourceTypeTree.builder() .addType(ResourceType.builder(Qualifiers.PROJECT) - .setProperty("deletable", "true") - .setProperty("modifiable_history", "true") - .setProperty("hasRolePolicy", "true") - .setProperty("updatable_key", "true") + .setProperty("deletable", TRUE) + .setProperty("modifiable_history", TRUE) + .setProperty("hasRolePolicy", TRUE) + .setProperty("updatable_key", TRUE) .build()) .addType(ResourceType.builder(Qualifiers.MODULE) - .setProperty("updatable_key", "true") + .setProperty("updatable_key", TRUE) .build()) .addType(ResourceType.builder(Qualifiers.DIRECTORY).build()) .addType(ResourceType.builder(Qualifiers.PACKAGE).build()) diff --git a/sonar-core/src/main/java/org/sonar/core/resource/ResourceDto.java b/sonar-core/src/main/java/org/sonar/core/resource/ResourceDto.java index 193984ccbff..6eeeab179e1 100644 --- a/sonar-core/src/main/java/org/sonar/core/resource/ResourceDto.java +++ b/sonar-core/src/main/java/org/sonar/core/resource/ResourceDto.java @@ -102,18 +102,23 @@ public final class ResourceDto { @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (obj == null) + } + if (obj == null) { return false; - if (getClass() != obj.getClass()) + } + if (getClass() != obj.getClass()) { return false; + } ResourceDto other = (ResourceDto) obj; if (id == null) { - if (other.id != null) + if (other.id != null) { return false; - } else if (!id.equals(other.id)) + } + } else if (!id.equals(other.id)) { return false; + } return true; } |