ctubbsii commented on code in PR #3537:
URL: https://github.com/apache/accumulo/pull/3537#discussion_r1242779878
##########
shell/src/main/java/org/apache/accumulo/shell/commands/CreateTableCommand.java:
##########
@@ -72,7 +72,7 @@ public int execute(final String fullCommand, final
CommandLine cl, final Shell s
TableNotFoundException, IOException {
final String tableName = cl.getArgs()[0];
- NewTableConfiguration ntc = new NewTableConfiguration();
+ final NewTableConfiguration ntc = new NewTableConfiguration();
Review Comment:
If you want, you can also make these kinds of things slightly less redundant:
```suggestion
final var ntc = new NewTableConfiguration();
```
##########
shell/src/main/java/org/apache/accumulo/shell/commands/CreateTableCommand.java:
##########
@@ -86,14 +86,14 @@ public int execute(final String fullCommand, final
CommandLine cl, final Shell s
// and then the addSplits method was called. Starting with 2.0, the splits
will be
// stored on the file system and created before the table is brought
online.
if (cl.hasOption(createTableOptSplit.getOpt())) {
- ntc = ntc.withSplits(new TreeSet<>(
+ ntc.withSplits(new TreeSet<>(
ShellUtil.scanFile(cl.getOptionValue(createTableOptSplit.getOpt()),
decode)));
} else if (cl.hasOption(createTableOptCopySplits.getOpt())) {
final String oldTable =
cl.getOptionValue(createTableOptCopySplits.getOpt());
if (!shellState.getAccumuloClient().tableOperations().exists(oldTable)) {
throw new TableNotFoundException(null, oldTable, null);
}
- ntc = ntc.withSplits(
+ ntc.withSplits(
Review Comment:
The change is correct, but I lament the fact that we chose these method
names poorly. I think "with" implies that the returned value is "with" the
changes, but the original is "without", unless you have something to indicate
otherwise. But, the javadocs do explicitly imply the object is being mutated,
since it says `@return this` (at least on some methods... it should probably do
that on more of them).
--
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]