]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-8460 Remove isEmpty from Errors
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Wed, 1 Mar 2017 10:21:37 +0000 (11:21 +0100)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Thu, 2 Mar 2017 08:26:10 +0000 (09:26 +0100)
server/sonar-server/src/main/java/org/sonar/server/exceptions/Errors.java
server/sonar-server/src/main/java/org/sonar/server/qualitygate/QualityGateConditionsUpdater.java
server/sonar-server/src/main/java/org/sonar/server/qualitygate/QualityGateUpdater.java
server/sonar-server/src/main/java/org/sonar/server/qualitygate/QualityGates.java
server/sonar-server/src/main/java/org/sonar/server/rule/RuleCreator.java

index 85f91f986be4cbdbd2f6083383f082d644efbe9f..e0045390bbb166dbc319b1401743737adc52bb43 100644 (file)
@@ -54,10 +54,6 @@ public class Errors {
     return messages;
   }
 
-  public boolean isEmpty() {
-    return messages.isEmpty();
-  }
-
   @Override
   public String toString() {
     return MoreObjects.toStringHelper(this)
index b06cc208c416e7073f7cef6f059b53159b0ae51b..831d88dcb2205d586e621761a84bb9de07ff7264 100644 (file)
@@ -135,7 +135,7 @@ public class QualityGateConditionsUpdater {
     checkThresholds(warningThreshold, errorThreshold, errors);
     checkPeriod(metric, period, errors);
     checkRatingMetric(metric, warningThreshold, errorThreshold, period, errors);
-    if (!errors.isEmpty()) {
+    if (!errors.messages().isEmpty()) {
       throw BadRequestException.create(errors);
     }
   }
index 645cd0f61f1316a08b93741ce211b0f12e88a29e..7afedf22db0d9d7e3b8a0681e4eb892cf3fa10f4 100644 (file)
@@ -52,7 +52,7 @@ public class QualityGateUpdater {
     } else {
       checkQualityGateDoesNotAlreadyExist(qGateId, name, errors);
     }
-    if (!errors.isEmpty()) {
+    if (!errors.messages().isEmpty()) {
       throw BadRequestException.create(errors);
     }
   }
index 506ab073ac886923c4fb66c94b2d80f57d8129fd..2c508e65da15046f6c78d6a3d1fe4ad7f7ed748c 100644 (file)
@@ -232,7 +232,7 @@ public class QualityGates {
     } else {
       checkQgateNotAlreadyExists(updatingQgateId, name, errors);
     }
-    if (!errors.isEmpty()) {
+    if (!errors.messages().isEmpty()) {
       throw BadRequestException.create(errors);
     }
   }
index 1ab821096359b2f024d8c14553e686c41f49195d..6ce431fb454e2e38b9efbfa4abbe5c75ee7b49e5 100644 (file)
@@ -118,7 +118,7 @@ public class RuleCreator {
       }
     }
 
-    if (!errors.isEmpty()) {
+    if (!errors.messages().isEmpty()) {
       throw BadRequestException.create(errors);
     }
   }