From 1ea649ef747a5938369b6c63c27e767a550f476b Mon Sep 17 00:00:00 2001 From: Julien HENRY Date: Tue, 10 May 2016 18:19:33 +0200 Subject: [PATCH] SONAR-7612 Deprecate old Resource API (Project, Directory, File) --- .../src/main/java/org/sonar/api/resources/Directory.java | 2 ++ .../sonar/api/resources/DuplicatedSourceException.java | 2 ++ .../src/main/java/org/sonar/api/resources/File.java | 8 ++++---- .../src/main/java/org/sonar/api/resources/Project.java | 2 ++ .../src/main/java/org/sonar/api/resources/Resource.java | 8 ++++---- .../main/java/org/sonar/api/resources/ResourceUtils.java | 2 ++ 6 files changed, 16 insertions(+), 8 deletions(-) diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Directory.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Directory.java index 4d8b37539d5..ddcee47af4f 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Directory.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Directory.java @@ -28,7 +28,9 @@ import org.sonar.api.utils.WildcardPattern; /** * @since 1.10 + * @deprecated since 5.6 should not be used in any API */ +@Deprecated public class Directory extends Resource { public static final String SEPARATOR = "/"; diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/DuplicatedSourceException.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/DuplicatedSourceException.java index 4a18f31136e..65cc6479ebc 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/resources/DuplicatedSourceException.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/DuplicatedSourceException.java @@ -24,7 +24,9 @@ import org.sonar.api.utils.SonarException; /** * @since 2.6 + * @deprecated since 5.6 should not be used in any API */ +@Deprecated public final class DuplicatedSourceException extends SonarException { public DuplicatedSourceException(Resource resource) { diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/File.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/File.java index ec78c7c443a..9ed3f16e4e1 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/resources/File.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/File.java @@ -19,6 +19,8 @@ */ package org.sonar.api.resources; +import java.util.List; +import javax.annotation.CheckForNull; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.builder.ToStringBuilder; import org.sonar.api.batch.SensorContext; @@ -26,15 +28,13 @@ import org.sonar.api.batch.fs.FileSystem; import org.sonar.api.scan.filesystem.PathResolver; import org.sonar.api.utils.WildcardPattern; -import javax.annotation.CheckForNull; - -import java.util.List; - /** * This class is an implementation of a resource of type FILE * * @since 1.10 + * @deprecated since 5.6 should not be used in any API */ +@Deprecated public class File extends Resource { public static final String SCOPE = Scopes.FILE; diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Project.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Project.java index ede300cfa0c..be1eacc08be 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Project.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Project.java @@ -34,7 +34,9 @@ import org.sonar.api.config.Settings; * A class that manipulates Projects in the Sonar way. * * @since 1.10 + * @deprecated since 5.6 should not be used in any API */ +@Deprecated public class Project extends Resource implements Component { /** diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Resource.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Resource.java index a1e8b63d902..f2f5e5c49a7 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Resource.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Resource.java @@ -19,18 +19,18 @@ */ package org.sonar.api.resources; -import org.apache.commons.lang.StringUtils; - +import java.io.Serializable; import javax.annotation.CheckForNull; import javax.annotation.Nullable; - -import java.io.Serializable; +import org.apache.commons.lang.StringUtils; /** * The interface to implement to create a resource in Sonar * * @since 1.10 + * @deprecated since 5.6 should not be used in any API */ +@Deprecated public abstract class Resource implements Serializable { /** diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/ResourceUtils.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/ResourceUtils.java index fff1a14c761..3344370abf4 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/resources/ResourceUtils.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/ResourceUtils.java @@ -23,7 +23,9 @@ import org.apache.commons.lang.StringUtils; /** * @since 1.10 + * @deprecated since 5.6 should not be used in any API */ +@Deprecated public final class ResourceUtils { private ResourceUtils() { -- 2.39.5