]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-8793 Replace use of method to set a deprecated key
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Wed, 15 Feb 2017 11:03:37 +0000 (12:03 +0100)
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Thu, 16 Feb 2017 13:44:26 +0000 (14:44 +0100)
16 files changed:
server/sonar-server/src/main/java/org/sonar/server/ce/ws/ActivityAction.java
server/sonar-server/src/main/java/org/sonar/server/issue/ws/BulkChangeAction.java
server/sonar-server/src/main/java/org/sonar/server/issue/ws/DeleteCommentAction.java
server/sonar-server/src/main/java/org/sonar/server/issue/ws/EditCommentAction.java
server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java
server/sonar-server/src/main/java/org/sonar/server/issue/ws/SetTagsAction.java
server/sonar-server/src/main/java/org/sonar/server/project/ws/CreateAction.java
server/sonar-server/src/main/java/org/sonar/server/project/ws/IndexAction.java
server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/CreateAction.java
server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/ExportAction.java
server/sonar-server/src/main/java/org/sonar/server/setting/ws/ResetAction.java
server/sonar-server/src/main/java/org/sonar/server/setting/ws/SetAction.java
server/sonar-server/src/main/java/org/sonar/server/user/ws/CreateAction.java
server/sonar-server/src/main/java/org/sonar/server/user/ws/UpdateAction.java
sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java
sonar-plugin-api/src/test/java/org/sonar/api/server/ws/RequestTest.java

index ec0cea60a2d766bf0c442601ccf247c6cef26e9e..cbfeae84bc7e8cd47a8b0deaffa8045e60d80779 100644 (file)
@@ -146,7 +146,7 @@ public class ActivityAction implements CeWsAction {
     action.createParam(Param.PAGE)
       .setDescription("Deprecated parameter")
       .setDeprecatedSince("5.5")
-      .setDeprecatedKey("pageIndex");
+      .setDeprecatedKey("pageIndex", "5.4");
     action.addPageSize(100, MAX_PAGE_SIZE);
   }
 
index ee90f02e429d8dd1b93129db2279ad6c12c34a47..f9befa1c0e06ba5c276d22f388ba99e308df84ca 100644 (file)
@@ -139,18 +139,18 @@ public class BulkChangeAction implements IssuesWsAction {
     action.createParam(PARAM_ASSIGN)
       .setDescription("To assign the list of issues to a specific user (login), or un-assign all the issues")
       .setExampleValue("john.smith")
-      .setDeprecatedKey("assign.assignee");
+      .setDeprecatedKey("assign.assignee", "6.2");
     action.createParam(PARAM_SET_SEVERITY)
       .setDescription("To change the severity of the list of issues")
       .setExampleValue(BLOCKER)
       .setPossibleValues(Severity.ALL)
-      .setDeprecatedKey("set_severity.severity");
+      .setDeprecatedKey("set_severity.severity", "6.2");
     action.createParam(PARAM_SET_TYPE)
       .setDescription("To change the type of the list of issues")
       .setExampleValue(BUG)
       .setPossibleValues(RuleType.names())
       .setSince("5.5")
-      .setDeprecatedKey("set_type.type");
+      .setDeprecatedKey("set_type.type", "6.2");
     action.createParam(PARAM_PLAN)
       .setDescription("In 5.5, action plans are dropped. Has no effect. To plan the list of issues to a specific action plan (key), or unlink all the issues from an action plan")
       .setDeprecatedSince("5.5");
@@ -158,15 +158,15 @@ public class BulkChangeAction implements IssuesWsAction {
       .setDescription("Transition")
       .setExampleValue(REOPEN)
       .setPossibleValues(DefaultTransitions.ALL)
-      .setDeprecatedKey("do_transition.transition");
+      .setDeprecatedKey("do_transition.transition", "6.2");
     action.createParam(PARAM_ADD_TAGS)
       .setDescription("Add tags")
       .setExampleValue("security,java8")
-      .setDeprecatedKey("add_tags.tags");
+      .setDeprecatedKey("add_tags.tags", "6.2");
     action.createParam(PARAM_REMOVE_TAGS)
       .setDescription("Remove tags")
       .setExampleValue("security,java8")
-      .setDeprecatedKey("remove_tags.tags");
+      .setDeprecatedKey("remove_tags.tags", "6.2");
     action.createParam(PARAM_COMMENT)
       .setDescription("To add a comment to a list of issues")
       .setExampleValue("Here is my comment");
index b5c1fe8c99f50a68f5589fbf54b2e4a52d024342..f8a1720265e6b60faa90037f9cdecc119bffe9a1 100644 (file)
@@ -70,7 +70,7 @@ public class DeleteCommentAction implements IssuesWsAction {
 
     action.createParam(PARAM_COMMENT)
       .setDescription("Comment key")
-      .setDeprecatedKey("key")
+      .setDeprecatedKey("key", "6.3")
       .setSince("6.3")
       .setRequired(true)
       .setExampleValue(UUID_EXAMPLE_01);
index dea982f1d73356e1deb2a98e5602ff5d15aec7a3..df1248790bbad07b8699571b89510c5929ac2325 100644 (file)
@@ -76,7 +76,7 @@ public class EditCommentAction implements IssuesWsAction {
 
     action.createParam(PARAM_COMMENT)
       .setDescription("Comment key")
-      .setDeprecatedKey("key")
+      .setDeprecatedKey("key", "6.3")
       .setSince("6.3")
       .setRequired(true)
       .setExampleValue(UUID_EXAMPLE_01);
index 06cce4c77bf5c3c94840cc82de63b0be15ddf19e..ab5dd8ba3aafe3b35c4c0b99b0c1a030a3dbcf4f 100644 (file)
@@ -253,12 +253,14 @@ public class SearchAction implements IssuesWsAction {
     action.createParam(PARAM_PROJECTS)
       .setDeprecatedSince("5.1")
       .setDescription("See projectKeys");
+
     action.createParam(PARAM_PROJECT_KEYS)
       .setDescription("To retrieve issues associated to a specific list of projects (comma-separated list of project keys). " +
         INTERNAL_PARAMETER_DISCLAIMER +
         "If this parameter is set, projectUuids must not be set.")
-      .setDeprecatedKey(PARAM_PROJECTS)
+      .setDeprecatedKey(PARAM_PROJECTS, "6.3")
       .setExampleValue(KEY_PROJECT_EXAMPLE_001);
+
     action.createParam(PARAM_PROJECT_UUIDS)
       .setDescription("To retrieve issues associated to a specific list of projects (comma-separated list of project UUIDs). " +
         INTERNAL_PARAMETER_DISCLAIMER +
index 1e3e26f464488d5b029a3b9e9811a74ca405bdfb..79250c1c12bbf52fc5c1100186983f0e55d5785a 100644 (file)
@@ -60,7 +60,7 @@ public class SetTagsAction implements IssuesWsAction {
     action.createParam(PARAM_ISSUE)
       .setDescription("Issue key")
       .setSince("6.3")
-      .setDeprecatedKey("key")
+      .setDeprecatedKey("key", "6.3")
       .setExampleValue(Uuids.UUID_EXAMPLE_01)
       .setRequired(true);
     action.createParam(PARAM_TAGS)
index e87c06105dfc2d9f3eff03645358676e2b9dee60..07fd764887aaa896531015f2c372bd339aa2cd70 100644 (file)
@@ -77,7 +77,7 @@ public class CreateAction implements ProjectsWsAction {
 
     action.createParam(PARAM_PROJECT)
       .setDescription("Key of the project")
-      .setDeprecatedKey(DEPRECATED_PARAM_KEY)
+      .setDeprecatedKey(DEPRECATED_PARAM_KEY, "6.3")
       .setRequired(true)
       .setExampleValue(KEY_PROJECT_EXAMPLE_001);
 
index 91bd14e089981e31a47e4ccceff3a04158fd59b8..fb1a9b7eaa11a5ccf4923b6d348892aa2c718f97 100644 (file)
@@ -150,7 +150,7 @@ public class IndexAction implements ProjectsWsAction {
   private static void addRemovedParameter(String key, WebService.NewAction action) {
     action.createParam(key)
       .setDescription("Since 6.3, this parameter has no effect")
-      .setDeprecatedKey("6.3");
+      .setDeprecatedSince("6.3");
   }
 
 }
index 990b289c867003bc2510a071cc5754fac8d3bd93..5ad2bf5b618bea948068a444f4258002561143ee 100644 (file)
@@ -85,7 +85,7 @@ public class CreateAction implements QProfileWsAction {
     create.createParam(PARAM_PROFILE_NAME)
       .setDescription("The name for the new quality profile. Since 6.1, this parameter has been renamed from '%s' to '%s'", DEPRECATED_PARAM_PROFILE_NAME, PARAM_PROFILE_NAME)
       .setExampleValue("My Sonar way")
-      .setDeprecatedKey(DEPRECATED_PARAM_PROFILE_NAME)
+      .setDeprecatedKey(DEPRECATED_PARAM_PROFILE_NAME, "6.3")
       .setRequired(true);
 
     create.createParam(PARAM_LANGUAGE)
index f7c4d056202a6c7323f8aadc3c93901dd7afe4f9..f2f8a884a518b1ce25cc6eb7ab3420120ec7c76e 100644 (file)
@@ -95,7 +95,7 @@ public class ExportAction implements QProfileWsAction {
           "Possible values are described by api/qualityprofiles/exporters.")
         .setPossibleValues(exporterKeys)
         // This deprecated key is only there to be able to deal with redirection from /profiles/export
-        .setDeprecatedKey("format");
+        .setDeprecatedKey("format", "6.3");
     }
   }
 
index ca71f596b753057c40e3062772c9acbaff5c5e32..060eccd83335a8156d63ab396ac335d00b41d526 100644 (file)
@@ -82,7 +82,7 @@ public class ResetAction implements SettingsWsAction {
       .setRequired(true);
     action.createParam(PARAM_COMPONENT)
       .setDescription("Component key")
-      .setDeprecatedKey("componentKey")
+      .setDeprecatedKey("componentKey", "6.3")
       .setExampleValue(KEY_PROJECT_EXAMPLE_001);
   }
 
index bdcfee1f6a3093d557925a7072e68eb8bb23aaa4..1e9736589112dd6548d5a32beef1e32c5b6d48f1 100644 (file)
@@ -122,7 +122,7 @@ public class SetAction implements SettingsWsAction {
 
     action.createParam(PARAM_COMPONENT)
       .setDescription("Component key")
-      .setDeprecatedKey("componentKey")
+      .setDeprecatedKey("componentKey", "6.3")
       .setExampleValue(KEY_PROJECT_EXAMPLE_001);
   }
 
index 501f0123843c243504dae9a3f98da55e30a2ed16..4900cefc46e0753e38a044a6db7f5600efbf26f3 100644 (file)
@@ -88,7 +88,7 @@ public class CreateAction implements UsersWsAction {
 
     action.createParam(PARAM_SCM_ACCOUNTS)
       .setDescription("This parameter is deprecated, please use '%s' instead", PARAM_SCM_ACCOUNT)
-      .setDeprecatedKey(PARAM_SCM_ACCOUNTS_DEPRECATED)
+      .setDeprecatedKey(PARAM_SCM_ACCOUNTS_DEPRECATED, "6.0")
       .setDeprecatedSince("6.1")
       .setExampleValue("myscmaccount1,myscmaccount2");
 
index fbf136efe4760077e1bb3388ec9ec9ed46ae64ec..3a544a862cef4a4a5d56c2bcc32a335e17951e91 100644 (file)
@@ -85,7 +85,7 @@ public class UpdateAction implements UsersWsAction {
 
     action.createParam(PARAM_SCM_ACCOUNTS)
       .setDescription("This parameter is deprecated, please use '%s' instead", PARAM_SCM_ACCOUNT)
-      .setDeprecatedKey(PARAM_SCM_ACCOUNTS_DEPRECATED)
+      .setDeprecatedKey(PARAM_SCM_ACCOUNTS_DEPRECATED, "6.0")
       .setDeprecatedSince("6.1")
       .setExampleValue("myscmaccount1,myscmaccount2");
 
index 6df00f73641b84d8e3176caeebc1abfcdd64cd11..4ed296fcab19fcedf25a96bd6edf09c2aa4c1951 100644 (file)
@@ -348,13 +348,13 @@ public interface WebService extends Definable<WebService.Context> {
       createParam(Param.PAGE)
         .setDescription("1-based page number")
         .setExampleValue("42")
-        .setDeprecatedKey("pageIndex")
+        .setDeprecatedKey("pageIndex", "5.2")
         .setDefaultValue("1");
 
       createParam(Param.PAGE_SIZE)
         .setDescription("Page size. Must be greater than 0.")
         .setExampleValue("20")
-        .setDeprecatedKey("pageSize")
+        .setDeprecatedKey("pageSize", "5.2")
         .setDefaultValue(String.valueOf(defaultPageSize));
       return this;
     }
@@ -373,7 +373,7 @@ public interface WebService extends Definable<WebService.Context> {
       createParam(Param.PAGE)
         .setDescription("1-based page number")
         .setExampleValue("42")
-        .setDeprecatedKey("pageIndex")
+        .setDeprecatedKey("pageIndex", "5.2")
         .setDefaultValue("1");
       return this;
     }
@@ -382,7 +382,7 @@ public interface WebService extends Definable<WebService.Context> {
       createParam(Param.PAGE_SIZE)
         .setDescription("Page size. Must be greater than 0 and less than " + maxPageSize)
         .setExampleValue("20")
-        .setDeprecatedKey("pageSize")
+        .setDeprecatedKey("pageSize", "5.2")
         .setDefaultValue(String.valueOf(defaultPageSize));
       return this;
     }
@@ -437,7 +437,7 @@ public interface WebService extends Definable<WebService.Context> {
 
       return createParam(Param.SORT)
         .setDescription("Sort field")
-        .setDeprecatedKey("sort")
+        .setDeprecatedKey("sort", "5.4")
         .setDefaultValue(defaultValue)
         .setPossibleValues(possibleValues);
     }
index a22ad478c7f09f2c1c0d59c3c75782d94afe9ea6..4c299ae37aec20bf58a544702594f70ead1a6f34 100644 (file)
@@ -636,8 +636,8 @@ public class RequestTest {
 
       action.createParam("has_possible_values").setPossibleValues("foo", "bar");
 
-      action.createParam("new_param").setDeprecatedKey("deprecated_param");
-      action.createParam("new_param_with_default_value").setDeprecatedKey("deprecated_new_param_with_default_value").setDefaultValue("the_default_string");
+      action.createParam("new_param").setDeprecatedKey("deprecated_param", "6.3");
+      action.createParam("new_param_with_default_value").setDeprecatedKey("deprecated_new_param_with_default_value", "6.2").setDefaultValue("the_default_string");
 
       controller.done();
     }