EdColeman commented on code in PR #2870:
URL: https://github.com/apache/accumulo/pull/2870#discussion_r943526511


##########
shell/src/main/java/org/apache/accumulo/shell/Shell.java:
##########
@@ -812,23 +808,23 @@ public void execCommand(String input, boolean 
ignoreAuthTimeout, boolean echoPro
   private ShellCompletor setupCompletion() {
     rootToken = new Token();
 
-    Set<String> tableNames = null;
+    Set<String> tableNames;
     try {
       tableNames = accumuloClient.tableOperations().list();
     } catch (Exception e) {
       log.debug("Unable to obtain list of tables", e);
       tableNames = Collections.emptySet();
     }
 
-    Set<String> userlist = null;
+    Set<String> userlist;

Review Comment:
   I believe the ide is now smart enough to see that the value is set on all 
paths before it is used, so the initial set is redundant.  The IDE flags it 
with 
   ```
   Variable 'userlist' initializer 'null' is redundant
   ```
   
   On the other hand, this will be flagged as an error - `variable n might not 
have been initialized`
   
   ```
      String n;
       if(n == null){
   
       }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to