diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-10-02 11:28:15 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-10-02 11:33:03 +0200 |
commit | b208388058b996661eb3e48bc33f67c928f4d0ce (patch) | |
tree | 12f5e8306d6817bbf1fbb8255890eb03d4bf6f4c /sonar-plugin-api | |
parent | d9721fed6b9b17e8b0c466f85535ca7bbace6462 (diff) | |
download | sonarqube-b208388058b996661eb3e48bc33f67c928f4d0ce.tar.gz sonarqube-b208388058b996661eb3e48bc33f67c928f4d0ce.zip |
SONAR-5682 Drop (some) APIs that were deprecated in versions 2.x or 3.x
Diffstat (limited to 'sonar-plugin-api')
9 files changed, 4 insertions, 397 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java b/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java index 7016d777d8a..6dcf672f3c4 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java @@ -184,17 +184,6 @@ public interface CoreProperties { String PROJECT_TEST_EXCLUSIONS_PROPERTY = "sonar.test.exclusions"; String GLOBAL_EXCLUSIONS_PROPERTY = "sonar.global.exclusions"; String GLOBAL_TEST_EXCLUSIONS_PROPERTY = "sonar.global.test.exclusions"; - /** - * @deprecated since 4.2. See http://jira.codehaus.org/browse/SONAR-5058 - */ - @Deprecated - String GLOBAL_TEST_EXCLUSIONS_DEFAULT = ""; - - /** - * @deprecated since 2.5. See discussion from http://jira.codehaus.org/browse/SONAR-1873 - */ - @Deprecated - String REUSE_RULES_CONFIGURATION_PROPERTY = "sonar.reuseExistingRulesConfiguration"; /* Sonar Core */ @@ -221,18 +210,6 @@ public interface CoreProperties { @Deprecated String CORE_INCLUDED_MODULES_PROPERTY = "sonar.includedModules"; - /** - * @deprecated since 3.6. See http://jira.codehaus.org/browse/SONAR-4145 - */ - @Deprecated - String CORE_TENDENCY_DEPTH_PROPERTY = "tendency.depth"; - - /** - * @deprecated since 2.5. See http://jira.codehaus.org/browse/SONAR-4145 - */ - @Deprecated - int CORE_TENDENCY_DEPTH_DEFAULT_VALUE = 30; - String CORE_FORCE_AUTHENTICATION_PROPERTY = "sonar.forceAuthentication"; boolean CORE_FORCE_AUTHENTICATION_DEFAULT_VALUE = false; String CORE_ALLOW_USERS_TO_SIGNUP_PROPERTY = "sonar.allowUsersToSignUp"; @@ -266,18 +243,6 @@ public interface CoreProperties { String SERVER_STARTTIME = "sonar.core.startTime"; /** - * @deprecated since 3.6. See http://jira.codehaus.org/browse/SONAR-4145 - */ - @Deprecated - String SKIP_TENDENCIES_PROPERTY = "sonar.skipTendencies"; - - /** - * @deprecated since 3.6. See http://jira.codehaus.org/browse/SONAR-4145 - */ - @Deprecated - boolean SKIP_TENDENCIES_DEFAULT_VALUE = false; - - /** * @since 2.10 */ String SERVER_BASE_URL = "sonar.core.serverBaseURL"; @@ -297,55 +262,10 @@ public interface CoreProperties { @Deprecated String CPD_MINIMUM_TOKENS_PROPERTY = "sonar.cpd.minimumTokens"; - /** - * @deprecated in 3.1 - */ - @Deprecated - int CPD_MINIMUM_TOKENS_DEFAULT_VALUE = 100; - - /** - * @deprecated in 3.1 - */ - @Deprecated - String CPD_IGNORE_LITERALS_PROPERTY = "sonar.cpd.ignore_literals"; - - /** - * @deprecated in 3.1 - */ - @Deprecated - String CPD_IGNORE_LITERALS_DEFAULT_VALUE = "true"; - - /** - * @deprecated in 3.1 - */ - @Deprecated - String CPD_IGNORE_IDENTIFIERS_PROPERTY = "sonar.cpd.ignore_identifiers"; - - /** - * @deprecated in 3.1 - */ - @Deprecated - String CPD_IGNORE_IDENTIFIERS_DEFAULT_VALUE = "false"; - String CPD_SKIP_PROPERTY = "sonar.cpd.skip"; /** * @since 2.11 - * @deprecated in 3.1 - */ - @Deprecated - String CPD_ENGINE = "sonar.cpd.engine"; - - /** - * @see #CPD_ENGINE - * @since 2.11 - * @deprecated in 3.1 - */ - @Deprecated - String CPD_ENGINE_DEFAULT_VALUE = "sonar"; - - /** - * @since 2.11 */ String CPD_CROSS_PROJECT = "sonar.cpd.cross_project"; diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/database/model/MeasureModel.java b/sonar-plugin-api/src/main/java/org/sonar/api/database/model/MeasureModel.java index d8b1f7c78f8..b7ec1155b86 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/database/model/MeasureModel.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/database/model/MeasureModel.java @@ -82,13 +82,6 @@ public class MeasureModel implements Cloneable { @Column(name = "rule_id", updatable = true, nullable = true) private Integer ruleId; - /** - * @deprecated since 2.5 See http://jira.codehaus.org/browse/SONAR-2007 - */ - @Deprecated - @Column(name = "rules_category_id", nullable = true) - private Integer rulesCategoryId;// NOSONAR this field is kept for backward-compatiblity of API - @Column(name = "rule_priority", updatable = false, nullable = true) @Enumerated(EnumType.ORDINAL) private RulePriority rulePriority; 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 903cc503293..938a71de7fe 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 @@ -46,11 +46,6 @@ public final class CoreMetrics { public static String DOMAIN_DOCUMENTATION = "Documentation"; public static String DOMAIN_SCM = "SCM"; - /** - * @deprecated in 3.6. Replaced by concept of issues. - */ - @Deprecated - public static String DOMAIN_REVIEWS = "Reviews"; public static String DOMAIN_ISSUES = "Issues"; public static String DOMAIN_GENERAL = "General"; public static String DOMAIN_DUPLICATION = "Duplication"; @@ -233,27 +228,6 @@ public final class CoreMetrics { .setDomain(DOMAIN_DOCUMENTATION) .create(); - /** - * @deprecated since 3.3 - see SONAR-3768 - */ - @Deprecated - public static final String COMMENT_BLANK_LINES_KEY = "comment_blank_lines"; - - /** - * @deprecated since 3.3 - see SONAR-3768 - */ - @Deprecated - public static final Metric<Integer> COMMENT_BLANK_LINES = new Metric.Builder(COMMENT_BLANK_LINES_KEY, "Blank comments", Metric.ValueType.INT) - .setDescription("Comments that do not contain comments") - .setDirection(Metric.DIRECTION_WORST) - .setQualitative(false) - .setDomain(DOMAIN_DOCUMENTATION) - .setFormula(new SumChildValuesFormula(false)) - .setBestValue(0.0) - .setOptimizedBestValue(true) - .setHidden(true) - .create(); - public static final String PUBLIC_DOCUMENTED_API_DENSITY_KEY = "public_documented_api_density"; public static final Metric<Double> PUBLIC_DOCUMENTED_API_DENSITY = new Metric.Builder(PUBLIC_DOCUMENTED_API_DENSITY_KEY, "Public documented API (%)", Metric.ValueType.PERCENT) .setDescription("Public documented classes and functions balanced by ncloc") @@ -1576,57 +1550,6 @@ public final class CoreMetrics { // -------------------------------------------------------------------------------------------------------------------- /** - * @deprecated since 3.7.1 - */ - @Deprecated - public static final String ABSTRACTNESS_KEY = "abstractness"; - /** - * @deprecated since 3.7.1 - */ - @Deprecated - public static final Metric<Double> ABSTRACTNESS = new Metric.Builder(ABSTRACTNESS_KEY, "Abstractness", Metric.ValueType.PERCENT) - .setDescription("Abstractness") - .setDirection(Metric.DIRECTION_NONE) - .setQualitative(false) - .setDomain(DOMAIN_DESIGN) - .setHidden(true) - .create(); - - /** - * @deprecated since 3.7.1 - */ - @Deprecated - public static final String INSTABILITY_KEY = "instability"; - /** - * @deprecated since 3.7.1 - */ - @Deprecated - public static final Metric<Double> INSTABILITY = new Metric.Builder(INSTABILITY_KEY, "Instability", Metric.ValueType.PERCENT) - .setDescription("Instability") - .setDirection(Metric.DIRECTION_NONE) - .setQualitative(false) - .setDomain(DOMAIN_DESIGN) - .setHidden(true) - .create(); - - /** - * @deprecated since 3.7.1 - */ - @Deprecated - public static final String DISTANCE_KEY = "distance"; - /** - * @deprecated since 3.7.1 - */ - @Deprecated - public static final Metric<Double> DISTANCE = new Metric.Builder(DISTANCE_KEY, "Distance", Metric.ValueType.FLOAT) - .setDescription("Distance") - .setDirection(Metric.DIRECTION_NONE) - .setQualitative(false) - .setDomain(DOMAIN_DESIGN) - .setHidden(true) - .create(); - - /** * @deprecated since 4.0. See SONAR-4643 */ @Deprecated @@ -1774,40 +1697,6 @@ public final class CoreMetrics { .create(); /** - * @deprecated since 3.7.1 - */ - @Deprecated - public static final String AFFERENT_COUPLINGS_KEY = "ca"; - /** - * @deprecated since 3.7.1 - */ - @Deprecated - public static final Metric<Integer> AFFERENT_COUPLINGS = new Metric.Builder(AFFERENT_COUPLINGS_KEY, "Afferent couplings", Metric.ValueType.INT) - .setDescription("Afferent couplings") - .setDirection(Metric.DIRECTION_WORST) - .setQualitative(false) - .setDomain(DOMAIN_DESIGN) - .setHidden(true) - .create(); - - /** - * @deprecated since 3.7.1 - */ - @Deprecated - public static final String EFFERENT_COUPLINGS_KEY = "ce"; - /** - * @deprecated since 3.7.1 - */ - @Deprecated - public static final Metric<Integer> EFFERENT_COUPLINGS = new Metric.Builder(EFFERENT_COUPLINGS_KEY, "Efferent couplings", Metric.ValueType.INT) - .setDescription("Efferent couplings") - .setDirection(Metric.DIRECTION_WORST) - .setQualitative(false) - .setDomain(DOMAIN_DESIGN) - .setHidden(true) - .create(); - - /** * @deprecated since 5.0 this is an internal metric that should not be accessed by plugins */ @Deprecated @@ -2037,139 +1926,6 @@ public final class CoreMetrics { .setDomain(DOMAIN_SCM) .create(); - // -------------------------------------------------------------------------------------------------------------------- - // - // REVIEWS (since 2.14) - // - // -------------------------------------------------------------------------------------------------------------------- - - /** - * @since 2.14 - * @deprecated in 3.6. This measure is not fed anymore since introduction of issues. - */ - @Deprecated - public static final String UNREVIEWED_VIOLATIONS_KEY = "unreviewed_violations"; - - /** - * @since 2.14 - * @deprecated in 3.6. This measure is not fed anymore since introduction of issues. - */ - @Deprecated - public static final Metric<Integer> UNREVIEWED_VIOLATIONS = new Metric.Builder(UNREVIEWED_VIOLATIONS_KEY, "Unreviewed violations", Metric.ValueType.INT) - .setDescription("Violations that have not been reviewed yet") - .setDirection(Metric.DIRECTION_WORST) - .setDomain(DOMAIN_REVIEWS) - .setBestValue(0.0) - .setOptimizedBestValue(true) - .setHidden(true) - .create(); - - /** - * @since 2.14 - * @deprecated in 3.6. This measure is not fed anymore since introduction of issues. - */ - @Deprecated - public static final String NEW_UNREVIEWED_VIOLATIONS_KEY = "new_unreviewed_violations"; - - /** - * @since 2.14 - * @deprecated in 3.6. This measure is not fed anymore since introduction of issues. - */ - @Deprecated - public static final Metric<Integer> NEW_UNREVIEWED_VIOLATIONS = new Metric.Builder(NEW_UNREVIEWED_VIOLATIONS_KEY, "New unreviewed violations", Metric.ValueType.INT) - .setDescription("New violations that have not been reviewed yet") - .setDirection(Metric.DIRECTION_WORST) - .setQualitative(true) - .setDomain(DOMAIN_REVIEWS) - .setBestValue(0.0) - .setOptimizedBestValue(true) - .setDeleteHistoricalData(true) - .setHidden(true) - .create(); - - /** - * @since 2.14 - * @deprecated in 3.6. This measure is replaced by {@link #FALSE_POSITIVE_ISSUES_KEY}. - */ - @Deprecated - public static final String FALSE_POSITIVE_REVIEWS_KEY = "false_positive_reviews"; - - /** - * @since 2.14 - * @deprecated in 3.6. This measure is replaced by {@link #FALSE_POSITIVE_ISSUES}. - */ - @Deprecated - public static final Metric<Integer> FALSE_POSITIVE_REVIEWS = new Metric.Builder(FALSE_POSITIVE_REVIEWS_KEY, "False-positive reviews", Metric.ValueType.INT) - .setDescription("Active false-positive reviews") - .setDirection(Metric.DIRECTION_WORST) - .setDomain(DOMAIN_REVIEWS) - .setBestValue(0.0) - .setOptimizedBestValue(true) - .setHidden(true) - .create(); - - /** - * @since 2.14 - * @deprecated in 3.6. This measure is not fed anymore since introduction of issues. - */ - @Deprecated - public static final String ACTIVE_REVIEWS_KEY = "active_reviews"; - - /** - * @since 2.14 - * @deprecated in 3.6. This measure is not fed anymore since introduction of issues. - */ - @Deprecated - public static final Metric<Integer> ACTIVE_REVIEWS = new Metric.Builder(ACTIVE_REVIEWS_KEY, "Active reviews", Metric.ValueType.INT) - .setDescription("Active open and reopened reviews") - .setDirection(Metric.DIRECTION_WORST) - .setDomain(DOMAIN_REVIEWS) - .setBestValue(0.0) - .setOptimizedBestValue(true) - .setHidden(true) - .create(); - - /** - * @since 2.14 - * @deprecated in 3.6. This measure is not fed anymore since introduction of issues. - */ - @Deprecated - public static final String UNASSIGNED_REVIEWS_KEY = "unassigned_reviews"; - - /** - * @since 2.14 - * @deprecated in 3.6. This measure is not fed anymore since introduction of issues. - */ - @Deprecated - public static final Metric<Integer> UNASSIGNED_REVIEWS = new Metric.Builder(UNASSIGNED_REVIEWS_KEY, "Unassigned reviews", Metric.ValueType.INT) - .setDescription("Active unassigned reviews") - .setDirection(Metric.DIRECTION_WORST) - .setDomain(DOMAIN_REVIEWS) - .setBestValue(0.0) - .setOptimizedBestValue(true) - .setHidden(true) - .create(); - - /** - * @since 2.14 - * @deprecated in 3.6. This measure is not fed anymore since introduction of issues. - */ - @Deprecated - public static final String UNPLANNED_REVIEWS_KEY = "unplanned_reviews"; - - /** - * @since 2.14 - * @deprecated in 3.6. This measure is not fed anymore since introduction of issues. - */ - @Deprecated - public static final Metric<Integer> UNPLANNED_REVIEWS = new Metric.Builder(UNPLANNED_REVIEWS_KEY, "Unplanned reviews", Metric.ValueType.INT) - .setDescription("Active unplanned reviews") - .setDirection(Metric.DIRECTION_WORST) - .setDomain(DOMAIN_REVIEWS) - .setBestValue(0.0) - .setOptimizedBestValue(true) - .setHidden(true) - .create(); // -------------------------------------------------------------------------------------------------------------------- // 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 2bfe7ee4487..65f6dc39d45 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 @@ -53,12 +53,6 @@ public class Project extends Resource implements Component { public static final String SCOPE = Scopes.PROJECT; /** - * @deprecated since version 1.11. Constant moved to CoreProperties - */ - @Deprecated - public static final String PARAM_REUSE_RULES_CONFIG = CoreProperties.REUSE_RULES_CONFIGURATION_PROPERTY; - - /** * Enumerates the type of possible analysis * @deprecated since 4.4 Since 4.3 SQ will no more run tests. So basically it's always reuse report. */ diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/rules/Violation.java b/sonar-plugin-api/src/main/java/org/sonar/api/rules/Violation.java index 027fd9b7744..9f35998b40e 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/rules/Violation.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/rules/Violation.java @@ -20,8 +20,8 @@ package org.sonar.api.rules; import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.slf4j.LoggerFactory; import org.sonar.api.resources.Resource; -import org.sonar.api.utils.Logs; import java.util.Date; @@ -128,7 +128,7 @@ public class Violation { public Violation setLineId(Integer lineId) { if (lineId != null && lineId < 1) { // TODO this normalization was added in 2.8, throw exception in future versions - see http://jira.codehaus.org/browse/SONAR-2386 - Logs.INFO.warn("line must not be less than 1 - in future versions this will cause IllegalArgumentException"); + LoggerFactory.getLogger(getClass()).warn("line must not be less than 1 - in future versions this will cause IllegalArgumentException"); this.lineId = null; } else { this.lineId = lineId; diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/Logs.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/Logs.java deleted file mode 100644 index f0c5afb720c..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/Logs.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * SonarQube, open source software quality management tool. - * Copyright (C) 2008-2014 SonarSource - * mailto:contact AT sonarsource DOT com - * - * SonarQube is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * SonarQube is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.api.utils; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Predefined SLF4j loggers - * - * @since 1.12 - */ -public final class Logs { - - private Logs() { - } - - /** - * This logger is always activated with level INFO - * @deprecated default level is INFO since version 2.12. Please use your own logger. - */ - @Deprecated - public static final Logger INFO = LoggerFactory.getLogger("org.sonar.INFO"); -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/TimeProfiler.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/TimeProfiler.java index a41d0f238b1..10b264d5124 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/TimeProfiler.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/TimeProfiler.java @@ -47,7 +47,7 @@ public class TimeProfiler { * Use the default Sonar logger */ public TimeProfiler() { - this.logger = Logs.INFO; + this.logger = LoggerFactory.getLogger(getClass()); } public TimeProfiler start(String name) { diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/ZipUtils.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/ZipUtils.java index 7aa35416d47..885905a4b58 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/ZipUtils.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/ZipUtils.java @@ -46,21 +46,6 @@ public final class ZipUtils { } /** - * Unzip a file into a new temporary directory. The directory is not deleted on JVM exit, so it - * must be explicitely deleted. - * - * @return the temporary directory - * @since 2.2 - * @deprecated since 3.4 use by {@link org.sonar.api.scan.filesystem.ModuleFileSystem#workingDir()} or {@link org.sonar.api.platform.ServerFileSystem#getTempDir} - */ - @Deprecated - public static File unzipToTempDir(File zip) throws IOException { - File toDir = TempFileUtils.createTempDirectory(); - unzip(zip, toDir); - return toDir; - } - - /** * Unzip a file into a directory. The directory is created if it does not exist. * * @return the target directory diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/resources/CoreMetricsTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/resources/CoreMetricsTest.java index 204fcfc71e6..9717ea83ab8 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/resources/CoreMetricsTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/resources/CoreMetricsTest.java @@ -32,7 +32,7 @@ public class CoreMetricsTest { @Test public void read_metrics_from_class_reflection() { List<Metric> metrics = CoreMetrics.getMetrics(); - assertThat(metrics).hasSize(154); + assertThat(metrics).hasSize(142); assertThat(metrics).contains(CoreMetrics.NCLOC, CoreMetrics.DIRECTORIES); } |