aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-deprecated
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2015-05-07 15:59:40 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2015-05-11 17:04:46 +0200
commit3c18d94e800d30e71b2ca578b2a4d606f824e844 (patch)
treeaca651a8adb71920ea839beb8975c425b94a587f /sonar-deprecated
parent079a8179040931d2589b7d9b233ca9ed949437e2 (diff)
downloadsonarqube-3c18d94e800d30e71b2ca578b2a4d606f824e844.tar.gz
sonarqube-3c18d94e800d30e71b2ca578b2a4d606f824e844.zip
SONAR-6535 API cleanup: deprecate BatchComponent and ServerComponent
Diffstat (limited to 'sonar-deprecated')
-rw-r--r--sonar-deprecated/src/main/java/org/sonar/api/batch/ResourceCreationLock.java7
-rw-r--r--sonar-deprecated/src/main/java/org/sonar/api/batch/ResourceFilter.java9
-rw-r--r--sonar-deprecated/src/main/java/org/sonar/api/charts/Chart.java5
-rw-r--r--sonar-deprecated/src/main/java/org/sonar/api/rules/AnnotationRuleParser.java23
-rw-r--r--sonar-deprecated/src/main/java/org/sonar/api/rules/RuleRepository.java7
-rw-r--r--sonar-deprecated/src/main/java/org/sonar/api/rules/XMLRuleParser.java11
6 files changed, 38 insertions, 24 deletions
diff --git a/sonar-deprecated/src/main/java/org/sonar/api/batch/ResourceCreationLock.java b/sonar-deprecated/src/main/java/org/sonar/api/batch/ResourceCreationLock.java
index 34d3ffc1b34..1b485ddd96d 100644
--- a/sonar-deprecated/src/main/java/org/sonar/api/batch/ResourceCreationLock.java
+++ b/sonar-deprecated/src/main/java/org/sonar/api/batch/ResourceCreationLock.java
@@ -19,7 +19,7 @@
*/
package org.sonar.api.batch;
-import org.sonar.api.BatchComponent;
+import org.sonar.api.BatchSide;
/**
* This lock is used to ensure that Sonar resources (files, packages, directories) are not created by buggy plugins
@@ -29,12 +29,13 @@ import org.sonar.api.BatchComponent;
* @deprecated since 4.2. File system is immutable and does not require this class anymore.
*/
@Deprecated
-public interface ResourceCreationLock extends BatchComponent {
+@BatchSide
+public interface ResourceCreationLock {
/**
* Forbids the creation of resources when saving violations and measures. By default it's unlocked, so only warnings
* are logged. When locked, then an exception is thrown.
*/
void lock();
-
+
}
diff --git a/sonar-deprecated/src/main/java/org/sonar/api/batch/ResourceFilter.java b/sonar-deprecated/src/main/java/org/sonar/api/batch/ResourceFilter.java
index bf5e90207d0..23ab301d309 100644
--- a/sonar-deprecated/src/main/java/org/sonar/api/batch/ResourceFilter.java
+++ b/sonar-deprecated/src/main/java/org/sonar/api/batch/ResourceFilter.java
@@ -19,7 +19,8 @@
*/
package org.sonar.api.batch;
-import org.sonar.api.BatchExtension;
+import org.sonar.api.BatchSide;
+import org.sonar.api.ExtensionPoint;
import org.sonar.api.resources.Resource;
/**
@@ -32,11 +33,13 @@ import org.sonar.api.resources.Resource;
* @deprecated since 4.2. Analysis is file-system oriented. See {@link org.sonar.api.scan.filesystem.InputFileFilter}
*/
@Deprecated
-public interface ResourceFilter extends BatchExtension {
+@BatchSide
+@ExtensionPoint
+public interface ResourceFilter {
/**
* Return true if the resource must be ignored, else it's saved into database.
*/
boolean isIgnored(Resource resource);
-
+
}
diff --git a/sonar-deprecated/src/main/java/org/sonar/api/charts/Chart.java b/sonar-deprecated/src/main/java/org/sonar/api/charts/Chart.java
index f9404bd835d..fedd88138ce 100644
--- a/sonar-deprecated/src/main/java/org/sonar/api/charts/Chart.java
+++ b/sonar-deprecated/src/main/java/org/sonar/api/charts/Chart.java
@@ -19,7 +19,7 @@
*/
package org.sonar.api.charts;
-import org.sonar.api.ServerExtension;
+import org.sonar.api.ServerSide;
import java.awt.image.BufferedImage;
@@ -30,7 +30,8 @@ import java.awt.image.BufferedImage;
* @deprecated in 4.5.1, replaced by Javascript charts
*/
@Deprecated
-public interface Chart extends ServerExtension {
+@ServerSide
+public interface Chart {
String getKey();
/**
diff --git a/sonar-deprecated/src/main/java/org/sonar/api/rules/AnnotationRuleParser.java b/sonar-deprecated/src/main/java/org/sonar/api/rules/AnnotationRuleParser.java
index 6a458a3ba72..328b522e7a9 100644
--- a/sonar-deprecated/src/main/java/org/sonar/api/rules/AnnotationRuleParser.java
+++ b/sonar-deprecated/src/main/java/org/sonar/api/rules/AnnotationRuleParser.java
@@ -26,7 +26,7 @@ import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import org.apache.commons.lang.StringUtils;
import org.sonar.api.PropertyType;
-import org.sonar.api.ServerComponent;
+import org.sonar.api.ServerSide;
import org.sonar.api.utils.AnnotationUtils;
import org.sonar.api.utils.FieldUtils2;
import org.sonar.api.utils.SonarException;
@@ -42,7 +42,8 @@ import java.util.List;
* @deprecated in 4.2. Replaced by {@link org.sonar.api.server.rule.RulesDefinitionAnnotationLoader}
*/
@Deprecated
-public final class AnnotationRuleParser implements ServerComponent {
+@ServerSide
+public final class AnnotationRuleParser {
private static final Logger LOG = Loggers.get(AnnotationRuleParser.class);
@@ -101,15 +102,15 @@ public final class AnnotationRuleParser implements ServerComponent {
}
private static final Function<Class<?>, PropertyType> TYPE_FOR_CLASS = Functions.forMap(
- ImmutableMap.<Class<?>, PropertyType> builder()
- .put(Integer.class, PropertyType.INTEGER)
- .put(int.class, PropertyType.INTEGER)
- .put(Float.class, PropertyType.FLOAT)
- .put(float.class, PropertyType.FLOAT)
- .put(Boolean.class, PropertyType.BOOLEAN)
- .put(boolean.class, PropertyType.BOOLEAN)
- .build(),
- PropertyType.STRING);
+ ImmutableMap.<Class<?>, PropertyType>builder()
+ .put(Integer.class, PropertyType.INTEGER)
+ .put(int.class, PropertyType.INTEGER)
+ .put(Float.class, PropertyType.FLOAT)
+ .put(float.class, PropertyType.FLOAT)
+ .put(Boolean.class, PropertyType.BOOLEAN)
+ .put(boolean.class, PropertyType.BOOLEAN)
+ .build(),
+ PropertyType.STRING);
@VisibleForTesting
static PropertyType guessType(Class<?> type) {
diff --git a/sonar-deprecated/src/main/java/org/sonar/api/rules/RuleRepository.java b/sonar-deprecated/src/main/java/org/sonar/api/rules/RuleRepository.java
index 0275e58736a..e7725ff73d1 100644
--- a/sonar-deprecated/src/main/java/org/sonar/api/rules/RuleRepository.java
+++ b/sonar-deprecated/src/main/java/org/sonar/api/rules/RuleRepository.java
@@ -22,7 +22,8 @@ package org.sonar.api.rules;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
-import org.sonar.api.ServerExtension;
+import org.sonar.api.ExtensionPoint;
+import org.sonar.api.ServerSide;
import java.util.List;
@@ -31,7 +32,9 @@ import java.util.List;
* @deprecated in 4.2. Replaced by org.sonar.api.server.rule.RulesDefinition
*/
@Deprecated
-public abstract class RuleRepository implements ServerExtension {
+@ServerSide
+@ExtensionPoint
+public abstract class RuleRepository {
private String key;
private String language;
diff --git a/sonar-deprecated/src/main/java/org/sonar/api/rules/XMLRuleParser.java b/sonar-deprecated/src/main/java/org/sonar/api/rules/XMLRuleParser.java
index 479d2a93402..ed1752d49c5 100644
--- a/sonar-deprecated/src/main/java/org/sonar/api/rules/XMLRuleParser.java
+++ b/sonar-deprecated/src/main/java/org/sonar/api/rules/XMLRuleParser.java
@@ -31,14 +31,18 @@ import org.codehaus.staxmate.SMInputFactory;
import org.codehaus.staxmate.in.SMHierarchicCursor;
import org.codehaus.staxmate.in.SMInputCursor;
import org.sonar.api.PropertyType;
-import org.sonar.api.ServerComponent;
+import org.sonar.api.ServerSide;
import org.sonar.api.utils.SonarException;
import org.sonar.check.Cardinality;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamException;
-import java.io.*;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -48,7 +52,8 @@ import java.util.Map;
* @deprecated in 4.2. Replaced by org.sonar.api.server.rule.RulesDefinition and org.sonar.api.server.rule.RulesDefinitionXmlLoader
*/
@Deprecated
-public final class XMLRuleParser implements ServerComponent {
+@ServerSide
+public final class XMLRuleParser {
private static final Map<String, String> TYPE_MAP = typeMapWithDeprecatedValues();
public List<Rule> parse(File file) {