aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2013-02-12 23:23:05 +0100
committerSimon Brandhof <simon.brandhof@gmail.com>2013-02-12 23:23:05 +0100
commit58aec721087a86cd5bd298d217842b3ca2b07bfb (patch)
tree6f41bdcf9ec89e092ca4d9bd97d975e86b6ebecc /sonar-plugin-api
parent2f5abff12813deadf1a042ee5b94ab3a9665a02f (diff)
downloadsonarqube-58aec721087a86cd5bd298d217842b3ca2b07bfb.tar.gz
sonarqube-58aec721087a86cd5bd298d217842b3ca2b07bfb.zip
Fix quality flaws
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/FileFilter.java4
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/SonarIndex.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java25
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/resources/ProjectFileSystem.java1
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/FileFilter.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/utils/Semaphores.java3
6 files changed, 22 insertions, 15 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/FileFilter.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/FileFilter.java
index 1041bcf5f40..28fc655e18d 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/FileFilter.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/FileFilter.java
@@ -21,6 +21,10 @@ package org.sonar.api.batch;
import java.io.File;
+/**
+ * @deprecated replaced by {@link org.sonar.api.scan.filesystem.FileFilter} in 3.5
+ */
+@Deprecated
public abstract class FileFilter implements java.io.FileFilter, org.sonar.api.scan.filesystem.FileFilter {
public final boolean accept(File file, org.sonar.api.scan.filesystem.FileFilter.Context context) {
return accept(file);
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/SonarIndex.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/SonarIndex.java
index 44cf1a1d901..b337c00489a 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/SonarIndex.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/SonarIndex.java
@@ -97,7 +97,7 @@ public abstract class SonarIndex implements DirectedGraphAccessor<Resource, Depe
* @throws org.sonar.api.resources.DuplicatedSourceException
* if the source has already been set on this resource
*/
- public abstract void setSource(Resource reference, String source) throws DuplicatedSourceException;
+ public abstract void setSource(Resource reference, String source);
/**
* @return source code associated with a specified resource, <code>null</code> if not available
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java b/sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java
index 5b4b79bebe0..fbbfc823bcb 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java
@@ -37,15 +37,16 @@ public final class CoreMetrics {
// only static stuff
}
- public static final String DOMAIN_SIZE = "Size";
- public static final String DOMAIN_TESTS = "Tests";
- public static final String DOMAIN_INTEGRATION_TESTS = "Tests (Integration)";
- public static final String DOMAIN_OVERALL_TESTS = "Tests (Overall)";
- public static final String DOMAIN_COMPLEXITY = "Complexity";
- public static final String DOMAIN_DOCUMENTATION = "Documentation";
- public static final String DOMAIN_RULES = "Rules";
- public static final String DOMAIN_SCM = "SCM";
- public static final String DOMAIN_REVIEWS = "Reviews";
+ // the following fields are not final to avoid compile-time constants used by plugins
+ public static String DOMAIN_SIZE = "Size";
+ public static String DOMAIN_TESTS = "Tests";
+ public static String DOMAIN_INTEGRATION_TESTS = "Tests (Integration)";
+ public static String DOMAIN_OVERALL_TESTS = "Tests (Overall)";
+ public static String DOMAIN_COMPLEXITY = "Complexity";
+ public static String DOMAIN_DOCUMENTATION = "Documentation";
+ public static String DOMAIN_RULES = "Rules";
+ public static String DOMAIN_SCM = "SCM";
+ public static String DOMAIN_REVIEWS = "Reviews";
/**
* @deprecated since 2.5 See SONAR-2007
@@ -53,9 +54,9 @@ public final class CoreMetrics {
@Deprecated
public static final String DOMAIN_RULE_CATEGORIES = "Rule categories";
- public static final String DOMAIN_GENERAL = "General";
- public static final String DOMAIN_DUPLICATION = "Duplication";
- public static final String DOMAIN_DESIGN = "Design";
+ public static String DOMAIN_GENERAL = "General";
+ public static String DOMAIN_DUPLICATION = "Duplication";
+ public static String DOMAIN_DESIGN = "Design";
public static final String LINES_KEY = "lines";
public static final Metric LINES = new Metric.Builder(LINES_KEY, "Lines", Metric.ValueType.INT)
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/ProjectFileSystem.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/ProjectFileSystem.java
index b1a1af26980..897cc396d78 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/resources/ProjectFileSystem.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/ProjectFileSystem.java
@@ -30,6 +30,7 @@ import java.util.List;
* @since 1.10
* @deprecated replaced by {@link org.sonar.api.scan.filesystem.ModuleFileSystem} in 3.5
*/
+@Deprecated
public interface ProjectFileSystem extends BatchComponent {
/**
* Source encoding.
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/FileFilter.java b/sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/FileFilter.java
index 42b98c1fc0d..ec4067d8de4 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/FileFilter.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/FileFilter.java
@@ -33,7 +33,7 @@ public interface FileFilter extends BatchExtension {
SOURCE, TEST
}
- static interface Context {
+ interface Context {
ModuleFileSystem fileSystem();
FileType fileType();
File sourceDir();
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/Semaphores.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/Semaphores.java
index d977250d8ec..ac47230abfc 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/Semaphores.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/Semaphores.java
@@ -40,7 +40,8 @@ public interface Semaphores extends BatchComponent, ServerComponent {
* outdated.
*
* @param name the key of the semaphore
- * @param maxAgeInSeconds the max duration in seconds the semaphore will be considered unlocked if it was not updated. The value zero forces the semaphore to be acquired, whatever its status.
+ * @param maxAgeInSeconds the max duration in seconds the semaphore will be considered unlocked if
+ * it was not updated. The value zero forces the semaphore to be acquired, whatever its status.
* @param updatePeriodInSeconds the period in seconds the semaphore will be updated.
* @return the semaphore, whatever its status (locked or unlocked). Can't be null.
*/