Skip to content

Commit 0523f7b

Browse files
virajjasaniKiran Kumar Maturi
authored andcommitted
HDFS-15895 : Remove redundant String#format in DFSAdmin#printOpenFiles (apache#2772)
1 parent 3ac288d commit 0523f7b

File tree

1 file changed

+4
-4
lines changed
  • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools

1 file changed

+4
-4
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DFSAdmin.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,14 +1024,14 @@ public int listOpenFiles(String[] argv) throws IOException {
10241024

10251025
private void printOpenFiles(RemoteIterator<OpenFileEntry> openFilesIterator)
10261026
throws IOException {
1027-
System.out.println(String.format("%-20s\t%-20s\t%s", "Client Host",
1028-
"Client Name", "Open File Path"));
1027+
System.out.printf("%-20s\t%-20s\t%s%n", "Client Host",
1028+
"Client Name", "Open File Path");
10291029
while (openFilesIterator.hasNext()) {
10301030
OpenFileEntry openFileEntry = openFilesIterator.next();
1031-
System.out.println(String.format("%-20s\t%-20s\t%20s",
1031+
System.out.printf("%-20s\t%-20s\t%20s%n",
10321032
openFileEntry.getClientMachine(),
10331033
openFileEntry.getClientName(),
1034-
openFileEntry.getFilePath()));
1034+
openFileEntry.getFilePath());
10351035
}
10361036
}
10371037

0 commit comments

Comments
 (0)