aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server/src/main/java
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2011-03-27 21:26:17 +0200
committersimonbrandhof <simon.brandhof@gmail.com>2011-03-27 21:26:17 +0200
commit2b560c35ab24a4f7db27d7e180a64e830b9a56a1 (patch)
tree59318ddf4d2e78688a7fa2ced83b37f921f6eac8 /sonar-server/src/main/java
parent9559e69e14d6123c3e03335e7d9b416cbac5e576 (diff)
downloadsonarqube-2b560c35ab24a4f7db27d7e180a64e830b9a56a1.tar.gz
sonarqube-2b560c35ab24a4f7db27d7e180a64e830b9a56a1.zip
fix coding violations
Diffstat (limited to 'sonar-server/src/main/java')
-rw-r--r--sonar-server/src/main/java/org/sonar/server/rules/DeprecatedProfiles.java15
-rw-r--r--sonar-server/src/main/java/org/sonar/server/ui/ViewProxy.java2
2 files changed, 9 insertions, 8 deletions
diff --git a/sonar-server/src/main/java/org/sonar/server/rules/DeprecatedProfiles.java b/sonar-server/src/main/java/org/sonar/server/rules/DeprecatedProfiles.java
index 7d61dc8ccb8..9b7474ad594 100644
--- a/sonar-server/src/main/java/org/sonar/server/rules/DeprecatedProfiles.java
+++ b/sonar-server/src/main/java/org/sonar/server/rules/DeprecatedProfiles.java
@@ -19,6 +19,7 @@
*/
package org.sonar.server.rules;
+import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
import org.sonar.api.Plugins;
import org.sonar.api.checks.profiles.Check;
@@ -42,23 +43,23 @@ public final class DeprecatedProfiles {
private CheckProfileProvider[] deprecatedCheckProfileProviders;
public DeprecatedProfiles(Plugins plugins, RuleFinder ruleFinder, RulesRepository[] r, CheckProfile[] deprecatedCheckProfiles, CheckProfileProvider[] deprecatedCheckProfileProviders) {
- this.deprecatedRepositories = r;
+ this.deprecatedRepositories = (RulesRepository[])ArrayUtils.clone(r);
this.plugins = plugins;
this.ruleFinder = ruleFinder;
- this.deprecatedCheckProfiles = deprecatedCheckProfiles;
- this.deprecatedCheckProfileProviders = deprecatedCheckProfileProviders;
+ this.deprecatedCheckProfiles = (CheckProfile[])ArrayUtils.clone(deprecatedCheckProfiles);
+ this.deprecatedCheckProfileProviders = (CheckProfileProvider[])ArrayUtils.clone(deprecatedCheckProfileProviders);
}
public DeprecatedProfiles(Plugins plugins, RuleFinder ruleFinder, RulesRepository[] r, CheckProfile[] deprecatedCheckProfiles) {
- this.deprecatedRepositories = r;
+ this.deprecatedRepositories = (RulesRepository[])ArrayUtils.clone(r);
this.plugins = plugins;
this.ruleFinder = ruleFinder;
- this.deprecatedCheckProfiles = deprecatedCheckProfiles;
+ this.deprecatedCheckProfiles = (CheckProfile[])ArrayUtils.clone(deprecatedCheckProfiles);
this.deprecatedCheckProfileProviders = new CheckProfileProvider[0];
}
public DeprecatedProfiles(Plugins plugins, RuleFinder ruleFinder, RulesRepository[] r, CheckProfileProvider[] deprecatedCheckProfileProviders) {
- this.deprecatedRepositories = r;
+ this.deprecatedRepositories = (RulesRepository[])ArrayUtils.clone(r);
this.plugins = plugins;
this.ruleFinder = ruleFinder;
this.deprecatedCheckProfiles = new CheckProfile[0];
@@ -66,7 +67,7 @@ public final class DeprecatedProfiles {
}
public DeprecatedProfiles(Plugins plugins, RuleFinder ruleFinder, RulesRepository[] r) {
- this.deprecatedRepositories = r;
+ this.deprecatedRepositories = (RulesRepository[])ArrayUtils.clone(r);
this.plugins = plugins;
this.ruleFinder = ruleFinder;
this.deprecatedCheckProfiles = new CheckProfile[0];
diff --git a/sonar-server/src/main/java/org/sonar/server/ui/ViewProxy.java b/sonar-server/src/main/java/org/sonar/server/ui/ViewProxy.java
index d36e9562dab..c00437ac9dc 100644
--- a/sonar-server/src/main/java/org/sonar/server/ui/ViewProxy.java
+++ b/sonar-server/src/main/java/org/sonar/server/ui/ViewProxy.java
@@ -73,7 +73,7 @@ public class ViewProxy<V extends View> implements Comparable<ViewProxy> {
DefaultTab defaultTabAnnotation = AnnotationUtils.getClassAnnotation(view, DefaultTab.class);
if (defaultTabAnnotation != null) {
- if (defaultTabAnnotation == null || defaultTabAnnotation.metrics().length == 0) {
+ if (defaultTabAnnotation.metrics().length == 0) {
isDefaultTab = true;
defaultForMetrics = new String[0];