diff options
author | Duarte Meneses <duarte.meneses@sonarsource.com> | 2021-06-09 16:26:56 -0500 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2021-06-17 20:03:08 +0000 |
commit | 2754feca4e5fa8fdd804c827783250f48676296c (patch) | |
tree | 1ed9522bbc9eff9444fae6bf0a951d976da2b859 /sonar-plugin-api | |
parent | 97f2c01fdd4ae863134d4aa1bf32b7dcd512b10c (diff) | |
download | sonarqube-2754feca4e5fa8fdd804c827783250f48676296c.tar.gz sonarqube-2754feca4e5fa8fdd804c827783250f48676296c.zip |
SONAR-14925 Remove code deprecated before 7.0 in the Plugin API
Diffstat (limited to 'sonar-plugin-api')
72 files changed, 17 insertions, 2136 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 b3ef7e3050e..9911d89b275 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 @@ -248,7 +248,7 @@ public interface CoreProperties { /** * This property defines the SonarQubeServer base url, such as <i>http://yourhost.yourdomain/sonar</i>. - * When this property is not set, the base url of the SonarQube server is provided by {@link Server#getURL()}. + * When this property is not set, the base url of the SonarQube server is provided by {@link Server#getPublicRootUrl()}. * * @since 2.10 */ diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/ExtensionProvider.java b/sonar-plugin-api/src/main/java/org/sonar/api/ExtensionProvider.java deleted file mode 100644 index 9db2573859e..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/ExtensionProvider.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2021 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program 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. - * - * This program 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; - -import org.sonar.api.ce.ComputeEngineSide; -import org.sonar.api.server.ServerSide; - -/** - * Factory of extensions. It allows to dynamically create extensions depending upon runtime context. One use-case is - * to create one rule repository by language. - * - * <p>Notes : - * <ul> - * <li>the provider is declared in Plugin.getExtensions()</li> - * <li>the provider must also add annotation {@link ServerSide}, {@link ComputeEngineSide} and/or {@link BatchSide}</li> - * <li>the provider can accept dependencies (parameters) in its constructors.</li> - * <li>the method provide() is executed once by the platform</li> - * <li>the method provide() must return an object, a class or an Iterable of objects. <strong>Arrays are excluded</strong>.</li> - * </ul> - * - * - * <p>Example: - * <pre> - * {@code - * {@literal @}ServerSide - * public class RuleRepositoryProvider extends ExtensionProvider { - * private Language[] languages; - * - * public RuleRepositoryProvider(Language[] languages) { - * this.languages = languages; - * } - * - * public List<RuleRepository> provide() { - * List<RuleRepository> result = new ArrayList<RuleRepository>(); - * for(Language language: languages) { - * result.add(new RuleRepository(..., language, ...)); - * } - * return result; - * } - * } - * } - * </pre> - * - * - * @since 2.3 - * @deprecated since 6.0 should no more be used - */ -@Deprecated -@ExtensionPoint -public abstract class ExtensionProvider { - - public abstract Object provide(); -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/PropertyField.java b/sonar-plugin-api/src/main/java/org/sonar/api/PropertyField.java index fc8258d2022..db7a16935a2 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/PropertyField.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/PropertyField.java @@ -52,15 +52,6 @@ public @interface PropertyField { */ String description() default ""; - /** - * Indicative size of the field value in characters. This size is not validated, it is merely used by the GUI - * to size the different input fields of a property set. - * - * @deprecated since 6.1, as it was only used for UI. - */ - @Deprecated - int indicativeSize() default 20; - PropertyType type() default PropertyType.STRING; /** diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/AnalysisMode.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/AnalysisMode.java deleted file mode 100644 index 5397812fde1..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/AnalysisMode.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2021 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program 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. - * - * This program 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.batch; - -import org.sonarsource.api.sonarlint.SonarLintSide; - -/** - * Use this component to find the current running mode. - * @since 5.1 - * @deprecated since 7.3 preview mode deprecated since 6.6 - */ -@ScannerSide -@SonarLintSide -@Deprecated -public interface AnalysisMode { - boolean isPreview(); - - /** - * @since 5.2 - */ - boolean isIssues(); - - boolean isPublish(); - -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/postjob/PostJobContext.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/postjob/PostJobContext.java index 27477366631..8a51f715955 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/postjob/PostJobContext.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/postjob/PostJobContext.java @@ -19,8 +19,6 @@ */ package org.sonar.api.batch.postjob; -import org.sonar.api.batch.AnalysisMode; -import org.sonar.api.batch.postjob.issue.PostJobIssue; import org.sonar.api.config.Configuration; /** @@ -34,29 +32,4 @@ public interface PostJobContext { * @since 6.5 */ Configuration config(); - - /** - * @deprecated since 7.3 preview mode deprecated since 6.6 - */ - @Deprecated - AnalysisMode analysisMode(); - - // ----------- Only available in preview mode -------------- - - /** - * All the unresolved issues of the project, including the issues reported by end-users. Only available in preview/issues mode. - * @throw {@link UnsupportedOperationException} if not in preview/issues mode. To test the mode you can use {@link #analysisMode()}. - * @deprecated since 7.3 the preview/issues mode is deprecated since 6.7 - */ - @Deprecated - Iterable<PostJobIssue> issues(); - - /** - * All the issues of this project that have been marked as resolved during this scan. Only available in preview/issues mode. - * @throw {@link UnsupportedOperationException} if not in preview mode. To test the mode you can use {@link #analysisMode()}. - * @deprecated since 7.3 the preview/issues mode is deprecated since 6.7 - */ - @Deprecated - Iterable<PostJobIssue> resolvedIssues(); - } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/Checks.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/Checks.java index 82b2b2db482..360488d1085 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/Checks.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/Checks.java @@ -112,14 +112,6 @@ public class Checks<C> { return addAnnotatedChecks((Iterable) Arrays.asList(checkClassesOrObjects)); } - /** - * @deprecated since 5.2 use {@link #addAnnotatedChecks(Iterable)} - */ - @Deprecated - public Checks<C> addAnnotatedChecks(Collection checkClassesOrObjects) { - return addAnnotatedChecks((Iterable) checkClassesOrObjects); - } - public Checks<C> addAnnotatedChecks(Iterable checkClassesOrObjects) { Map<String, Object> checksByEngineKey = new HashMap<>(); for (Object checkClassesOrObject : checkClassesOrObjects) { diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/SensorContext.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/SensorContext.java index 4a95a52e6fc..97c6c61efc7 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/SensorContext.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/SensorContext.java @@ -57,7 +57,6 @@ public interface SensorContext { */ @Deprecated Settings settings(); - /** * Get settings of the project. * @since 6.5 diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/SensorDescriptor.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/SensorDescriptor.java index 5c001e1ab93..0117afae923 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/SensorDescriptor.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/SensorDescriptor.java @@ -71,22 +71,6 @@ public interface SensorDescriptor { SensorDescriptor createIssuesForRuleRepositories(String... repositoryKeys); /** - * Property this {@link Sensor} depends on. Used by the platform to skip execution of the {@link Sensor} when - * property is not set. - * @deprecated since 6.5 use {@link #onlyWhenConfiguration(Predicate)} - */ - @Deprecated - SensorDescriptor requireProperty(String... propertyKey); - - /** - * List properties this {@link Sensor} depends on. Used by the platform to skip execution of the {@link Sensor} when - * property is not set. - * @deprecated since 6.5 use {@link #onlyWhenConfiguration(Predicate)} - */ - @Deprecated - SensorDescriptor requireProperties(String... propertyKeys); - - /** * This sensor should be executed at the project level, instead of per-module. * @since 6.4 * @deprecated since 7.6 change your {@link Sensor} to a {@link ProjectSensor} instead diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/coverage/CoverageType.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/coverage/CoverageType.java deleted file mode 100644 index a24b2e19844..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/coverage/CoverageType.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2021 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program 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. - * - * This program 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.batch.sensor.coverage; - -/** - * Different coverage categories. - * @since 5.2 - * - * @deprecated since 6.2 SonarQube merge all coverage reports and don't keep track of different test category - */ -@Deprecated -public enum CoverageType { - - UNIT, - IT, - OVERALL - -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/coverage/NewCoverage.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/coverage/NewCoverage.java index 4f40e9426be..aed416ea521 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/coverage/NewCoverage.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/coverage/NewCoverage.java @@ -55,12 +55,6 @@ public interface NewCoverage { NewCoverage onFile(InputFile inputFile); /** - * @deprecated since 6.2 SonarQube merge all coverage reports and don't keep track of different test category - */ - @Deprecated - NewCoverage ofType(CoverageType type); - - /** * Call this method as many time as needed to report coverage hits per line. This method should only be called for executable lines. * @param line Line number (starts at 1). * @param hits Number of time the line was hit. diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/highlighting/NewHighlighting.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/highlighting/NewHighlighting.java index 8e9263258fa..0f7de907ade 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/highlighting/NewHighlighting.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/highlighting/NewHighlighting.java @@ -47,16 +47,6 @@ public interface NewHighlighting { /** * Call this method to indicate the type of text in a range. - * @param startOffset Starting position in file for this type of text. Beginning of a file starts with offset '0'. - * @param endOffset End position in file for this type of text. - * @param typeOfText see {@link TypeOfText} values. - * @deprecated since 5.6 Only supported to ease migration from old API. Please prefer other {@code highlight()} methods. - */ - @Deprecated - NewHighlighting highlight(int startOffset, int endOffset, TypeOfText typeOfText); - - /** - * Call this method to indicate the type of text in a range. * @param range Range of text to highlight. See for example {@link InputFile#newRange(int, int, int, int)}. * @param typeOfText see {@link TypeOfText} values. * @since 5.6 diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/highlighting/TypeOfText.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/highlighting/TypeOfText.java index 40e800cfa53..7a2d0bc9e72 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/highlighting/TypeOfText.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/highlighting/TypeOfText.java @@ -27,11 +27,7 @@ public enum TypeOfText { ANNOTATION("a"), CONSTANT("c"), COMMENT("cd"), - /** - * @deprecated use {@link #COMMENT} - */ - @Deprecated - CPP_DOC("cppd"), + /** * For example Javadoc */ diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/symbol/NewSymbol.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/symbol/NewSymbol.java index 22077458384..480c668d856 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/symbol/NewSymbol.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/symbol/NewSymbol.java @@ -27,16 +27,6 @@ import org.sonar.api.batch.fs.TextRange; * @since 5.6 */ public interface NewSymbol { - - /** - * Register a new symbol reference. - * @param startOffset Starting position in file for the declaration of this symbol. Beginning of a file starts with offset '0'. - * @param endOffset End position in file for this symbol declaration. - * @deprecated since 6.1 Only supported to ease migration from old API. Please prefer other {@code newReference()} methods. - */ - @Deprecated - NewSymbol newReference(int startOffset, int endOffset); - /** * Register a new symbol. * @param range Range of text for the symbol declaration. See for example {@link InputFile#newRange(int, int, int, int)}. diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/symbol/NewSymbolTable.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/symbol/NewSymbolTable.java index f61965eb410..2d2d851ee2b 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/symbol/NewSymbolTable.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/symbol/NewSymbolTable.java @@ -50,15 +50,6 @@ public interface NewSymbolTable { /** * Register a new symbol declaration. - * @param startOffset Starting position in file for the declaration of this symbol. Beginning of a file starts with offset '0'. - * @param endOffset End position in file for this symbol declaration. - * @deprecated since 5.6 Only supported to ease migration from old API. Please prefer {@link #newSymbol(int, int, int, int)}. - */ - @Deprecated - NewSymbol newSymbol(int startOffset, int endOffset); - - /** - * Register a new symbol declaration. * @param range Range of text for the symbol declaration. See for example {@link InputFile#newRange(int, int, int, int)}. */ NewSymbol newSymbol(TextRange range); diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/component/Perspective.java b/sonar-plugin-api/src/main/java/org/sonar/api/component/Perspective.java deleted file mode 100644 index 146f63a9275..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/component/Perspective.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2021 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program 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. - * - * This program 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.component; - -/** - * @deprecated since 5.2 - */ -@Deprecated -public interface Perspective { -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/component/ResourcePerspectives.java b/sonar-plugin-api/src/main/java/org/sonar/api/component/ResourcePerspectives.java deleted file mode 100644 index 1f313aebac6..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/component/ResourcePerspectives.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2021 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program 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. - * - * This program 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.component; - -import javax.annotation.CheckForNull; -import org.sonar.api.batch.fs.InputFile; -import org.sonar.api.batch.fs.InputPath; -import org.sonar.api.batch.sensor.SensorContext; - -/** - * @since 3.5 - * @deprecated since 5.6 all features are available on {@link SensorContext} - */ -@Deprecated -public interface ResourcePerspectives { - - /** - * Allow to create perspective from {@link InputPath}. In particular from {@link InputFile}. - * - * @since 4.5.2 - */ - @CheckForNull <P extends Perspective> P as(Class<P> perspectiveClass, InputPath inputPath); -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/component/package-info.java b/sonar-plugin-api/src/main/java/org/sonar/api/component/package-info.java deleted file mode 100644 index 4d16a11fe39..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/component/package-info.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2021 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program 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. - * - * This program 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. - */ -@ParametersAreNonnullByDefault -package org.sonar.api.component; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinition.java b/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinition.java index da3f1cc1c8c..c5870c1eba7 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinition.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinition.java @@ -28,7 +28,6 @@ import java.util.Set; import java.util.function.Function; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; -import java.util.stream.Stream; import javax.annotation.Nullable; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.math.NumberUtils; @@ -42,7 +41,6 @@ import org.sonar.api.server.ServerSide; import org.sonarsource.api.sonarlint.SonarLintSide; import static java.util.Arrays.asList; -import static java.util.Arrays.stream; import static java.util.Collections.unmodifiableSet; import static java.util.Objects.requireNonNull; import static org.apache.commons.lang.StringUtils.isBlank; @@ -110,7 +108,6 @@ public final class PropertyDefinition { private List<String> qualifiers; private boolean global; private boolean multiValues; - private String propertySetKey; private String deprecatedKey; private List<PropertyFieldDefinition> fields; /** @@ -130,7 +127,6 @@ public final class PropertyDefinition { this.type = builder.type; this.options = builder.options; this.multiValues = builder.multiValues; - this.propertySetKey = builder.propertySetKey; this.fields = builder.fields; this.deprecatedKey = builder.deprecatedKey; this.qualifiers = builder.onQualifiers; @@ -155,7 +151,6 @@ public final class PropertyDefinition { .type(annotation.type()) .options(asList(annotation.options())) .multiValues(annotation.multiValues()) - .propertySetKey(annotation.propertySetKey()) .fields(PropertyFieldDefinition.create(annotation.fields())) .deprecatedKey(annotation.deprecatedKey()); List<String> qualifiers = new ArrayList<>(); @@ -312,14 +307,6 @@ public final class PropertyDefinition { return multiValues; } - /** - * @deprecated since 6.1, as it was not used and too complex to maintain. - */ - @Deprecated - public String propertySetKey() { - return propertySetKey; - } - public List<PropertyFieldDefinition> fields() { return fields; } @@ -338,10 +325,7 @@ public final class PropertyDefinition { @Override public String toString() { - if (isEmpty(propertySetKey)) { - return key; - } - return new StringBuilder().append(propertySetKey).append('|').append(key).toString(); + return key; } public static final class Result { @@ -386,7 +370,6 @@ public final class PropertyDefinition { private PropertyType type = PropertyType.STRING; private List<String> options = new ArrayList<>(); private boolean multiValues = false; - private String propertySetKey = ""; private List<PropertyFieldDefinition> fields = new ArrayList<>(); private String deprecatedKey = ""; private boolean hidden = false; @@ -552,15 +535,6 @@ public final class PropertyDefinition { return this; } - /** - * @deprecated since 6.1, as it was not used and too complex to maintain. - */ - @Deprecated - public Builder propertySetKey(String propertySetKey) { - this.propertySetKey = propertySetKey; - return this; - } - public Builder fields(PropertyFieldDefinition first, PropertyFieldDefinition... rest) { this.fields.add(first); this.fields.addAll(asList(rest)); diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyFieldDefinition.java b/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyFieldDefinition.java index c22b458ba57..8233148f96a 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyFieldDefinition.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyFieldDefinition.java @@ -36,7 +36,6 @@ public final class PropertyFieldDefinition { private final String key; private final String name; private final String description; - private final int indicativeSize; private final PropertyType type; private final List<String> options; @@ -44,7 +43,6 @@ public final class PropertyFieldDefinition { this.key = builder.key; this.name = builder.name; this.description = builder.description; - this.indicativeSize = builder.indicativeSize; this.type = builder.type; this.options = builder.options; } @@ -55,7 +53,6 @@ public final class PropertyFieldDefinition { definitions.add(PropertyFieldDefinition.build(field.key()) .name(field.name()) .description(field.description()) - .indicativeSize(field.indicativeSize()) .type(field.type()) .options(field.options()) .build()); @@ -79,14 +76,6 @@ public final class PropertyFieldDefinition { return description; } - /** - * @deprecated since 6.1, as it was only used for UI. - */ - @Deprecated - public int indicativeSize() { - return indicativeSize; - } - public PropertyType type() { return type; } @@ -103,7 +92,6 @@ public final class PropertyFieldDefinition { private String key; private String name; private String description; - private int indicativeSize; private PropertyType type; private List<String> options; @@ -111,7 +99,6 @@ public final class PropertyFieldDefinition { this.key = key; this.name = ""; this.description = ""; - this.indicativeSize = 20; this.type = PropertyType.STRING; this.options = new ArrayList<>(); } @@ -126,15 +113,6 @@ public final class PropertyFieldDefinition { return this; } - /** - * @deprecated since 6.1, as it was only used for UI. - */ - @Deprecated - public Builder indicativeSize(int indicativeSize) { - this.indicativeSize = indicativeSize; - return this; - } - public Builder type(PropertyType type) { this.type = type; return this; diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/measures/MetricFinder.java b/sonar-plugin-api/src/main/java/org/sonar/api/measures/MetricFinder.java deleted file mode 100644 index 1bb809f57da..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/measures/MetricFinder.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2021 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program 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. - * - * This program 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.measures; - -import java.util.Collection; -import java.util.List; -import javax.annotation.CheckForNull; -import org.sonar.api.scanner.ScannerSide; -import org.sonar.api.ce.ComputeEngineSide; -import org.sonar.api.server.ServerSide; - -/** - * @since 2.5 - * @deprecated since 5.1 use {@link org.sonar.api.batch.measure.MetricFinder} on scanner side. - */ -@Deprecated -@ScannerSide -@ServerSide -@ComputeEngineSide -public interface MetricFinder { - - @CheckForNull - Metric findByUuid(String uuid); - - @CheckForNull - Metric findByKey(String key); - - Collection<Metric> findAll(List<String> metricKeys); - - Collection<Metric> findAll(); -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/platform/Server.java b/sonar-plugin-api/src/main/java/org/sonar/api/platform/Server.java index 856c9236864..ed512c862c7 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/platform/Server.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/platform/Server.java @@ -70,13 +70,6 @@ public abstract class Server { public abstract Date getStartedAt(); /** - * @deprecated in 6.0. Replaced by {@link ServerFileSystem#getHomeDir()} - * @return an existing directory in server and CE environments, {@code null} in scanner. - */ - @Deprecated - public abstract File getRootDir(); - - /** * Context path of web server. Value is blank {@code ""} by default. When defined by * the property {@code sonar.web.context} of conf/sonar.properties, then value starts but does * not end with slash {@code '/'}, for instance {@code "/sonarqube"}. @@ -93,15 +86,6 @@ public abstract class Server { public abstract String getPublicRootUrl(); /** - * Before version 6.6, the dev mode is enabled when the property {@code sonar.web.dev} is {@code true}. - * Since 6.6, {@code false} is always returned. - * @deprecated in 6.6 - * @since 5.4 - */ - @Deprecated - public abstract boolean isDev(); - - /** * Return whether or not the {#getPublicRootUrl} is started with https. * * @since 5.4 @@ -109,12 +93,4 @@ public abstract class Server { */ @Deprecated public abstract boolean isSecured(); - - /** - * @return the server URL - * @since since 2.4 on batch side only, since 5.6 on both batch side and server side (WebServer and Compute Engine) - * @deprecated since 6.5, please use {@link #getPublicRootUrl()} instead - */ - @Deprecated - public abstract String getURL(); } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/profiles/AnnotationProfileParser.java b/sonar-plugin-api/src/main/java/org/sonar/api/profiles/AnnotationProfileParser.java deleted file mode 100644 index ab6e1acec56..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/profiles/AnnotationProfileParser.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2021 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program 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. - * - * This program 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.profiles; - -import java.util.Collection; -import org.apache.commons.lang.StringUtils; -import org.sonar.api.ce.ComputeEngineSide; -import org.sonar.api.rules.Rule; -import org.sonar.api.rules.RuleAnnotationUtils; -import org.sonar.api.rules.RuleFinder; -import org.sonar.api.rules.RulePriority; -import org.sonar.api.server.ServerSide; -import org.sonar.api.server.profile.BuiltInQualityProfileAnnotationLoader; -import org.sonar.api.utils.ValidationMessages; -import org.sonar.check.BelongsToProfile; - -/** - * @since 2.3 - * @deprecated since 6.6 use {@link BuiltInQualityProfileAnnotationLoader} - */ -@ServerSide -@ComputeEngineSide -@Deprecated -public final class AnnotationProfileParser { - - private final RuleFinder ruleFinder; - - public AnnotationProfileParser(RuleFinder ruleFinder) { - this.ruleFinder = ruleFinder; - } - - public RulesProfile parse(String repositoryKey, String profileName, String language, Collection<Class> annotatedClasses, ValidationMessages messages) { - RulesProfile profile = RulesProfile.create(profileName, language); - for (Class<?> aClass : annotatedClasses) { - BelongsToProfile belongsToProfile = aClass.getAnnotation(BelongsToProfile.class); - addRule(aClass, belongsToProfile, profile, repositoryKey, messages); - } - return profile; - } - - private void addRule(Class aClass, BelongsToProfile annotation, RulesProfile profile, String repositoryKey, ValidationMessages messages) { - if ((annotation != null) && StringUtils.equals(annotation.title(), profile.getName())) { - String ruleKey = RuleAnnotationUtils.getRuleKey(aClass); - Rule rule = ruleFinder.findByKey(repositoryKey, ruleKey); - if (rule == null) { - messages.addWarningText("Rule not found: [repository=" + repositoryKey + ", key=" + ruleKey + "]"); - - } else { - RulePriority priority = null; - if (annotation.priority() != null) { - priority = RulePriority.fromCheckPriority(annotation.priority()); - } - profile.activateRule(rule, priority); - } - } - } -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/profiles/ProfileDefinition.java b/sonar-plugin-api/src/main/java/org/sonar/api/profiles/ProfileDefinition.java deleted file mode 100644 index 893b2bf0eec..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/profiles/ProfileDefinition.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2021 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program 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. - * - * This program 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.profiles; - -import org.sonar.api.ExtensionPoint; -import org.sonar.api.server.ServerSide; -import org.sonar.api.server.profile.BuiltInQualityProfilesDefinition; -import org.sonar.api.utils.ValidationMessages; - -/** - * Define a profile which is automatically registered during sonar startup. - * The components <code>AnnotationProfileParser</code> and <code>XMLProfileParser</code> can be used to help implementing the method create(). - * - * @since 2.3 - * @deprecated since 6.6 use {@link BuiltInQualityProfilesDefinition} - */ -@ServerSide -@ExtensionPoint -@Deprecated -public abstract class ProfileDefinition { - - public abstract RulesProfile createProfile(ValidationMessages validation); - -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/profiles/RulesProfile.java b/sonar-plugin-api/src/main/java/org/sonar/api/profiles/RulesProfile.java index dce5f21559e..c7d408b6d19 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/profiles/RulesProfile.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/profiles/RulesProfile.java @@ -36,28 +36,6 @@ import org.sonar.api.utils.MessageException; * This class is badly named. It should be "QualityProfile". Indeed it does not relate only to rules but to metric thresholds too. */ public class RulesProfile implements Cloneable { - - /** - * Name of the default profile "Sonar Way" - * @deprecated in 4.2. Use your own constant. - */ - @Deprecated - public static final String SONAR_WAY_NAME = "Sonar way"; - - /** - * Name of the default java profile "Sonar way with Findbugs" - * @deprecated in 4.2. Use your own constant. - */ - @Deprecated - public static final String SONAR_WAY_FINDBUGS_NAME = "Sonar way with Findbugs"; - - /** - * Name of the default java profile "Sun checks" - * @deprecated in 4.2. Use your own constant. - */ - @Deprecated - public static final String SUN_CONVENTIONS_NAME = "Sun checks"; - private String name; private Boolean defaultProfile = Boolean.FALSE; private String language; @@ -213,28 +191,6 @@ public class RulesProfile implements Cloneable { } /** - * Does nothing. - * - * @return {@code null} - * @deprecated in 6.5 - */ - @Deprecated - @CheckForNull - public String getParentName() { - return null; - } - - /** - * Does nothing. - * - * @deprecated in 6.5 - */ - @Deprecated - public void setParentName(String parentName) { - // does nothing - } - - /** * Note: disabled rules are excluded. * * @return the list of active rules for a given severity diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRule.java b/sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRule.java index ff6b5250357..698c039d06b 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRule.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRule.java @@ -20,10 +20,8 @@ package org.sonar.api.rules; import java.util.ArrayList; -import java.util.Date; import java.util.List; import java.util.stream.Collectors; -import javax.annotation.CheckForNull; import javax.annotation.Nullable; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.builder.ToStringBuilder; @@ -139,22 +137,6 @@ public class ActiveRule implements Cloneable { this.severity = severity; } - /** - * @deprecated since 2.5 use {@link #getSeverity()} instead. See http://jira.sonarsource.com/browse/SONAR-1829 - */ - @Deprecated - public RulePriority getPriority() { - return severity; - } - - /** - * @deprecated since 2.5 use {@link #setSeverity(RulePriority)} instead. See http://jira.sonarsource.com/browse/SONAR-1829 - */ - @Deprecated - public void setPriority(RulePriority priority) { - this.severity = priority; - } - public RulesProfile getRulesProfile() { return rulesProfile; } @@ -224,46 +206,6 @@ public class ActiveRule implements Cloneable { return rule.getKey(); } - /** - * @since 4.2 - * @deprecated in 4.4. Feature dropped. - */ - @CheckForNull - @Deprecated - public String getNoteData() { - return null; - } - - /** - * @since 4.2 - * @deprecated in 4.4. Feature dropped. - */ - @CheckForNull - @Deprecated - public String getNoteUserLogin() { - return null; - } - - /** - * @since 4.2 - * @deprecated in 4.4. Feature dropped. - */ - @CheckForNull - @Deprecated - public Date getNoteCreatedAt() { - return null; - } - - /** - * @since 4.2 - * @deprecated in 4.4. Feature dropped. - */ - @CheckForNull - @Deprecated - public Date getNoteUpdatedAt() { - return null; - } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/rules/Rule.java b/sonar-plugin-api/src/main/java/org/sonar/api/rules/Rule.java index 67e2584c93e..321869833af 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/rules/Rule.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/rules/Rule.java @@ -397,52 +397,6 @@ public class Rule { return this; } - /** - * For internal use only. - * - * @since 4.3 - * @deprecated since 4.4, use {@link #getCharacteristicKey()} - */ - @CheckForNull - @Deprecated - public Integer getCharacteristicId() { - return null; - } - - /** - * For internal use only. - * - * @since 4.3 - * @deprecated since 4.4, use {@link #setCharacteristicKey(String)} - */ - @Deprecated - public Rule setCharacteristicId(@Nullable Integer characteristicId) { - return this; - } - - /** - * For internal use only. - * - * @since 4.3 - * @deprecated since 4.4, use {@link #getDefaultCharacteristicKey()} - */ - @CheckForNull - @Deprecated - public Integer getDefaultCharacteristicId() { - return null; - } - - /** - * For internal use only. - * - * @since 4.3 - * @deprecated since 4.4, use {@link #setDefaultCharacteristicKey(String)} - */ - @Deprecated - public Rule setDefaultCharacteristicId(@Nullable Integer defaultCharacteristicId) { - return this; - } - @Override public boolean equals(Object obj) { if (!(obj instanceof Rule)) { @@ -518,79 +472,4 @@ public class Rule { return RuleKey.of(getRepositoryKey(), getKey()); } - /** - * @since 4.4 - * @deprecated in 5.5. SQALE Quality Model is replaced by SonarQube Quality Model. - */ - @CheckForNull - @Deprecated - public String getDefaultCharacteristicKey() { - return null; - } - - /** - * @since 4.4 - * @deprecated in 5.5. SQALE Quality Model is replaced by SonarQube Quality Model. - */ - @Deprecated - public Rule setDefaultCharacteristicKey(@Nullable String defaultCharacteristicKey) { - return this; - } - - /** - * @since 4.4 - * @deprecated in 5.5. SQALE Quality Model is replaced by SonarQube Quality Model. - */ - @CheckForNull - @Deprecated - public String getDefaultSubCharacteristicKey() { - return null; - } - - /** - * @since 4.4 - * @deprecated in 5.5. SQALE Quality Model is replaced by SonarQube Quality Model. - */ - @Deprecated - public Rule setDefaultSubCharacteristicKey(@Nullable String defaultSubCharacteristicKey) { - return this; - } - - /** - * @since 4.4 - * @deprecated in 5.5. SQALE Quality Model is replaced by SonarQube Quality Model. - */ - @CheckForNull - @Deprecated - public String getCharacteristicKey() { - return null; - } - - /** - * @since 4.4 - * @deprecated in 5.5. SQALE Quality Model is replaced by SonarQube Quality Model. - */ - @Deprecated - public Rule setCharacteristicKey(@Nullable String characteristicKey) { - return this; - } - - /** - * @since 4.4 - * @deprecated in 5.5. SQALE Quality Model is replaced by SonarQube Quality Model. - */ - @CheckForNull - @Deprecated - public String getSubCharacteristicKey() { - return null; - } - - /** - * @since 4.4 - * @deprecated in 5.5. SQALE Quality Model is replaced by SonarQube Quality Model. - */ - @Deprecated - public Rule setSubCharacteristicKey(@Nullable String subCharacteristicKey) { - return this; - } } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/security/ExternalGroupsProvider.java b/sonar-plugin-api/src/main/java/org/sonar/api/security/ExternalGroupsProvider.java index e101296cec3..eb83eba50bd 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/security/ExternalGroupsProvider.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/security/ExternalGroupsProvider.java @@ -20,6 +20,7 @@ package org.sonar.api.security; import java.util.Collection; +import javax.annotation.CheckForNull; import javax.servlet.http.HttpServletRequest; /** @@ -31,24 +32,15 @@ import javax.servlet.http.HttpServletRequest; public abstract class ExternalGroupsProvider { /** - * @return list of groups associated with specified user, or null if such user doesn't exist - * @throws RuntimeException in case of unexpected error such as connection failure - * @deprecated replaced by {@link #doGetGroups(org.sonar.api.security.ExternalGroupsProvider.Context)} since v. 5.2 - */ - @Deprecated - public Collection<String> doGetGroups(String username) { - return null; - } - - /** * Override this method in order to load user group information. * * @return list of groups associated with specified user, or null if such user doesn't exist * @throws RuntimeException in case of unexpected error such as connection failure * @since 5.2 */ + @CheckForNull public Collection<String> doGetGroups(Context context) { - return doGetGroups(context.getUsername()); + return null; } public static final class Context { diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/security/ExternalUsersProvider.java b/sonar-plugin-api/src/main/java/org/sonar/api/security/ExternalUsersProvider.java index 78db7a119e2..de353cea13c 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/security/ExternalUsersProvider.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/security/ExternalUsersProvider.java @@ -29,20 +29,6 @@ import javax.servlet.http.HttpServletRequest; * @since 2.14 */ public abstract class ExternalUsersProvider { - - /** - * This method is overridden by old versions of plugins such as LDAP 1.1. It should not be overridden anymore. - * - * @param username the username - * @return details for specified user, or null if such user doesn't exist - * @throws RuntimeException in case of unexpected error such as connection failure - * @deprecated replaced by {@link #doGetUserDetails(org.sonar.api.security.ExternalUsersProvider.Context)} since v. 3.1 - */ - @Deprecated - public UserDetails doGetUserDetails(@Nullable String username) { - return null; - } - /** * Override this method in order load user information. * @@ -51,7 +37,7 @@ public abstract class ExternalUsersProvider { * @since 3.1 */ public UserDetails doGetUserDetails(Context context) { - return doGetUserDetails(context.getUsername()); + return null; } public static final class Context { diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/debt/DebtRemediationFunction.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/debt/DebtRemediationFunction.java index d7d1afd3eb6..9e63f079bad 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/server/debt/DebtRemediationFunction.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/debt/DebtRemediationFunction.java @@ -72,14 +72,6 @@ public interface DebtRemediationFunction { } /** - * @deprecated since 5.5, replaced by {@link #usesGapMultiplier()} - */ - @Deprecated - public boolean usesCoefficient() { - return usesGapMultiplier(); - } - - /** * @since 5.5 */ public boolean usesGapMultiplier() { @@ -87,14 +79,6 @@ public interface DebtRemediationFunction { } /** - * @deprecated since 5.5, replaced by {@link #usesBaseEffort()} - */ - @Deprecated - public boolean usesOffset() { - return usesBaseEffort(); - } - - /** * @since 5.5 */ public boolean usesBaseEffort() { @@ -109,13 +93,6 @@ public interface DebtRemediationFunction { Type type(); /** - * @deprecated since 5.5, replaced by {@link #gapMultiplier()} - */ - @Deprecated - @CheckForNull - String coefficient(); - - /** * Non-null value on {@link Type#LINEAR} and {@link Type#LINEAR_OFFSET} functions, else {@code null}. * * @since 5.5 @@ -124,13 +101,6 @@ public interface DebtRemediationFunction { String gapMultiplier(); /** - * @deprecated since 5.5, replaced by {@link #baseEffort()} - */ - @Deprecated - @CheckForNull - String offset(); - - /** * Non-null value on {@link Type#LINEAR_OFFSET} and {@link Type#CONSTANT_ISSUE} functions, else {@code null}. * * @since 5.5 diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/debt/internal/DefaultDebtRemediationFunction.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/debt/internal/DefaultDebtRemediationFunction.java index 660be9f01e0..c97ed0dfbc4 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/server/debt/internal/DefaultDebtRemediationFunction.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/debt/internal/DefaultDebtRemediationFunction.java @@ -61,32 +61,12 @@ public class DefaultDebtRemediationFunction implements DebtRemediationFunction { return type; } - /** - * @deprecated since 5.5, replaced by {@link #gapMultiplier} - */ - @Override - @CheckForNull - @Deprecated - public String coefficient() { - return gapMultiplier(); - } - @Override @CheckForNull public String gapMultiplier() { return gapMultiplier; } - /** - * @deprecated since 5.5, replaced by {@link #baseEffort} - */ - @Override - @CheckForNull - @Deprecated - public String offset() { - return baseEffort(); - } - @Override public String baseEffort() { return baseEffort; diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinition.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinition.java index 7c79672c5c4..82b7e3d6f11 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinition.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinition.java @@ -41,7 +41,6 @@ import org.sonar.api.server.rule.internal.DefaultNewRepository; import org.sonar.api.server.rule.internal.DefaultRepository; import org.sonarsource.api.sonarlint.SonarLintSide; -import static java.util.Collections.emptyList; import static java.util.Collections.unmodifiableList; import static org.sonar.api.utils.Preconditions.checkState; @@ -129,230 +128,6 @@ import static org.sonar.api.utils.Preconditions.checkState; @SonarLintSide @ExtensionPoint public interface RulesDefinition { - - /** - * Default sub-characteristics of technical debt model. See http://www.sqale.org - * - * @deprecated in 5.5. SQALE Quality Model is replaced by SonarQube Quality Model. - * See https://jira.sonarsource.com/browse/MMF-184 - */ - @Deprecated - final class SubCharacteristics { - /** - * Related to characteristic REUSABILITY - */ - public static final String MODULARITY = "MODULARITY"; - - /** - * Related to characteristic REUSABILITY - */ - public static final String TRANSPORTABILITY = "TRANSPORTABILITY"; - - /** - * Related to characteristic PORTABILITY - */ - public static final String COMPILER_RELATED_PORTABILITY = "COMPILER_RELATED_PORTABILITY"; - - /** - * Related to characteristic PORTABILITY - */ - public static final String HARDWARE_RELATED_PORTABILITY = "HARDWARE_RELATED_PORTABILITY"; - - /** - * Related to characteristic PORTABILITY - */ - public static final String LANGUAGE_RELATED_PORTABILITY = "LANGUAGE_RELATED_PORTABILITY"; - - /** - * Related to characteristic PORTABILITY - */ - public static final String OS_RELATED_PORTABILITY = "OS_RELATED_PORTABILITY"; - - /** - * Related to characteristic PORTABILITY - */ - public static final String SOFTWARE_RELATED_PORTABILITY = "SOFTWARE_RELATED_PORTABILITY"; - - /** - * Related to characteristic PORTABILITY - */ - public static final String TIME_ZONE_RELATED_PORTABILITY = "TIME_ZONE_RELATED_PORTABILITY"; - - /** - * Related to characteristic MAINTAINABILITY - */ - public static final String READABILITY = "READABILITY"; - - /** - * Related to characteristic MAINTAINABILITY - */ - public static final String UNDERSTANDABILITY = "UNDERSTANDABILITY"; - - /** - * Related to characteristic SECURITY - */ - public static final String API_ABUSE = "API_ABUSE"; - - /** - * Related to characteristic SECURITY - */ - public static final String ERRORS = "ERRORS"; - - /** - * Related to characteristic SECURITY - */ - public static final String INPUT_VALIDATION_AND_REPRESENTATION = "INPUT_VALIDATION_AND_REPRESENTATION"; - - /** - * Related to characteristic SECURITY - */ - public static final String SECURITY_FEATURES = "SECURITY_FEATURES"; - - /** - * Related to characteristic EFFICIENCY - */ - public static final String CPU_EFFICIENCY = "CPU_EFFICIENCY"; - - /** - * Related to characteristic EFFICIENCY - */ - public static final String MEMORY_EFFICIENCY = "MEMORY_EFFICIENCY"; - - /** - * Related to characteristic EFFICIENCY - */ - public static final String NETWORK_USE = "NETWORK_USE"; - - /** - * Related to characteristic CHANGEABILITY - */ - public static final String ARCHITECTURE_CHANGEABILITY = "ARCHITECTURE_CHANGEABILITY"; - - /** - * Related to characteristic CHANGEABILITY - */ - public static final String DATA_CHANGEABILITY = "DATA_CHANGEABILITY"; - - /** - * Related to characteristic CHANGEABILITY - */ - public static final String LOGIC_CHANGEABILITY = "LOGIC_CHANGEABILITY"; - - /** - * Related to characteristic RELIABILITY - */ - public static final String ARCHITECTURE_RELIABILITY = "ARCHITECTURE_RELIABILITY"; - - /** - * Related to characteristic RELIABILITY - */ - public static final String DATA_RELIABILITY = "DATA_RELIABILITY"; - - /** - * Related to characteristic RELIABILITY - */ - public static final String EXCEPTION_HANDLING = "EXCEPTION_HANDLING"; - - /** - * Related to characteristic RELIABILITY - */ - public static final String FAULT_TOLERANCE = "FAULT_TOLERANCE"; - - /** - * Related to characteristic RELIABILITY - */ - public static final String INSTRUCTION_RELIABILITY = "INSTRUCTION_RELIABILITY"; - - /** - * Related to characteristic RELIABILITY - */ - public static final String LOGIC_RELIABILITY = "LOGIC_RELIABILITY"; - - /** - * Related to characteristic RELIABILITY - */ - public static final String RESOURCE_RELIABILITY = "RESOURCE_RELIABILITY"; - - /** - * Related to characteristic RELIABILITY - */ - public static final String SYNCHRONIZATION_RELIABILITY = "SYNCHRONIZATION_RELIABILITY"; - - /** - * Related to characteristic RELIABILITY - */ - public static final String UNIT_TESTS = "UNIT_TESTS"; - - /** - * Related to characteristic TESTABILITY - */ - public static final String INTEGRATION_TESTABILITY = "INTEGRATION_TESTABILITY"; - - /** - * Related to characteristic TESTABILITY - */ - public static final String UNIT_TESTABILITY = "UNIT_TESTABILITY"; - - /** - * Related to characteristic ACCESSIBILITY - */ - public static final String USABILITY_ACCESSIBILITY = "USABILITY_ACCESSIBILITY"; - - /** - * Related to characteristic ACCESSIBILITY - */ - public static final String USABILITY_COMPLIANCE = "USABILITY_COMPLIANCE"; - - /** - * Related to characteristic ACCESSIBILITY - */ - public static final String USABILITY_EASE_OF_USE = "USABILITY_EASE_OF_USE"; - - /** - * Related to characteristic REUSABILITY - */ - public static final String REUSABILITY_COMPLIANCE = "REUSABILITY_COMPLIANCE"; - - /** - * Related to characteristic PORTABILITY - */ - public static final String PORTABILITY_COMPLIANCE = "PORTABILITY_COMPLIANCE"; - - /** - * Related to characteristic MAINTAINABILITY - */ - public static final String MAINTAINABILITY_COMPLIANCE = "MAINTAINABILITY_COMPLIANCE"; - - /** - * Related to characteristic SECURITY - */ - public static final String SECURITY_COMPLIANCE = "SECURITY_COMPLIANCE"; - - /** - * Related to characteristic EFFICIENCY - */ - public static final String EFFICIENCY_COMPLIANCE = "EFFICIENCY_COMPLIANCE"; - - /** - * Related to characteristic CHANGEABILITY - */ - public static final String CHANGEABILITY_COMPLIANCE = "CHANGEABILITY_COMPLIANCE"; - - /** - * Related to characteristic RELIABILITY - */ - public static final String RELIABILITY_COMPLIANCE = "RELIABILITY_COMPLIANCE"; - - /** - * Related to characteristic TESTABILITY - */ - public static final String TESTABILITY_COMPLIANCE = "TESTABILITY_COMPLIANCE"; - - private SubCharacteristics() { - // only constants - } - } - /** * This implementation will be removed as soon as analyzers stop instantiating it. * Use RulesDefinitionContext in sonar-plugin-api-impl. @@ -372,12 +147,6 @@ public interface RulesDefinition { } @Override - @Deprecated - public RulesDefinition.NewRepository extendRepository(String key, String language) { - return createRepository(key, language); - } - - @Override @CheckForNull public RulesDefinition.Repository repository(String key) { return repositoriesByKey.get(key); @@ -388,18 +157,6 @@ public interface RulesDefinition { return unmodifiableList(new ArrayList<>(repositoriesByKey.values())); } - @Override - @Deprecated - public List<RulesDefinition.ExtendedRepository> extendedRepositories(String repositoryKey) { - return emptyList(); - } - - @Override - @Deprecated - public List<RulesDefinition.ExtendedRepository> extendedRepositories() { - return emptyList(); - } - public void registerRepository(DefaultNewRepository newRepository) { RulesDefinition.Repository existing = repositoriesByKey.get(newRepository.key()); if (existing != null) { @@ -442,31 +199,11 @@ public interface RulesDefinition { */ public abstract NewRepository createExternalRepository(String engineId, String language); - /** - * @deprecated since 5.2. Simply use {@link #createRepository(String, String)} - */ - @Deprecated - public abstract NewRepository extendRepository(String key, String language); - @CheckForNull public abstract Repository repository(String key); public abstract List<Repository> repositories(); - /** - * @deprecated returns empty list since 5.2. Concept of "extended repository" was misleading and not valuable. Simply declare - * repositories and use {@link #repositories()}. See http://jira.sonarsource.com/browse/SONAR-6709 - */ - @Deprecated - public abstract List<ExtendedRepository> extendedRepositories(String repositoryKey); - - /** - * @deprecated returns empty list since 5.2. Concept of "extended repository" was misleading and not valuable. Simply declare - * repositories and use {@link #repositories()}. See http://jira.sonarsource.com/browse/SONAR-6709 - */ - @Deprecated - public abstract List<ExtendedRepository> extendedRepositories(); - public abstract void setCurrentPluginKey(@Nullable String pluginKey); } @@ -640,17 +377,6 @@ public interface RulesDefinition { public abstract NewRule setStatus(RuleStatus status); /** - * SQALE sub-characteristic. See http://www.sqale.org - * - * @see org.sonar.api.server.rule.RulesDefinition.SubCharacteristics for constant values - * @see #setType(RuleType) - * @deprecated in 5.5. SQALE Quality Model is replaced by SonarQube Quality Model. This method does nothing. - * See https://jira.sonarsource.com/browse/MMF-184 - */ - @Deprecated - public abstract NewRule setDebtSubCharacteristic(@Nullable String s); - - /** * Factory of {@link org.sonar.api.server.debt.DebtRemediationFunction} */ public abstract DebtRemediationFunctions debtRemediationFunctions(); @@ -661,12 +387,6 @@ public interface RulesDefinition { public abstract NewRule setDebtRemediationFunction(@Nullable DebtRemediationFunction fn); /** - * @deprecated since 5.5, replaced by {@link #setGapDescription(String)} - */ - @Deprecated - public abstract NewRule setEffortToFixDescription(@Nullable String s); - - /** * For rules that use LINEAR or LINEAR_OFFSET remediation functions, the meaning * of the function parameter (= "gap") must be set. This description * explains what 1 point of "gap" represents for the rule. @@ -772,25 +492,9 @@ public interface RulesDefinition { public abstract RuleStatus status(); - /** - * @see #type() - * @deprecated in 5.5. SQALE Quality Model is replaced by SonarQube Quality Model. {@code null} is - * always returned. See https://jira.sonarsource.com/browse/MMF-184 - */ - @CheckForNull - @Deprecated - public abstract String debtSubCharacteristic(); - @CheckForNull public abstract DebtRemediationFunction debtRemediationFunction(); - /** - * @deprecated since 5.5, replaced by {@link #gapDescription()} - */ - @Deprecated - @CheckForNull - public abstract String effortToFixDescription(); - @CheckForNull public abstract String gapDescription(); diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinitionXmlLoader.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinitionXmlLoader.java index 22761952985..2f3397736cb 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinitionXmlLoader.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinitionXmlLoader.java @@ -130,25 +130,25 @@ import static org.apache.commons.lang.StringUtils.trim; * * <!-- Quality Model - type of debt remediation function --> * <!-- See enum {@link org.sonar.api.server.debt.DebtRemediationFunction.Type} for supported values --> - * <!-- It was previously named 'debtRemediationFunction' which is still supported but deprecated since 5.5 --> + * <!-- It was previously named 'debtRemediationFunction'. --> * <!-- Since 5.5 --> * <remediationFunction>LINEAR_OFFSET</remediationFunction> * * <!-- Quality Model - raw description of the "gap", used for some types of remediation functions. --> * <!-- See {@link org.sonar.api.server.rule.RulesDefinition.NewRule#setGapDescription(String)} --> - * <!-- It was previously named 'effortToFixDescription' which is still supported but deprecated since 5.5 --> + * <!-- It was previously named 'effortToFixDescription'. --> * <!-- Since 5.5 --> * <gapDescription>Effort to test one uncovered condition</gapFixDescription> * * <!-- Quality Model - gap multiplier of debt remediation function. Must be defined only for some function types. --> * <!-- See {@link org.sonar.api.server.rule.RulesDefinition.DebtRemediationFunctions} --> - * <!-- It was previously named 'debtRemediationFunctionCoefficient' which is still supported but deprecated since 5.5 --> + * <!-- It was previously named 'debtRemediationFunctionCoefficient'. --> * <!-- Since 5.5 --> * <remediationFunctionGapMultiplier>10min</remediationFunctionGapMultiplier> * * <!-- Quality Model - base effort of debt remediation function. Must be defined only for some function types. --> * <!-- See {@link org.sonar.api.server.rule.RulesDefinition.DebtRemediationFunctions} --> - * <!-- It was previously named 'debtRemediationFunctionOffset' which is still supported but deprecated since 5.5 --> + * <!-- It was previously named 'debtRemediationFunctionOffset'. --> * <!-- Since 5.5 --> * <remediationFunctionBaseEffort>2min</remediationFunctionBaseEffort> * diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/internal/DefaultNewRule.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/internal/DefaultNewRule.java index b20bda996fb..317952fda9a 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/internal/DefaultNewRule.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/internal/DefaultNewRule.java @@ -173,11 +173,6 @@ class DefaultNewRule extends RulesDefinition.NewRule { } @Override - public DefaultNewRule setDebtSubCharacteristic(@Nullable String s) { - return this; - } - - @Override public RulesDefinition.DebtRemediationFunctions debtRemediationFunctions() { return functions; } @@ -188,12 +183,6 @@ class DefaultNewRule extends RulesDefinition.NewRule { return this; } - @Deprecated - @Override - public DefaultNewRule setEffortToFixDescription(@Nullable String s) { - return setGapDescription(s); - } - @Override public DefaultNewRule setGapDescription(@Nullable String s) { this.gapDescription = s; diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/internal/DefaultRule.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/internal/DefaultRule.java index 9f2ea372229..0a43784f5af 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/internal/DefaultRule.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/internal/DefaultRule.java @@ -155,25 +155,11 @@ public class DefaultRule extends RulesDefinition.Rule { } @CheckForNull - @Deprecated - @Override - public String debtSubCharacteristic() { - return null; - } - - @CheckForNull @Override public DebtRemediationFunction debtRemediationFunction() { return debtRemediationFunction; } - @Deprecated - @CheckForNull - @Override - public String effortToFixDescription() { - return gapDescription(); - } - @CheckForNull @Override public String gapDescription() { diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/Request.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/Request.java index 00b576a3165..7a7e6f0889a 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/Request.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/Request.java @@ -33,7 +33,6 @@ import java.util.function.Supplier; import java.util.stream.Collectors; import javax.annotation.CheckForNull; import javax.annotation.Nullable; -import org.apache.commons.lang.StringUtils; import org.sonar.api.utils.DateUtils; import static java.lang.String.format; @@ -149,45 +148,6 @@ public abstract class Request { return part; } - /** - * @deprecated to be dropped in 4.4. Default values are declared in ws metadata - */ - @CheckForNull - @Deprecated - public String param(String key, @CheckForNull String defaultValue) { - return StringUtils.defaultString(param(key), defaultValue); - } - - /** - * @deprecated to be dropped in 4.4. Default values must be declared in {@link org.sonar.api.server.ws.WebService} then - * this method can be replaced by {@link #mandatoryParamAsBoolean(String)}. - */ - @Deprecated - public boolean paramAsBoolean(String key, boolean defaultValue) { - String value = param(key); - return value == null ? defaultValue : parseBoolean(key, value); - } - - /** - * @deprecated to be dropped in 4.4. Default values must be declared in {@link org.sonar.api.server.ws.WebService} then - * this method can be replaced by {@link #mandatoryParamAsInt(String)}. - */ - @Deprecated - public int paramAsInt(String key, int defaultValue) { - String s = param(key); - return s == null ? defaultValue : parseInt(key, s); - } - - /** - * @deprecated to be dropped in 4.4. Default values must be declared in {@link org.sonar.api.server.ws.WebService} then - * this method can be replaced by {@link #mandatoryParamAsLong(String)}. - */ - @Deprecated - public long paramAsLong(String key, long defaultValue) { - String s = param(key); - return s == null ? defaultValue : parseLong(key, s); - } - @CheckForNull public Boolean paramAsBoolean(String key) { String value = param(key); diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java index 91ecd219408..6e4e59b84a7 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java @@ -674,17 +674,6 @@ public interface WebService extends Definable<WebService.Context> { } /** - * @see #setDeprecatedKey(String, String) - * @since 5.0 - * @deprecated since 6.4 - */ - @Deprecated - public NewParam setDeprecatedKey(@Nullable String s) { - this.deprecatedKey = s; - return this; - } - - /** * @param deprecatedSince Version when the old key was replaced/deprecated. Ex: 5.6 * @see Param#deprecatedKey() * @since 6.4 diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/task/TaskComponent.java b/sonar-plugin-api/src/main/java/org/sonar/api/task/TaskComponent.java deleted file mode 100644 index d6ec4dcd4b0..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/task/TaskComponent.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2021 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program 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. - * - * This program 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.task; - -import org.sonar.api.batch.ScannerSide; -import org.sonar.api.batch.InstantiationStrategy; - -/** - * All the classes implementing this interface can be injected in public constructors of {@link TaskExtension}. - * - * @since 3.6 - * @deprecated since 5.1. Use {@link ScannerSide} and {@link InstantiationStrategy#PER_TASK} - */ -@Deprecated -@ScannerSide -@InstantiationStrategy(InstantiationStrategy.PER_TASK) -public interface TaskComponent { -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/task/TaskExtension.java b/sonar-plugin-api/src/main/java/org/sonar/api/task/TaskExtension.java deleted file mode 100644 index 256c3303c51..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/task/TaskExtension.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2021 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program 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. - * - * This program 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.task; - -import org.sonar.api.batch.ScannerSide; -import org.sonar.api.batch.InstantiationStrategy; - -/** - * Task extension point - * - * @since 3.6 - * @deprecated since 5.1. Not used. - */ -@Deprecated -@ScannerSide -@InstantiationStrategy(InstantiationStrategy.PER_TASK) -public interface TaskExtension { -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/test/CoverageBlock.java b/sonar-plugin-api/src/main/java/org/sonar/api/test/CoverageBlock.java deleted file mode 100644 index e5705cfb4da..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/test/CoverageBlock.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2021 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program 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. - * - * This program 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.test; - -import java.util.List; - -/** - * @deprecated since 5.6. Feature will be removed without any alternatives. - */ -@Deprecated -public interface CoverageBlock { - - TestCase testCase(); - - Testable testable(); - - List<Integer> lines(); -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/test/MutableTestCase.java b/sonar-plugin-api/src/main/java/org/sonar/api/test/MutableTestCase.java deleted file mode 100644 index 238122e87f3..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/test/MutableTestCase.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2021 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program 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. - * - * This program 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.test; - -import java.util.List; -import javax.annotation.Nullable; -import org.sonar.api.batch.fs.InputFile; - -/** - * @deprecated since 5.6. Feature will be removed without any alternatives. - */ -@Deprecated -public interface MutableTestCase extends TestCase { - MutableTestCase setStatus(@Nullable Status s); - - MutableTestCase setDurationInMs(@Nullable Long l); - - MutableTestCase setMessage(@Nullable String s); - - MutableTestCase setStackTrace(@Nullable String s); - - /** - * @deprecated since 5.2 not used - */ - @Deprecated - MutableTestCase setType(@Nullable String s); - - /** - * @deprecated since 5.2. Use {@link #setCoverageBlock(InputFile, List)} - */ - @Deprecated - MutableTestCase setCoverageBlock(Testable testable, List<Integer> lines); - - MutableTestCase setCoverageBlock(InputFile mainFile, List<Integer> lines); -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/test/MutableTestPlan.java b/sonar-plugin-api/src/main/java/org/sonar/api/test/MutableTestPlan.java deleted file mode 100644 index 69b90697ded..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/test/MutableTestPlan.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2021 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program 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. - * - * This program 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.test; - -/** - * @deprecated since 5.6. Feature will be removed without any alternatives. - */ -@Deprecated -public interface MutableTestPlan extends TestPlan<MutableTestCase> { - - /** - * Add a {@link TestCase} to this test file. - * Note that a same physical test (for example in Java a single method annotated with @Test) - * can be executed several times (parameterized tests, different test suites, ...). As a result it is perfectly valid to register several - * tests with the same name. Anyway in this situation the coverage per test will be merged for all tests with the same name. - * @param name - * @return - */ - MutableTestCase addTestCase(String name); - -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/test/MutableTestable.java b/sonar-plugin-api/src/main/java/org/sonar/api/test/MutableTestable.java deleted file mode 100644 index d98f72a9a57..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/test/MutableTestable.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2021 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program 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. - * - * This program 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.test; - -/** - * @deprecated since 5.6. Feature will be removed without any alternatives. - */ -@Deprecated -public interface MutableTestable extends Testable { - -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/test/TestCase.java b/sonar-plugin-api/src/main/java/org/sonar/api/test/TestCase.java deleted file mode 100644 index 92d732a957e..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/test/TestCase.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2021 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program 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. - * - * This program 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.test; - -import java.util.Locale; -import javax.annotation.CheckForNull; -import javax.annotation.Nullable; - -/** - * @deprecated since 5.2 not used - */ -@Deprecated -public interface TestCase { - enum Status { - OK, FAILURE, ERROR, SKIPPED; - - public static Status of(@Nullable String s) { - return s == null ? null : valueOf(s.toUpperCase(Locale.ENGLISH)); - } - } - - /** - * @deprecated since 5.2 not used - */ - @Deprecated - String TYPE_UNIT = "UNIT"; - /** - * @deprecated since 5.2 not used - */ - @Deprecated - String TYPE_INTEGRATION = "INTEGRATION"; - - /** - * Duration in milliseconds - */ - @CheckForNull - Long durationInMs(); - - /** - * @deprecated since 5.2 not used - */ - @Deprecated - String type(); - - Status status(); - - String name(); - - @CheckForNull - String message(); - - @CheckForNull - String stackTrace(); - - TestPlan testPlan(); - - boolean doesCover(); - - int countCoveredLines(); - - Iterable<CoverageBlock> coverageBlocks(); - - @CheckForNull - CoverageBlock coverageBlock(Testable testable); -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/test/TestPlan.java b/sonar-plugin-api/src/main/java/org/sonar/api/test/TestPlan.java deleted file mode 100644 index bcf78350e5f..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/test/TestPlan.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2021 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program 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. - * - * This program 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.test; - -import org.sonar.api.component.Perspective; - -/** - * @deprecated since 5.2 not used - */ -@Deprecated -public interface TestPlan<T extends TestCase> extends Perspective { - Iterable<T> testCases(); - - Iterable<T> testCasesByName(String name); -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/test/Testable.java b/sonar-plugin-api/src/main/java/org/sonar/api/test/Testable.java deleted file mode 100644 index bb33fa54587..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/test/Testable.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2021 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program 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. - * - * This program 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.test; - -import java.util.List; -import java.util.Map; -import java.util.SortedSet; -import org.sonar.api.component.Perspective; - -/** - * @deprecated since 5.2 - */ -@Deprecated -public interface Testable extends Perspective { - - List<TestCase> testCases(); - - TestCase testCaseByName(String key); - - int countTestCasesOfLine(Integer line); - - Map<Integer, Integer> testCasesByLines(); - - List<TestCase> testCasesOfLine(int line); - - SortedSet<Integer> testedLines(); - - CoverageBlock coverageBlock(TestCase testCase); - - Iterable<CoverageBlock> coverageBlocks(); -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/test/exception/CoverageAlreadyExistsException.java b/sonar-plugin-api/src/main/java/org/sonar/api/test/exception/CoverageAlreadyExistsException.java deleted file mode 100644 index 64179bb3d3b..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/test/exception/CoverageAlreadyExistsException.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2021 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program 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. - * - * This program 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.test.exception; - -/** - * @deprecated since 5.6 feature will be removed soon - */ -@Deprecated -public class CoverageAlreadyExistsException extends TestException { - public CoverageAlreadyExistsException(String message) { - super(message); - } -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/test/exception/IllegalDurationException.java b/sonar-plugin-api/src/main/java/org/sonar/api/test/exception/IllegalDurationException.java deleted file mode 100644 index 51f40ae767e..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/test/exception/IllegalDurationException.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2021 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program 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. - * - * This program 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.test.exception; - -/** - * @deprecated since 5.6 feature will be removed soon - */ -@Deprecated -public class IllegalDurationException extends TestException { - public IllegalDurationException(String message) { - super(message); - } -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/test/exception/TestException.java b/sonar-plugin-api/src/main/java/org/sonar/api/test/exception/TestException.java deleted file mode 100644 index b5f4dba1464..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/test/exception/TestException.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2021 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program 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. - * - * This program 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.test.exception; - -/** - * @deprecated since 5.6 feature will be removed soon - */ -@Deprecated -public class TestException extends RuntimeException { - public TestException(String message) { - super(message); - } - - public TestException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/test/exception/package-info.java b/sonar-plugin-api/src/main/java/org/sonar/api/test/exception/package-info.java deleted file mode 100644 index 54c99e78d83..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/test/exception/package-info.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2021 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program 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. - * - * This program 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. - */ -@ParametersAreNonnullByDefault -package org.sonar.api.test.exception; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/test/package-info.java b/sonar-plugin-api/src/main/java/org/sonar/api/test/package-info.java deleted file mode 100644 index b7fe3d16fc0..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/test/package-info.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2021 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program 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. - * - * This program 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. - */ -@ParametersAreNonnullByDefault -package org.sonar.api.test; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/AnnotationUtils.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/AnnotationUtils.java index ed10b6ef86b..eb98a6ca8fd 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/AnnotationUtils.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/AnnotationUtils.java @@ -58,14 +58,4 @@ public final class AnnotationUtils { return null; } - - /** - * Searches for a class annotation. All inheritance tree is analysed. - * - * @deprecated As of 3.1, replaced by {@link #getAnnotation(Object,Class)} - */ - @Deprecated - public static <A> A getClassAnnotation(Object object, Class<A> annotationClass) { - return (A) getAnnotation(object, (Class<? extends Annotation>) annotationClass); - } } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/Durations.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/Durations.java index f535a3889f8..2ebe6b25896 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/Durations.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/Durations.java @@ -19,7 +19,6 @@ */ package org.sonar.api.utils; -import java.util.Locale; import org.sonar.api.ce.ComputeEngineSide; import org.sonar.api.server.ServerSide; @@ -37,18 +36,6 @@ public class Durations { private static final int HOURS_IN_DAY = 8; /** - * @deprecated since 6.3, only one format is available - */ - @Deprecated - public enum DurationFormat { - /** - * Display duration with only one or two members. - * For instance, Duration.decode("1d 1h 10min", 8) will return "1d 1h" and Duration.decode("12d 5h", 8) will return "12d" - */ - SHORT - } - - /** * Create a Duration object from a number of minutes */ public Duration create(long minutes) { @@ -76,28 +63,6 @@ public class Durations { } /** - * Return the formatted work duration. - * - * @deprecated since 6.3 as the {@link Locale#ENGLISH} is always used. Use {@link #format(Duration)} instead - */ - @Deprecated - public String format(Locale locale, Duration duration, DurationFormat format) { - return format(duration); - } - - /** - * Return the formatted work duration. - * <br> - * Example : format(Locale.FRENCH, Duration.encode("9d 10h"), DurationFormat.SHORT) -> 10d 2d - * - * @deprecated since 6.3 as the {@link Locale#ENGLISH} is always used. Use {@link #format(Duration)} instead - */ - @Deprecated - public String format(Locale locale, Duration duration) { - return format(duration); - } - - /** * Return the formatted work duration using the english bundles. * <br> * Example : format(Duration.encode("9d 10h")) -> 10d 2h diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/Paging.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/Paging.java index dc3b62c190a..c554fe561e6 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/Paging.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/Paging.java @@ -39,14 +39,6 @@ public class Paging { this.total = total; } - /** - * @deprecated since 5.2 please use the #forPgeIndex(...) builder method - */ - @Deprecated - public static Paging create(int pageSize, int pageIndex, int totalItems) { - return new Paging(pageSize, pageIndex, totalItems); - } - public static Builder forPageIndex(int pageIndex) { return new Builder(pageIndex); } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/System2.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/System2.java index dc0ae87db7d..c324b1ccc75 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/System2.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/System2.java @@ -133,17 +133,6 @@ public class System2 { return SystemUtils.IS_OS_MAC; } - /** - * True if Java 7 or Java 8 runtime environment - * - * @since 4.3 - * @deprecated in 6.4. Java 8+ is required, so this method always returns {@code true}. - */ - @Deprecated - public boolean isJavaAtLeast17() { - return true; - } - public void println(String obj) { System.out.print(obj); } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/Version.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/Version.java index 3a0c867afab..9a1e939a64a 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/Version.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/Version.java @@ -152,14 +152,6 @@ public class Version implements Comparable<Version> { return new Version(major, minor, patch, DEFAULT_BUILD_NUMBER, DEFAULT_QUALIFIER); } - /** - * @deprecated in 6.3 to avoid ambiguity with build number (see {@link #buildNumber()} - */ - @Deprecated - public static Version create(int major, int minor, int patch, String qualifier) { - return new Version(major, minor, patch, DEFAULT_BUILD_NUMBER, qualifier); - } - private static int parseFieldAsInt(String field) { if (field.isEmpty()) { return 0; 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 119da1876b1..3b311f22cce 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 @@ -64,14 +64,6 @@ public final class ZipUtils { } /** - * @deprecated replaced by {@link #unzip(InputStream, File, Predicate)} in 6.2. - */ - @Deprecated - public static File unzip(InputStream stream, File toDir, ZipEntryFilter filter) throws IOException { - return unzip(stream, toDir, new ZipEntryFilterDelegate(filter)); - } - - /** * Unzip a file to a directory. * * @param stream the zip input file @@ -118,14 +110,6 @@ public final class ZipUtils { } /** - * @deprecated replaced by {@link #unzip(File, File, Predicate)} in 6.2. - */ - @Deprecated - public static File unzip(File zip, File toDir, ZipEntryFilter filter) throws IOException { - return unzip(zip, toDir, new ZipEntryFilterDelegate(filter)); - } - - /** * Unzip a file to a directory. * * @param zip the zip file. It must exist. diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/ServletFilter.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/ServletFilter.java index ee66144d880..6270bef1cf6 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/web/ServletFilter.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/web/ServletFilter.java @@ -91,19 +91,6 @@ public abstract class ServletFilter implements Filter { return exclusions; } - /** - * @deprecated replaced in version 6.0 by {@link #getInclusions()} and {@link #getExclusions()} - * @throws IllegalStateException if at least one exclusion or more than one inclusions are defined - */ - @Deprecated - public String getUrl() { - // Before 6.0, it was only possible to include one url - if (exclusions.isEmpty() && inclusions.size() == 1) { - return inclusions.get(0); - } - throw new IllegalStateException("this method is deprecated and should not be used anymore"); - } - public String label() { return "UrlPattern{" + "inclusions=[" + convertPatternsToString(inclusions) + "]" + diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/config/PropertyDefinitionTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/config/PropertyDefinitionTest.java index 61aa1a20882..c0d90ca2d34 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/config/PropertyDefinitionTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/config/PropertyDefinitionTest.java @@ -59,7 +59,6 @@ public class PropertyDefinitionTest { .type(PropertyType.FLOAT) .onlyOnQualifiers(Qualifiers.MODULE) .multiValues(true) - .propertySetKey("set") .build(); assertThat(def.key()).isEqualTo("hello"); @@ -72,7 +71,6 @@ public class PropertyDefinitionTest { assertThat(def.global()).isFalse(); assertThat(def.qualifiers()).containsOnly(Qualifiers.MODULE); assertThat(def.multiValues()).isTrue(); - assertThat(def.propertySetKey()).isEqualTo("set"); assertThat(def.fields()).isEmpty(); } @@ -93,7 +91,6 @@ public class PropertyDefinitionTest { assertThat(def.global()).isFalse(); assertThat(def.qualifiers()).containsOnly(Qualifiers.PROJECT, Qualifiers.MODULE); assertThat(def.multiValues()).isTrue(); - assertThat(def.propertySetKey()).isEqualTo("set"); assertThat(def.fields()).isEmpty(); } @@ -125,7 +122,6 @@ public class PropertyDefinitionTest { assertThat(def.global()).isTrue(); assertThat(def.qualifiers()).isEmpty(); assertThat(def.multiValues()).isFalse(); - assertThat(def.propertySetKey()).isEmpty(); assertThat(def.fields()).isEmpty(); } @@ -146,7 +142,6 @@ public class PropertyDefinitionTest { assertThat(def.global()).isTrue(); assertThat(def.qualifiers()).isEmpty(); assertThat(def.multiValues()).isFalse(); - assertThat(def.propertySetKey()).isEmpty(); assertThat(def.fields()).isEmpty(); } @@ -156,7 +151,7 @@ public class PropertyDefinitionTest { .name("Hello") .fields( PropertyFieldDefinition.build("first").name("First").description("Description").options("A", "B").build(), - PropertyFieldDefinition.build("second").name("Second").type(PropertyType.INTEGER).indicativeSize(5).build()) + PropertyFieldDefinition.build("second").name("Second").type(PropertyType.INTEGER).build()) .build(); assertThat(def.type()).isEqualTo(PropertyType.PROPERTY_SET); @@ -166,12 +161,10 @@ public class PropertyDefinitionTest { assertThat(def.fields().get(0).description()).isEqualTo("Description"); assertThat(def.fields().get(0).type()).isEqualTo(PropertyType.STRING); assertThat(def.fields().get(0).options()).containsOnly("A", "B"); - assertThat(def.fields().get(0).indicativeSize()).isEqualTo(20); assertThat(def.fields().get(1).key()).isEqualTo("second"); assertThat(def.fields().get(1).name()).isEqualTo("Second"); assertThat(def.fields().get(1).type()).isEqualTo(PropertyType.INTEGER); assertThat(def.fields().get(1).options()).isEmpty(); - assertThat(def.fields().get(1).indicativeSize()).isEqualTo(5); } @Test @@ -188,12 +181,10 @@ public class PropertyDefinitionTest { assertThat(def.fields().get(0).description()).isEqualTo("Description"); assertThat(def.fields().get(0).type()).isEqualTo(PropertyType.STRING); assertThat(def.fields().get(0).options()).containsOnly("A", "B"); - assertThat(def.fields().get(0).indicativeSize()).isEqualTo(20); assertThat(def.fields().get(1).key()).isEqualTo("second"); assertThat(def.fields().get(1).name()).isEqualTo("Second"); assertThat(def.fields().get(1).type()).isEqualTo(PropertyType.INTEGER); assertThat(def.fields().get(1).options()).isEmpty(); - assertThat(def.fields().get(1).indicativeSize()).isEqualTo(5); } @Test @@ -458,7 +449,7 @@ public class PropertyDefinitionTest { @Properties(@Property(key = "hello", name = "Hello", fields = { @PropertyField(key = "first", name = "First", description = "Description", options = {"A", "B"}), - @PropertyField(key = "second", name = "Second", type = PropertyType.INTEGER, indicativeSize = 5)})) + @PropertyField(key = "second", name = "Second", type = PropertyType.INTEGER)})) static class WithPropertySet { } diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/profiles/AnnotationProfileParserTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/profiles/AnnotationProfileParserTest.java deleted file mode 100644 index 9536c53f76a..00000000000 --- a/sonar-plugin-api/src/test/java/org/sonar/api/profiles/AnnotationProfileParserTest.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2021 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program 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. - * - * This program 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.profiles; - -import com.google.common.collect.Lists; -import org.junit.Test; -import org.mockito.stubbing.Answer; -import org.sonar.api.rules.Rule; -import org.sonar.api.rules.RuleFinder; -import org.sonar.api.rules.RulePriority; -import org.sonar.api.utils.ValidationMessages; -import org.sonar.check.BelongsToProfile; -import org.sonar.check.Priority; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.ArgumentMatchers.anyString; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -public class AnnotationProfileParserTest { - - @Test - public void shouldParseAnnotatedClasses() { - RuleFinder ruleFinder = mock(RuleFinder.class); - when(ruleFinder.findByKey(anyString(), anyString())).thenAnswer( - (Answer) iom -> Rule.create((String) iom.getArguments()[0], (String) iom.getArguments()[1], (String) iom.getArguments()[1])); - - ValidationMessages messages = ValidationMessages.create(); - RulesProfile profile = new AnnotationProfileParser(ruleFinder).parse("squid", "Foo way", "java", Lists.newArrayList(FakeRule.class), messages); - - assertThat(profile.getName()).isEqualTo("Foo way"); - assertThat(profile.getLanguage()).isEqualTo("java"); - assertThat(profile.getActiveRule("squid", "fake").getSeverity()).isEqualTo(RulePriority.BLOCKER); - assertThat(messages.hasErrors()).isFalse(); - } - - @Test - public void shouldParseOnlyWantedProfile() { - RuleFinder ruleFinder = mock(RuleFinder.class); - when(ruleFinder.findByKey(anyString(), anyString())).thenAnswer( - (Answer<Rule>) iom -> Rule.create((String) iom.getArguments()[0], (String) iom.getArguments()[1], (String) iom.getArguments()[1])); - - ValidationMessages messages = ValidationMessages.create(); - RulesProfile profile = new AnnotationProfileParser(ruleFinder).parse("squid", "Foo way", "java", Lists.newArrayList(FakeRule.class, RuleOnOtherProfile.class), messages); - - assertThat(profile.getActiveRule("squid", "fake")).isNotNull(); - assertThat(profile.getActiveRule("squid", "other")).isNull(); - } -} - -@BelongsToProfile(title = "Other profile", priority = Priority.BLOCKER) -@org.sonar.check.Rule(key = "other", priority = Priority.CRITICAL) -class RuleOnOtherProfile { -} - -@BelongsToProfile(title = "Foo way", priority = Priority.BLOCKER) -@org.sonar.check.Rule(key = "fake", priority = Priority.CRITICAL) -class FakeRule { -} diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/security/ExternalGroupsProviderTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/security/ExternalGroupsProviderTest.java index 94ffb2ef1cc..bd1bc4c722f 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/security/ExternalGroupsProviderTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/security/ExternalGroupsProviderTest.java @@ -39,7 +39,6 @@ public class ExternalGroupsProviderTest { }; String userName = "foo"; - assertThat(groupsProvider.doGetGroups(userName)).isNull(); assertThat(groupsProvider.doGetGroups(new ExternalGroupsProvider.Context(userName, mock(HttpServletRequest.class)))).isNull(); } @@ -61,22 +60,6 @@ public class ExternalGroupsProviderTest { runDoGetGroupsTests(groupsProvider, userGroupsMap); } - @Test - public void doGetGroupsDeprecatedApi() { - final Map<String, Collection<String>> userGroupsMap = getTestUserGroupMapping(); - - ExternalGroupsProvider groupsProvider = new ExternalGroupsProvider() { - @Override - public Collection<String> doGetGroups(String username) { - Preconditions.checkNotNull(username); - - return userGroupsMap.get(username); - } - }; - - runDoGetGroupsTests(groupsProvider, userGroupsMap); - } - private static void runDoGetGroupsTests(ExternalGroupsProvider groupsProvider, Map<String, Collection<String>> userGroupsMap) { for (Map.Entry<String, Collection<String>> userGroupMapEntry : userGroupsMap.entrySet()) { Collection<String> groups = groupsProvider.doGetGroups(new ExternalGroupsProvider.Context( diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/security/ExternalUsersProviderTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/security/ExternalUsersProviderTest.java index 9437518f57a..90552931374 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/security/ExternalUsersProviderTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/security/ExternalUsersProviderTest.java @@ -47,21 +47,4 @@ public class ExternalUsersProviderTest { assertThat(user.getName()).isEqualTo("foo"); assertThat(user.getEmail()).isEqualTo("foo@bar.com"); } - - @Test - public void doGetUserDetails_deprecated_api() { - ExternalUsersProvider provider = new ExternalUsersProvider() { - @Override - public UserDetails doGetUserDetails(String username) { - UserDetails user = new UserDetails(); - user.setName(username); - user.setEmail("foo@bar.com"); - return user; - } - }; - UserDetails user = provider.doGetUserDetails(new ExternalUsersProvider.Context("foo", mock(HttpServletRequest.class))); - - assertThat(user.getName()).isEqualTo("foo"); - assertThat(user.getEmail()).isEqualTo("foo@bar.com"); - } } diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/server/rule/RulesDefinitionTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/server/rule/RulesDefinitionTest.java index fe17affc6db..a965ce51e76 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/server/rule/RulesDefinitionTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/server/rule/RulesDefinitionTest.java @@ -29,13 +29,12 @@ import java.net.URL; import java.util.List; import java.util.Set; import java.util.stream.Collectors; -import org.junit.Assert; import org.junit.Assume; import org.junit.Rule; import org.junit.Test; -import org.junit.jupiter.api.Assertions; import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; +import org.sonar.api.impl.server.RulesDefinitionContext; import org.sonar.api.rule.RuleKey; import org.sonar.api.rule.RuleScope; import org.sonar.api.rule.RuleStatus; @@ -43,12 +42,9 @@ import org.sonar.api.rule.Severity; import org.sonar.api.rules.RuleType; import org.sonar.api.server.debt.DebtRemediationFunction; import org.sonar.api.utils.log.LogTester; -import org.sonar.api.impl.server.RulesDefinitionContext; import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.useDefaultDateFormatsOnly; import static org.junit.Assert.fail; -import static org.junit.jupiter.api.Assertions.assertEquals; @RunWith(DataProviderRunner.class) public class RulesDefinitionTest { @@ -577,17 +573,6 @@ public class RulesDefinitionTest { } @Test - public void sqale_characteristic_is_deprecated_and_is_ignored() { - RulesDefinition.NewRepository newRepository = context.createRepository("findbugs", "java"); - newRepository.createRule("NPE").setName("NPE").setHtmlDescription("desc") - .setDebtSubCharacteristic(RulesDefinition.SubCharacteristics.API_ABUSE); - newRepository.done(); - - RulesDefinition.Rule rule = context.repository("findbugs").rule("NPE"); - assertThat(rule.debtSubCharacteristic()).isNull(); - } - - @Test public void type_is_defined() { RulesDefinition.NewRepository newRepository = context.createRepository("findbugs", "java"); newRepository.createRule("NPE").setName("NPE").setHtmlDescription("desc") diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/server/rule/RulesDefinitionXmlLoaderTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/server/rule/RulesDefinitionXmlLoaderTest.java index c45475af3a9..47a80d25b28 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/server/rule/RulesDefinitionXmlLoaderTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/server/rule/RulesDefinitionXmlLoaderTest.java @@ -230,25 +230,6 @@ public class RulesDefinitionXmlLoaderTest { } @Test - public void ignore_deprecated_sqale_characteristic() { - String xml = "" + - "<rules>" + - " <rule>" + - " <key>1</key>" + - " <name>One</name>" + - " <description>Desc</description>" + - " <effortToFixDescription>lines</effortToFixDescription>" + - " <debtSubCharacteristic>BUG</debtSubCharacteristic>" + - " <remediationFunction>LINEAR_OFFSET</remediationFunction>" + - " <remediationFunctionGapMultiplier>2d 3h</remediationFunctionGapMultiplier>" + - " <remediationFunctionBaseEffort>5min</remediationFunctionBaseEffort>" + - " </rule>" + - "</rules>"; - RulesDefinition.Rule rule = load(xml).rule("1"); - assertThat(rule.debtSubCharacteristic()).isNull(); - } - - @Test public void markdown_description() { String xml = "" + "<rules>" + diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/server/rule/internal/DefaultNewRuleTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/server/rule/internal/DefaultNewRuleTest.java index c482d9c6945..a8eb9d21bae 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/server/rule/internal/DefaultNewRuleTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/server/rule/internal/DefaultNewRuleTest.java @@ -67,12 +67,9 @@ public class DefaultNewRuleTest { rule.addTags("tag3"); assertThat(rule.tags()).containsExactly("tag1", "tag2", "tag3"); - rule.setEffortToFixDescription("effort"); + rule.setGapDescription("effort"); assertThat(rule.gapDescription()).isEqualTo("effort"); - rule.setGapDescription("gap"); - assertThat(rule.gapDescription()).isEqualTo("gap"); - rule.setInternalKey("internal"); assertThat(rule.internalKey()).isEqualTo("internal"); diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/server/rule/internal/DefaultRuleTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/server/rule/internal/DefaultRuleTest.java index a8b6a1b5ec8..4d266504e4f 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/server/rule/internal/DefaultRuleTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/server/rule/internal/DefaultRuleTest.java @@ -44,7 +44,6 @@ public class DefaultRuleTest { RulesDefinition.NewParam param1 = rule.createParam("param1"); rule.setTags("tag1", "tag2"); rule.addTags("tag3"); - rule.setEffortToFixDescription("effort"); rule.setGapDescription("gap"); rule.setInternalKey("internal"); rule.addDeprecatedRuleKey("deprecatedrepo", "deprecatedkey"); @@ -64,7 +63,6 @@ public class DefaultRuleTest { assertThat(defaultRule.activatedByDefault()).isTrue(); assertThat(defaultRule.params()).containsOnly(new DefaultParam(new DefaultNewParam("param1"))); assertThat(defaultRule.tags()).containsOnly("tag1", "tag2", "tag3"); - assertThat(defaultRule.effortToFixDescription()).isEqualTo("gap"); assertThat(defaultRule.gapDescription()).isEqualTo("gap"); assertThat(defaultRule.internalKey()).isEqualTo("internal"); assertThat(defaultRule.deprecatedRuleKeys()).containsOnly(RuleKey.of("deprecatedrepo", "deprecatedkey")); diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/server/ws/RequestTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/server/ws/RequestTest.java index 2cb3d37f714..2baebb55587 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/server/ws/RequestTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/server/ws/RequestTest.java @@ -227,8 +227,6 @@ public class RequestTest { @Test public void paramAsInt() { assertThat(underTest.setParam("a_number", "123").paramAsInt("a_number")).isEqualTo(123); - assertThat(underTest.setParam("a_number", "123").paramAsInt("a_number", 42)).isEqualTo(123); - assertThat(underTest.setParam("a_number", null).paramAsInt("a_number", 42)).isEqualTo(123); } @Test @@ -240,18 +238,8 @@ public class RequestTest { } @Test - public void fail_when_param_is_not_an_int_with_default_value() { - expectedException.expect(IllegalArgumentException.class); - expectedException.expectMessage("The 'a_number' parameter cannot be parsed as an integer value: not_an_int"); - - underTest.setParam("a_number", "not_an_int").paramAsInt("a_number", 42); - } - - @Test public void param_as_long() { assertThat(underTest.setParam("a_number", "123").paramAsLong("a_number")).isEqualTo(123L); - assertThat(underTest.setParam("a_number", "123").paramAsLong("a_number", 42L)).isEqualTo(123L); - assertThat(underTest.setParam("a_number", null).paramAsLong("a_number", 42L)).isEqualTo(123L); } @Test @@ -263,14 +251,6 @@ public class RequestTest { } @Test - public void fail_when_param_is_not_a_long_with_default_value() { - expectedException.expect(IllegalArgumentException.class); - expectedException.expectMessage("The 'a_number' parameter cannot be parsed as a long value: not_a_long"); - - underTest.setParam("a_number", "not_a_long").paramAsLong("a_number", 42L); - } - - @Test public void param_as_boolean() { assertThat(underTest.setParam("a_boolean", "true").paramAsBoolean("a_boolean")).isTrue(); assertThat(underTest.setParam("a_boolean", "yes").paramAsBoolean("a_boolean")).isTrue(); diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/test/TestCaseTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/test/TestCaseTest.java deleted file mode 100644 index 5f2b44aefe3..00000000000 --- a/sonar-plugin-api/src/test/java/org/sonar/api/test/TestCaseTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2021 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program 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. - * - * This program 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.test; - -import org.junit.Test; - -import static org.assertj.core.api.Assertions.assertThat; - -public class TestCaseTest { - @Test - public void value_of_status() { - assertThat(TestCase.Status.of("OK")).isEqualTo(TestCase.Status.OK); - assertThat(TestCase.Status.of("OK")).isEqualTo(TestCase.Status.OK); - assertThat(TestCase.Status.of(null)).isNull(); - } -} diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/utils/AnnotationUtilsTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/utils/AnnotationUtilsTest.java index ae241088844..b0b487cf2a4 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/utils/AnnotationUtilsTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/utils/AnnotationUtilsTest.java @@ -37,12 +37,6 @@ public class AnnotationUtilsTest { } @Test - public void getClassAnnotationWithDeprecatedMethod() { - FakeAnnotation annotation = AnnotationUtils.getClassAnnotation(new SuperClass(), FakeAnnotation.class); - assertThat(annotation.value()).isEqualTo("foo"); - } - - @Test public void searchClassAnnotationInSuperClass() { FakeAnnotation annotation = AnnotationUtils.getAnnotation(new ChildClass(), FakeAnnotation.class); assertThat(annotation.value()).isEqualTo("foo"); diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/utils/System2Test.java b/sonar-plugin-api/src/test/java/org/sonar/api/utils/System2Test.java index 395b6566c9b..6fcd1f07d24 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/utils/System2Test.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/utils/System2Test.java @@ -89,11 +89,6 @@ public class System2Test { } @Test - public void isJavaAtLeast17_always_returns_true() { - assertThat(System2.INSTANCE.isJavaAtLeast17()).isTrue(); - } - - @Test public void testPrintln() { // well, how to assert that ? Adding a System3 dependency to System2 ? :-) System2.INSTANCE.println("foo"); diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/utils/VersionTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/utils/VersionTest.java index 2c71bfd18e0..c7b904292e6 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/utils/VersionTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/utils/VersionTest.java @@ -123,9 +123,6 @@ public class VersionTest { public void test_create() { assertVersion(Version.create(1, 2), 1, 2, 0, 0, ""); assertVersion(Version.create(1, 2, 3), 1, 2, 3, 0, ""); - assertVersion(Version.create(1, 2, 0, ""), 1, 2, 0, 0, ""); - assertVersion(Version.create(1, 2, 3, "build1"), 1, 2, 3, 0, "build1"); - assertThat(Version.create(1, 2, 3, "build1").toString()).isEqualTo("1.2.3-build1"); } diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/utils/ZipUtilsTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/utils/ZipUtilsTest.java index 7e498be7e10..bcdad396650 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/utils/ZipUtilsTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/utils/ZipUtilsTest.java @@ -92,24 +92,6 @@ public class ZipUtilsTest { } @Test - public void unzipping_file_extracts_subset_of_files() throws IOException { - File zip = FileUtils.toFile(urlToZip()); - File toDir = temp.newFolder(); - - ZipUtils.unzip(zip, toDir, (ZipUtils.ZipEntryFilter)ze -> ze.getName().equals("foo.txt")); - assertThat(toDir.listFiles()).containsOnly(new File(toDir, "foo.txt")); - } - - @Test - public void unzipping_stream_extracts_subset_of_files() throws IOException { - InputStream zip = urlToZip().openStream(); - File toDir = temp.newFolder(); - - ZipUtils.unzip(zip, toDir, (ZipUtils.ZipEntryFilter)ze -> ze.getName().equals("foo.txt")); - assertThat(toDir.listFiles()).containsOnly(new File(toDir, "foo.txt")); - } - - @Test public void fail_if_unzipping_file_outside_target_directory() throws Exception { File zip = new File(getClass().getResource("ZipUtilsTest/zip-slip.zip").toURI()); File toDir = temp.newFolder(); diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/web/ServletFilterTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/web/ServletFilterTest.java index 15acc0ae17b..5fe2fdfc1b8 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/web/ServletFilterTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/web/ServletFilterTest.java @@ -208,19 +208,8 @@ public class ServletFilterTest { @Test public void getUrl_returns_single_inclusion() { - assertThat(ServletFilter.UrlPattern.create("/*").getUrl()).isEqualTo("/*"); - assertThat(ServletFilter.UrlPattern.create("/foo/bar").getUrl()).isEqualTo("/foo/bar"); - } - - @Test - public void getUrl_throws_ISE_if_many_urls() { - thrown.expect(IllegalStateException.class); - thrown.expectMessage("this method is deprecated and should not be used anymore"); - - ServletFilter.UrlPattern.builder() - .includes("/foo/*", "/foo/lo*") - .excludes("/foo/login", "/foo/logout", "/foo/list") - .build().getUrl(); + assertThat(ServletFilter.UrlPattern.create("/*").getInclusions()).containsOnly("/*"); + assertThat(ServletFilter.UrlPattern.create("/foo/bar").getInclusions()).containsOnly("/foo/bar"); } @Test |