Skip to content

Commit

Permalink
[#6239] fix: No need for toString() on string (CLI) (#6247)
Browse files Browse the repository at this point in the history
### What changes were proposed in this pull request?

Remove unnecessary toSrting() from CLI

### Why are the changes needed?

Fix: [#(6239)](#6239)

### Does this PR introduce _any_ user-facing change?

N/A

### How was this patch tested?

N/A
  • Loading branch information
sunxiaojian authored Jan 15, 2025
1 parent a13d435 commit eb3fb31
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ public void handle() {

String all = Joiner.on(System.lineSeparator()).join(metalakeDetails);

System.out.print(all.toString());
System.out.print(all);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ public void handle() {

String all = roles.isEmpty() ? "The group has no roles." : String.join(",", roles);

System.out.println(all.toString());
System.out.println(all);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ public void handle() {

String all = tags.length == 0 ? "No tags exist." : String.join(",", tags);

System.out.println(all.toString());
System.out.println(all);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,6 @@ public void handle() {
+ System.lineSeparator());
}

System.out.print(all.toString());
System.out.print(all);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,6 @@ public void handle() {

String all = String.join(",", tags);

System.out.println(all.toString());
System.out.println(all);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@ public void handle() {

String all = filesets.length == 0 ? "No filesets exist." : Joiner.on(",").join(filesets);

System.out.println(all.toString());
System.out.println(all);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ public void handle() {

String all = groups.length == 0 ? "No groups exist." : String.join(",", groups);

System.out.println(all.toString());
System.out.println(all);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ public void printProperties(Map<String, String> properties) {
all.append(property.getKey() + "," + property.getValue() + System.lineSeparator());
}

System.out.print(all.toString());
System.out.print(all);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ public void handle() {

String all = roles.length == 0 ? "No roles exist." : String.join(",", roles);

System.out.println(all.toString());
System.out.println(all);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ public void handle() {

String all = schemas.length == 0 ? "No schemas exist." : Joiner.on(",").join(schemas);

System.out.println(all.toString());
System.out.println(all);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ public void handle() {
? "No tables exist."
: Joiner.on(System.lineSeparator()).join(tableNames);

System.out.println(all.toString());
System.out.println(all);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public void handle() {
exitWithError(exp.getMessage());
}

String all = String.join(",", users);
String all = users.length == 0 ? "No users exist." : String.join(",", users);

System.out.println(all.toString());
System.out.println(all);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

package org.apache.gravitino.cli.commands;

import com.google.common.base.Joiner;
import org.apache.gravitino.Catalog;
import org.apache.gravitino.NameIdentifier;
import org.apache.gravitino.Schema;
Expand All @@ -33,7 +32,6 @@
import org.apache.gravitino.rel.Table;

public class UntagEntity extends Command {
public static final Joiner COMMA_JOINER = Joiner.on(", ").skipNulls();
protected final String metalake;
protected final FullName name;
protected final String[] tags;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ public void handle() {

String all = roles.isEmpty() ? "The user has no roles." : String.join(",", roles);

System.out.println(all.toString());
System.out.println(all);
}
}

0 comments on commit eb3fb31

Please sign in to comment.