dlmarion commented on code in PR #2870:
URL: https://github.com/apache/accumulo/pull/2870#discussion_r943386151
##########
shell/src/main/java/org/apache/accumulo/shell/Shell.java:
##########
@@ -1093,11 +1089,7 @@ public final void
printRecords(Iterable<Entry<Key,Value>> scanner, FormatterConf
}
public static String repeat(String s, int c) {
- StringBuilder sb = new StringBuilder();
- for (int i = 0; i < c; i++) {
- sb.append(s);
- }
- return sb.toString();
+ return String.valueOf(s).repeat(Math.max(0, c));
Review Comment:
```suggestion
return s.repeat(Math.max(0, c));
```
##########
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:
IIRC we had to initialize variables to null, and now we don't?
--
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]