]> source.dussan.org Git - sonarqube.git/commitdiff
Fix violations
authorFabrice Bellingard <bellingard@gmail.com>
Wed, 4 Jul 2012 09:20:20 +0000 (11:20 +0200)
committerFabrice Bellingard <bellingard@gmail.com>
Wed, 4 Jul 2012 09:20:20 +0000 (11:20 +0200)
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/DefaultResourceTypes.java
sonar-core/src/main/java/org/sonar/core/resource/ResourceDto.java

index 78ff963e9e0b91d37af2cc965959510d915a0db5..cbd4aa570f250ab0d0610cc37b9ea560a511ca74 100644 (file)
@@ -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())
index 193984ccbff897890595e780a1722802dc00232b..6eeeab179e1eb11536b72c3636ae918eb68f79aa 100644 (file)
@@ -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;
   }