You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ct...@apache.org on 2021/02/25 07:24:22 UTC

[accumulo] branch main updated: Minor warning cleanup from IDE

This is an automated email from the ASF dual-hosted git repository.

ctubbsii pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/main by this push:
     new 65c451a  Minor warning cleanup from IDE
65c451a is described below

commit 65c451aff187560e85598997ab60c581e60da14d
Author: Christopher Tubbs <ct...@apache.org>
AuthorDate: Thu Feb 25 02:20:17 2021 -0500

    Minor warning cleanup from IDE
    
    Clean up minor resource leak warning (false positive) from Eclipse,
    leftover from PR #1945. This removes the unnecessary second assignment
    to a separate ClientContext variable, that is never independently
    closed, and leaves the Closeable ClientContext assignment in the
    try-with-resources block.
---
 .../java/org/apache/accumulo/test/functional/MetadataIT.java   | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/test/src/main/java/org/apache/accumulo/test/functional/MetadataIT.java b/test/src/main/java/org/apache/accumulo/test/functional/MetadataIT.java
index f73fe4d..8bc277c 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/MetadataIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/MetadataIT.java
@@ -170,13 +170,11 @@ public class MetadataIT extends AccumuloClusterHarness {
   @Test
   public void testAmpleReadTablets() throws Exception {
 
-    try (AccumuloClient accumuloClient = Accumulo.newClient().from(getClientProps()).build()) {
-      accumuloClient.securityOperations().grantTablePermission(accumuloClient.whoami(),
-          MetadataTable.NAME, TablePermission.WRITE);
+    try (ClientContext cc = (ClientContext) Accumulo.newClient().from(getClientProps()).build()) {
+      cc.securityOperations().grantTablePermission(cc.whoami(), MetadataTable.NAME,
+          TablePermission.WRITE);
 
-      ClientContext cc = (ClientContext) accumuloClient;
-
-      SortedSet<Text> partitionKeys = new TreeSet<Text>();
+      SortedSet<Text> partitionKeys = new TreeSet<>();
       partitionKeys.add(new Text("a"));
       partitionKeys.add(new Text("e"));
       partitionKeys.add(new Text("j"));