aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2011-03-27 23:43:19 +0200
committersimonbrandhof <simon.brandhof@gmail.com>2011-03-27 23:43:19 +0200
commitd4ae5228bb668e65baa644b52d41286d5f3d55cd (patch)
tree8b3f18401fade28db31c1b9364e2f4ebad2b017d /sonar-server
parent2b560c35ab24a4f7db27d7e180a64e830b9a56a1 (diff)
downloadsonarqube-d4ae5228bb668e65baa644b52d41286d5f3d55cd.tar.gz
sonarqube-d4ae5228bb668e65baa644b52d41286d5f3d55cd.zip
Fix coding violations
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/java/org/sonar/server/charts/jruby/TrendsChart.java3
-rw-r--r--sonar-server/src/main/java/org/sonar/server/configuration/ConfigurationFactory.java4
-rw-r--r--sonar-server/src/main/java/org/sonar/server/filters/FilterResult.java4
-rw-r--r--sonar-server/src/main/java/org/sonar/server/platform/PlatformLifecycleListener.java4
-rw-r--r--sonar-server/src/main/java/org/sonar/server/startup/EnableProfiles.java4
-rw-r--r--sonar-server/src/main/java/org/sonar/server/startup/RegisterProvidedProfiles.java4
-rw-r--r--sonar-server/src/main/java/org/sonar/server/startup/RegisterQualityModels.java3
-rw-r--r--sonar-server/src/main/java/org/sonar/server/ui/DefaultPages.java4
8 files changed, 14 insertions, 16 deletions
diff --git a/sonar-server/src/main/java/org/sonar/server/charts/jruby/TrendsChart.java b/sonar-server/src/main/java/org/sonar/server/charts/jruby/TrendsChart.java
index e8f62192a6f..f0c8fc2fad3 100644
--- a/sonar-server/src/main/java/org/sonar/server/charts/jruby/TrendsChart.java
+++ b/sonar-server/src/main/java/org/sonar/server/charts/jruby/TrendsChart.java
@@ -45,12 +45,13 @@ import java.text.DateFormat;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.util.Date;
+import java.util.SortedMap;
import java.util.TreeMap;
public class TrendsChart extends BaseChart {
private XYPlot plot;
- private TreeMap<Long, TimeSeries> seriesById;
+ private SortedMap<Long, TimeSeries> seriesById;
private int percentAxisId = -1;
private boolean displayLegend;
diff --git a/sonar-server/src/main/java/org/sonar/server/configuration/ConfigurationFactory.java b/sonar-server/src/main/java/org/sonar/server/configuration/ConfigurationFactory.java
index e4d3b9d0586..bc7f086ec6d 100644
--- a/sonar-server/src/main/java/org/sonar/server/configuration/ConfigurationFactory.java
+++ b/sonar-server/src/main/java/org/sonar/server/configuration/ConfigurationFactory.java
@@ -58,7 +58,7 @@ public final class ConfigurationFactory {
return result;
}
- protected PropertiesConfiguration getConfigurationFromPropertiesFile(String filename) throws ConfigurationException {
+ protected PropertiesConfiguration getConfigurationFromPropertiesFile(String filename) {
try {
return new PropertiesConfiguration(ConfigurationFactory.class.getResource(filename));
@@ -67,7 +67,7 @@ public final class ConfigurationFactory {
}
}
- public PropertiesConfiguration getConfigurationFromPropertiesFile() throws ConfigurationException {
+ public PropertiesConfiguration getConfigurationFromPropertiesFile() {
return getConfigurationFromPropertiesFile("/conf/sonar.properties");
}
diff --git a/sonar-server/src/main/java/org/sonar/server/filters/FilterResult.java b/sonar-server/src/main/java/org/sonar/server/filters/FilterResult.java
index c0b54e1c8ad..9dfc0a5c260 100644
--- a/sonar-server/src/main/java/org/sonar/server/filters/FilterResult.java
+++ b/sonar-server/src/main/java/org/sonar/server/filters/FilterResult.java
@@ -21,6 +21,7 @@ package org.sonar.server.filters;
import org.apache.commons.collections.comparators.ReverseComparator;
+import java.io.Serializable;
import java.util.*;
public class FilterResult {
@@ -97,7 +98,8 @@ public class FilterResult {
}
}
- static class RowComparator implements Comparator {
+ static final class RowComparator implements Comparator, Serializable {
+ private static final long serialVersionUID = 4627704879575964978L;
private int index;
RowComparator(int index) {
diff --git a/sonar-server/src/main/java/org/sonar/server/platform/PlatformLifecycleListener.java b/sonar-server/src/main/java/org/sonar/server/platform/PlatformLifecycleListener.java
index 31bb8bf0f09..22d798048c1 100644
--- a/sonar-server/src/main/java/org/sonar/server/platform/PlatformLifecycleListener.java
+++ b/sonar-server/src/main/java/org/sonar/server/platform/PlatformLifecycleListener.java
@@ -20,8 +20,6 @@
package org.sonar.server.platform;
import org.apache.commons.configuration.Configuration;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.sonar.server.configuration.ConfigurationFactory;
import javax.servlet.ServletContextEvent;
@@ -29,8 +27,6 @@ import javax.servlet.ServletContextListener;
public final class PlatformLifecycleListener implements ServletContextListener {
- private static final Logger LOG = LoggerFactory.getLogger(PlatformLifecycleListener.class);
-
public void contextInitialized(ServletContextEvent event) {
Configuration configuration = new ConfigurationFactory().getConfiguration(event);
Platform.getInstance().init(configuration);
diff --git a/sonar-server/src/main/java/org/sonar/server/startup/EnableProfiles.java b/sonar-server/src/main/java/org/sonar/server/startup/EnableProfiles.java
index 2ae0845dd02..64bdab89615 100644
--- a/sonar-server/src/main/java/org/sonar/server/startup/EnableProfiles.java
+++ b/sonar-server/src/main/java/org/sonar/server/startup/EnableProfiles.java
@@ -37,8 +37,8 @@ public final class EnableProfiles {
private Language[] languages;
private DatabaseSessionFactory sessionFactory;
- // NOSONAR the parameter registerProfilesBefore is used to define the execution order of startup components
- public EnableProfiles(Language[] languages, DatabaseSessionFactory sessionFactory, RegisterProvidedProfiles registerProfilesBefore) {
+
+ public EnableProfiles(Language[] languages, DatabaseSessionFactory sessionFactory, RegisterProvidedProfiles registerProfilesBefore) {// NOSONAR the parameter registerProfilesBefore is used to define the execution order of startup components
this.languages = languages;
this.sessionFactory = sessionFactory;
}
diff --git a/sonar-server/src/main/java/org/sonar/server/startup/RegisterProvidedProfiles.java b/sonar-server/src/main/java/org/sonar/server/startup/RegisterProvidedProfiles.java
index 5f36e4b84b2..2392c4e6213 100644
--- a/sonar-server/src/main/java/org/sonar/server/startup/RegisterProvidedProfiles.java
+++ b/sonar-server/src/main/java/org/sonar/server/startup/RegisterProvidedProfiles.java
@@ -46,7 +46,7 @@ public final class RegisterProvidedProfiles {
private RuleFinder ruleFinder;
public RegisterProvidedProfiles(RuleFinder ruleFinder, DatabaseSessionFactory sessionFactory,
- DeprecatedProfiles deprecatedBridge, RegisterRules registerRulesBefore,
+ DeprecatedProfiles deprecatedBridge, RegisterRules registerRulesBefore,// NOSONAR the parameter registerRulesBefore is unused must be declared for execution order of tasks
ProfileDefinition[] definitions) {
this.ruleFinder = ruleFinder;
this.sessionFactory = sessionFactory;
@@ -55,7 +55,7 @@ public final class RegisterProvidedProfiles {
}
public RegisterProvidedProfiles(RuleFinder ruleFinder, DatabaseSessionFactory sessionFactory,
- DeprecatedProfiles deprecatedBridge, RegisterRules registerRulesBefore) {
+ DeprecatedProfiles deprecatedBridge, RegisterRules registerRulesBefore) {// NOSONAR the parameter registerRulesBefore is unused must be declared for execution order of tasks
this.ruleFinder = ruleFinder;
this.sessionFactory = sessionFactory;
this.deprecatedProfiles = deprecatedBridge;
diff --git a/sonar-server/src/main/java/org/sonar/server/startup/RegisterQualityModels.java b/sonar-server/src/main/java/org/sonar/server/startup/RegisterQualityModels.java
index bc9cc902396..d17cabf48fc 100644
--- a/sonar-server/src/main/java/org/sonar/server/startup/RegisterQualityModels.java
+++ b/sonar-server/src/main/java/org/sonar/server/startup/RegisterQualityModels.java
@@ -29,8 +29,7 @@ public final class RegisterQualityModels {
/**
* @param registerRulesBeforeModels used only to be started after the creation of check templates
*/
- // NOSONAR the parameter registerRulesBeforeModels is only used to provide the execution order by picocontainer
- public RegisterQualityModels(ModelManager manager, RegisterRules registerRulesBeforeModels) {
+ public RegisterQualityModels(ModelManager manager, RegisterRules registerRulesBeforeModels) {// NOSONAR the parameter registerRulesBeforeModels is only used to provide the execution order by picocontainer
this.manager = manager;
}
diff --git a/sonar-server/src/main/java/org/sonar/server/ui/DefaultPages.java b/sonar-server/src/main/java/org/sonar/server/ui/DefaultPages.java
index c8f33678b7d..cd02ce58e5f 100644
--- a/sonar-server/src/main/java/org/sonar/server/ui/DefaultPages.java
+++ b/sonar-server/src/main/java/org/sonar/server/ui/DefaultPages.java
@@ -21,7 +21,6 @@ package org.sonar.server.ui;
import org.sonar.api.measures.CoreMetrics;
import org.sonar.api.resources.Qualifiers;
-import org.sonar.api.resources.Resource;
import org.sonar.api.web.*;
/**
@@ -84,7 +83,8 @@ public final class DefaultPages {
CoreMetrics.CRITICAL_VIOLATIONS_KEY, CoreMetrics.MAJOR_VIOLATIONS_KEY, CoreMetrics.MINOR_VIOLATIONS_KEY, CoreMetrics.INFO_VIOLATIONS_KEY,
CoreMetrics.NEW_VIOLATIONS_KEY, CoreMetrics.NEW_BLOCKER_VIOLATIONS_KEY, CoreMetrics.NEW_CRITICAL_VIOLATIONS_KEY, CoreMetrics.NEW_MAJOR_VIOLATIONS_KEY,
CoreMetrics.NEW_MINOR_VIOLATIONS_KEY, CoreMetrics.NEW_INFO_VIOLATIONS_KEY})
- @ResourceQualifier({Qualifiers.VIEW, Qualifiers.SUBVIEW, Qualifiers.PROJECT, Qualifiers.MODULE, Qualifiers.PACKAGE, Qualifiers.DIRECTORY, Qualifiers.FILE, Qualifiers.CLASS}) /* all exept unit tests...*/
+ @ResourceQualifier({Qualifiers.VIEW, Qualifiers.SUBVIEW, Qualifiers.PROJECT, Qualifiers.MODULE, Qualifiers.PACKAGE, Qualifiers.DIRECTORY, Qualifiers.FILE, Qualifiers.CLASS})
+ /* all exept unit tests...*/
@UserRole(UserRole.CODEVIEWER)
private static final class ViolationsTab implements RubyRailsPage {
public String getTemplate() {