]> source.dussan.org Git - sonarqube.git/commitdiff
Fix some quality flaws
authorsimonbrandhof <simon.brandhof@gmail.com>
Thu, 22 Dec 2011 06:02:39 +0000 (07:02 +0100)
committersimonbrandhof <simon.brandhof@gmail.com>
Thu, 22 Dec 2011 06:02:39 +0000 (07:02 +0100)
sonar-core/src/main/java/org/sonar/persistence/resource/ResourceIndexerDao.java
sonar-plugin-api/src/main/java/org/sonar/api/config/Settings.java

index 99b9ebe845c9f4acead7d31db60683928934ccf5..fdbe6818d0dbdc14b373f016bfcca8ca0128d1ca 100644 (file)
  */
 package org.sonar.persistence.resource;
 
-import com.google.common.collect.Lists;
 import org.apache.commons.lang.ObjectUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.ibatis.session.ExecutorType;
 import org.apache.ibatis.session.ResultContext;
 import org.apache.ibatis.session.ResultHandler;
 import org.apache.ibatis.session.SqlSession;
-import org.sonar.persistence.DatabaseUtils;
 import org.sonar.persistence.MyBatis;
 
-import java.util.List;
-
 public class ResourceIndexerDao {
 
   public static final int MINIMUM_KEY_SIZE = 3;
index 656e3f88ee69aaf7be75da7285a7e3e827e82431..aae762718c0a37c9eb934600a9da4a4f83525617 100644 (file)
@@ -63,7 +63,7 @@ public class Settings implements BatchComponent, ServerComponent {
 
   public final String getString(String key) {
     String value = properties.get(key);
-    if (value==null) {
+    if (value == null) {
       value = getDefaultValue(key);
     }
     return value;
@@ -108,12 +108,12 @@ public class Settings implements BatchComponent, ServerComponent {
 
   /**
    * Value is splitted by comma and trimmed.
-   *
+   * <p/>
    * Examples :
    * <ul>
-   *   <li>"one,two,three " -> ["one", "two", "three"]</li>
-   *   <li>"  one, two, three " -> ["one", "two", "three"]</li>
-   *   <li>"one, , three" -> ["one", "", "three"]</li>
+   * <li>"one,two,three " -> ["one", "two", "three"]</li>
+   * <li>"  one, two, three " -> ["one", "two", "three"]</li>
+   * <li>"one, , three" -> ["one", "", "three"]</li>
    * </ul>
    */
   public final String[] getStringArray(String key) {
@@ -126,12 +126,12 @@ public class Settings implements BatchComponent, ServerComponent {
   public final String[] getStringArrayBySeparator(String key, String separator) {
     String value = getString(key);
     if (value != null) {
-        String[] strings = StringUtils.splitByWholeSeparator(value, separator);
-        String[] result = new String[strings.length];
-        for (int index=0 ; index<strings.length ; index++) {
-            result[index]=StringUtils.trim(strings[index]);
-        }
-        return result;
+      String[] strings = StringUtils.splitByWholeSeparator(value, separator);
+      String[] result = new String[strings.length];
+      for (int index = 0; index < strings.length; index++) {
+        result[index] = StringUtils.trim(strings[index]);
+      }
+      return result;
     }
     return ArrayUtils.EMPTY_STRING_ARRAY;
   }