]> source.dussan.org Git - sonarqube.git/commitdiff
Fix some quality flaws
authorSimon Brandhof <simon.brandhof@gmail.com>
Mon, 2 Sep 2013 14:55:24 +0000 (16:55 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Mon, 2 Sep 2013 14:55:24 +0000 (16:55 +0200)
sonar-plugin-api/src/main/java/org/sonar/api/utils/HttpDownloader.java
sonar-server/src/main/java/org/sonar/server/configuration/ProfilesBackup.java

index 6d6e75d2ed4e0267e4bab5ce2587fdaf2ef77ef9..32d4044781eb858bac7fa30cb2eabdbe83eec1b2 100644 (file)
@@ -287,10 +287,9 @@ public class HttpDownloader extends UriReader.SchemeProcessor implements BatchCo
 
         InputStream resultingInputStream = null;
         // create the appropriate stream wrapper based on the encoding type
-        if (encoding != null && encoding.equalsIgnoreCase("gzip")) {
+        if (encoding != null && "gzip".equalsIgnoreCase(encoding)) {
           resultingInputStream = new GZIPInputStream(connection.getInputStream());
-        }
-        else {
+        } else {
           resultingInputStream = connection.getInputStream();
         }
         return resultingInputStream;
index 4237dca8025d145752b6f77cd453931aa2b1e436..fa9e337d96600327a2c214f8a86ef93d871766d3 100644 (file)
@@ -147,22 +147,22 @@ public class ProfilesBackup implements Backupable {
         LoggerFactory.getLogger(getClass()).error(
           "Unable to find active rule " + unMarshalledRule.getRepositoryKey() + ":" + unMarshalledRule.getKey());
         iar.remove();
-        continue;
-      }
-      activeRule.setRule(matchingRuleInDb);
-      activeRule.setRulesProfile(profile);
-      activeRule.getActiveRuleParams();
-      for (Iterator<ActiveRuleParam> irp = activeRule.getActiveRuleParams().iterator(); irp.hasNext(); ) {
-        ActiveRuleParam activeRuleParam = irp.next();
-        RuleParam unMarshalledRP = activeRuleParam.getRuleParam();
-        RuleParam matchingRPInDb = rulesDao.getRuleParam(matchingRuleInDb, unMarshalledRP.getKey());
-        if (matchingRPInDb == null) {
-          LoggerFactory.getLogger(getClass()).error("Unable to find active rule parameter " + unMarshalledRP.getKey());
-          irp.remove();
-          continue;
+      } else {
+        activeRule.setRule(matchingRuleInDb);
+        activeRule.setRulesProfile(profile);
+        activeRule.getActiveRuleParams();
+        for (Iterator<ActiveRuleParam> irp = activeRule.getActiveRuleParams().iterator(); irp.hasNext(); ) {
+          ActiveRuleParam activeRuleParam = irp.next();
+          RuleParam unMarshalledRP = activeRuleParam.getRuleParam();
+          RuleParam matchingRPInDb = rulesDao.getRuleParam(matchingRuleInDb, unMarshalledRP.getKey());
+          if (matchingRPInDb == null) {
+            LoggerFactory.getLogger(getClass()).error("Unable to find active rule parameter " + unMarshalledRP.getKey());
+            irp.remove();
+            continue;
+          }
+          activeRuleParam.setActiveRule(activeRule);
+          activeRuleParam.setRuleParam(matchingRPInDb);
         }
-        activeRuleParam.setActiveRule(activeRule);
-        activeRuleParam.setRuleParam(matchingRPInDb);
       }
     }
   }