summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2014-01-10 08:42:10 +0100
committerJulien Lancelot <julien.lancelot@sonarsource.com>2014-01-10 08:42:10 +0100
commitbe0d369cc442bde9fef51c9763580536f4ffb8e1 (patch)
tree30c962feedfe80a727a50e1aa1ecb0e95d456331
parent48250940c4ad53bf04538deda83669f53cc367a3 (diff)
downloadsonarqube-be0d369cc442bde9fef51c9763580536f4ffb8e1.tar.gz
sonarqube-be0d369cc442bde9fef51c9763580536f4ffb8e1.zip
Fix quality flaws
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRuleParam.java3
-rw-r--r--sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileOperations.java9
2 files changed, 6 insertions, 6 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRuleParam.java b/sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRuleParam.java
index 41451e6c305..d0d0066013b 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRuleParam.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRuleParam.java
@@ -138,8 +138,7 @@ public class ActiveRuleParam implements Cloneable {
@Override
public Object clone() {
- String paramKey = getParamKey() != null ? getParamKey() : getRuleParam().getKey();
- return new ActiveRuleParam(getActiveRule(), getRuleParam(), paramKey, getValue());
+ return new ActiveRuleParam(getActiveRule(), getRuleParam(), getParamKey() != null ? getParamKey() : getRuleParam().getKey(), getValue());
}
}
diff --git a/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileOperations.java b/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileOperations.java
index 6943949b5aa..7850a3d6708 100644
--- a/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileOperations.java
+++ b/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileOperations.java
@@ -143,12 +143,13 @@ public class QProfileOperations implements ServerComponent {
}
@VisibleForTesting
- boolean isCycle(QualityProfileDto childProfile, QualityProfileDto parentProfile, SqlSession session) {
- while (parentProfile != null) {
- if (childProfile.getName().equals(parentProfile.getName())) {
+ boolean isCycle(QualityProfileDto childProfile, @Nullable QualityProfileDto parentProfile, SqlSession session) {
+ QualityProfileDto currentParent = parentProfile;
+ while (currentParent != null) {
+ if (childProfile.getName().equals(currentParent.getName())) {
return true;
}
- parentProfile = getParent(parentProfile, session);
+ currentParent = getParent(currentParent, session);
}
return false;
}