Suppress deprecation warning for LabelType.Builder#setFunction(...)

As long as we have Rest API and tests for label functions we will use
this method and the compiler warnings makes it difficult to check
if new changes introduces other compiler warnings.

Release-Notes: skip
Change-Id: I788ef20091b39d72712ecfaed287a15af5921001
diff --git a/java/com/google/gerrit/acceptance/AbstractDaemonTest.java b/java/com/google/gerrit/acceptance/AbstractDaemonTest.java
index 01c4942..92c3e92 100644
--- a/java/com/google/gerrit/acceptance/AbstractDaemonTest.java
+++ b/java/com/google/gerrit/acceptance/AbstractDaemonTest.java
@@ -1543,6 +1543,7 @@
     configLabel(project, label, func, ImmutableList.of(), value);
   }
 
+  @SuppressWarnings("deprecation")
   private void configLabel(
       Project.NameKey project,
       String label,
diff --git a/java/com/google/gerrit/server/restapi/project/CreateLabel.java b/java/com/google/gerrit/server/restapi/project/CreateLabel.java
index ad32f4f..ad79a14 100644
--- a/java/com/google/gerrit/server/restapi/project/CreateLabel.java
+++ b/java/com/google/gerrit/server/restapi/project/CreateLabel.java
@@ -123,6 +123,7 @@
    * @throws BadRequestException if there was invalid data in the input
    * @throws ResourceConflictException if the label cannot be created due to a conflict
    */
+  @SuppressWarnings("deprecation")
   public LabelType createLabel(ProjectConfig config, String label, LabelDefinitionInput input)
       throws BadRequestException, ResourceConflictException {
     if (config.getLabelSections().containsKey(label)) {
diff --git a/java/com/google/gerrit/server/restapi/project/SetLabel.java b/java/com/google/gerrit/server/restapi/project/SetLabel.java
index 10589cc..6c4976d 100644
--- a/java/com/google/gerrit/server/restapi/project/SetLabel.java
+++ b/java/com/google/gerrit/server/restapi/project/SetLabel.java
@@ -115,6 +115,7 @@
    * @throws BadRequestException if there was invalid data in the input
    * @throws ResourceConflictException if the update cannot be applied due to a conflict
    */
+  @SuppressWarnings("deprecation")
   public boolean updateLabel(ProjectConfig config, LabelType labelType, LabelDefinitionInput input)
       throws BadRequestException, ResourceConflictException {
     boolean dirty = false;
diff --git a/javatests/com/google/gerrit/acceptance/api/change/StickyApprovalsIT.java b/javatests/com/google/gerrit/acceptance/api/change/StickyApprovalsIT.java
index 2668d1f..6ba1498 100644
--- a/javatests/com/google/gerrit/acceptance/api/change/StickyApprovalsIT.java
+++ b/javatests/com/google/gerrit/acceptance/api/change/StickyApprovalsIT.java
@@ -1232,6 +1232,7 @@
         .contains("Code-Review+1 by User");
   }
 
+  @SuppressWarnings("deprecation")
   @Test
   public void sticky_copiedToLatestPatchSetFromSubmitRecords() throws Exception {
     updateVerifiedLabel(b -> b.setFunction(LabelFunction.NO_BLOCK));
diff --git a/javatests/com/google/gerrit/acceptance/api/change/SubmitRequirementIT.java b/javatests/com/google/gerrit/acceptance/api/change/SubmitRequirementIT.java
index 242c278..c223562 100644
--- a/javatests/com/google/gerrit/acceptance/api/change/SubmitRequirementIT.java
+++ b/javatests/com/google/gerrit/acceptance/api/change/SubmitRequirementIT.java
@@ -1576,6 +1576,7 @@
 
       // Clear SRs for the project and update code-review label to be non-blocking.
       clearSubmitRequirements(project);
+      @SuppressWarnings("deprecation")
       LabelType cr =
           TestLabels.codeReview().toBuilder().setFunction(LabelFunction.NO_BLOCK).build();
       try (ProjectConfigUpdate u = updateProject(project)) {
@@ -1622,6 +1623,7 @@
 
       // Clear SRs for the project and update code-review label to be non-blocking.
       clearSubmitRequirements(project);
+      @SuppressWarnings("deprecation")
       LabelType cr =
           TestLabels.codeReview().toBuilder().setFunction(LabelFunction.NO_BLOCK).build();
       try (ProjectConfigUpdate u = updateProject(project)) {
@@ -2836,6 +2838,7 @@
             .setAllowOverrideInChildProjects(true)
             .build());
 
+    @SuppressWarnings("deprecation")
     LabelType cr = TestLabels.codeReview().toBuilder().setFunction(LabelFunction.NO_BLOCK).build();
     try (ProjectConfigUpdate u = updateProject(project)) {
       u.getConfig().upsertLabelType(cr);
diff --git a/javatests/com/google/gerrit/acceptance/api/change/SubmitRuleIT.java b/javatests/com/google/gerrit/acceptance/api/change/SubmitRuleIT.java
index af95e7e..e7efb62 100644
--- a/javatests/com/google/gerrit/acceptance/api/change/SubmitRuleIT.java
+++ b/javatests/com/google/gerrit/acceptance/api/change/SubmitRuleIT.java
@@ -98,6 +98,7 @@
     assertThat(recordLabels).contains(needCustomLabel);
   }
 
+  @SuppressWarnings("deprecation")
   private void setupCustomBlockingLabel() throws Exception {
     try (ProjectConfigUpdate u = updateProject(project)) {
       u.getConfig()
diff --git a/javatests/com/google/gerrit/acceptance/server/project/CustomLabelIT.java b/javatests/com/google/gerrit/acceptance/server/project/CustomLabelIT.java
index 576c7d0..7ffc0a4 100644
--- a/javatests/com/google/gerrit/acceptance/server/project/CustomLabelIT.java
+++ b/javatests/com/google/gerrit/acceptance/server/project/CustomLabelIT.java
@@ -76,6 +76,7 @@
         .update();
   }
 
+  @SuppressWarnings("deprecation")
   @Test
   public void customLabelNoOp_NegativeVoteNotBlock() throws Exception {
     saveLabelConfig(LABEL.toBuilder().setFunction(NO_OP));
@@ -91,6 +92,7 @@
     assertThat(q.blocking).isNull();
   }
 
+  @SuppressWarnings("deprecation")
   @Test
   public void customLabelNoBlock_NegativeVoteNotBlock() throws Exception {
     saveLabelConfig(LABEL.toBuilder().setFunction(NO_BLOCK));
@@ -106,6 +108,7 @@
     assertThat(q.blocking).isNull();
   }
 
+  @SuppressWarnings("deprecation")
   @Test
   public void customLabelMaxNoBlock_NegativeVoteNotBlock() throws Exception {
     saveLabelConfig(LABEL.toBuilder().setFunction(MAX_NO_BLOCK));
@@ -121,6 +124,7 @@
     assertThat(q.blocking).isNull();
   }
 
+  @SuppressWarnings("deprecation")
   @Test
   public void customLabelMaxNoBlock_MaxVoteSubmittable() throws Exception {
     saveLabelConfig(LABEL.toBuilder().setFunction(MAX_NO_BLOCK), P.toBuilder().setFunction(NO_OP));
@@ -139,6 +143,7 @@
     assertThat(q.blocking).isNull();
   }
 
+  @SuppressWarnings("deprecation")
   @Test
   public void customLabelAnyWithBlock_NegativeVoteBlock() throws Exception {
     saveLabelConfig(LABEL.toBuilder().setFunction(ANY_WITH_BLOCK));
@@ -163,6 +168,7 @@
     }
   }
 
+  @SuppressWarnings("deprecation")
   @Test
   public void customLabelAnyWithBlock_Addreviewer_ZeroVote() throws Exception {
     TestListener testListener = new TestListener();
@@ -190,6 +196,7 @@
     }
   }
 
+  @SuppressWarnings("deprecation")
   @Test
   public void customLabelMaxWithBlock_NegativeVoteBlock() throws Exception {
     saveLabelConfig(LABEL.toBuilder().setFunction(MAX_WITH_BLOCK));
@@ -205,6 +212,7 @@
     assertThat(q.blocking).isTrue();
   }
 
+  @SuppressWarnings("deprecation")
   @Test
   public void customLabelMaxWithBlock_DeletedVoteDoesNotTriggerNegativeBlock() throws Exception {
     saveLabelConfig(P.toBuilder().setFunction(MAX_WITH_BLOCK));
@@ -227,6 +235,7 @@
     assertThat(labelInfo.blocking).isNull(); // label is not blocking the change submission
   }
 
+  @SuppressWarnings("deprecation")
   @Test
   public void customLabelMaxWithBlock_MaxVoteSubmittable() throws Exception {
     saveLabelConfig(
@@ -246,6 +255,7 @@
     assertThat(q.blocking).isNull();
   }
 
+  @SuppressWarnings("deprecation")
   @Test
   public void customLabelMaxWithBlock_MaxVoteNegativeVoteBlock() throws Exception {
     saveLabelConfig(LABEL.toBuilder().setFunction(MAX_WITH_BLOCK));
@@ -262,6 +272,7 @@
     assertThat(q.blocking).isTrue();
   }
 
+  @SuppressWarnings("deprecation")
   @Test
   public void customLabel_DisallowPostSubmit() throws Exception {
     saveLabelConfig(
diff --git a/javatests/com/google/gerrit/server/project/SubmitRequirementsAdapterTest.java b/javatests/com/google/gerrit/server/project/SubmitRequirementsAdapterTest.java
index b05f3c7..180dd92 100644
--- a/javatests/com/google/gerrit/server/project/SubmitRequirementsAdapterTest.java
+++ b/javatests/com/google/gerrit/server/project/SubmitRequirementsAdapterTest.java
@@ -40,6 +40,7 @@
 
   @Before
   public void setup() {
+    @SuppressWarnings("deprecation")
     LabelType codeReview =
         LabelType.builder(
                 "Code-Review",
@@ -50,6 +51,7 @@
             .setFunction(LabelFunction.MAX_WITH_BLOCK)
             .build();
 
+    @SuppressWarnings("deprecation")
     LabelType verified =
         LabelType.builder(
                 "Verified",
@@ -60,6 +62,7 @@
             .setFunction(LabelFunction.MAX_NO_BLOCK)
             .build();
 
+    @SuppressWarnings("deprecation")
     LabelType codeStyle =
         LabelType.builder(
                 "Code-Style",
@@ -70,6 +73,7 @@
             .setFunction(LabelFunction.ANY_WITH_BLOCK)
             .build();
 
+    @SuppressWarnings("deprecation")
     LabelType ignoreSelfApprovalLabel =
         LabelType.builder(
                 "ISA-Label",