aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2016-02-05 10:15:06 +0100
committerSimon Brandhof <simon.brandhof@sonarsource.com>2016-02-05 10:15:18 +0100
commite4c5970f42097fccb0948be068c3f4dda2352b78 (patch)
tree5d22d1e0f4d1350c91e44bf64176160e85ca371f /sonar-plugin-api
parent0a1a8bd87bd186cd86051496c4de4baba6615738 (diff)
downloadsonarqube-e4c5970f42097fccb0948be068c3f4dda2352b78.tar.gz
sonarqube-e4c5970f42097fccb0948be068c3f4dda2352b78.zip
Fix quality gates
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/Checks.java4
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/checks/AnnotationCheckFactory.java4
2 files changed, 2 insertions, 6 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/Checks.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/Checks.java
index 3566f57db81..09bb71d7f66 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/Checks.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/Checks.java
@@ -162,9 +162,7 @@ public class Checks<C> {
}
configureFields(activeRule, check);
return check;
- } catch (InstantiationException e) {
- throw failToInstantiateCheck(activeRule, checkClassOrInstance, e);
- } catch (IllegalAccessException e) {
+ } catch (InstantiationException | IllegalAccessException e) {
throw failToInstantiateCheck(activeRule, checkClassOrInstance, e);
}
}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/checks/AnnotationCheckFactory.java b/sonar-plugin-api/src/main/java/org/sonar/api/checks/AnnotationCheckFactory.java
index a677bf45b9c..c5303b05c86 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/checks/AnnotationCheckFactory.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/checks/AnnotationCheckFactory.java
@@ -83,11 +83,9 @@ public final class AnnotationCheckFactory extends CheckFactory {
configureFields(activeRule, check);
return check;
- } catch (InstantiationException e) {
+ } catch (InstantiationException | IllegalAccessException e) {
throw new SonarException(CAN_NOT_INSTANTIATE_THE_CHECK_RELATED_TO_THE_RULE + activeRule, e);
- } catch (IllegalAccessException e) {
- throw new SonarException(CAN_NOT_INSTANTIATE_THE_CHECK_RELATED_TO_THE_RULE + activeRule, e);
}
}