Skip to content

Commit e74ffb2

Browse files
hyunw9Reamer
authored andcommitted
[ZEPPELIN-6246] Replace deprecated Character constructor
### What is this PR for? In the following file [zeppelin/file/src/main/java/org/apache/zeppelin/file/HDFSFileInterpreter.java](https://github.com/apache/zeppelin/blob/91f091e287b94295ec7f10254b4f4ac800209899/file/src/main/java/org/apache/zeppelin/file/HDFSFileInterpreter.java#L180) The Character constructor is deprecated in Java 9 and later, recommending the use of the static factory method Character.valueOf() instead. This change's objective is to update the code to use the modern recommended approach. As-is ``` if (args.flags.contains(new Character('l'))) { ``` To-be ``` if (args.flags.contains(Character.valueOf('l'))) { ``` Also, Changed single word's type from **""** -> **''** ### What type of PR is it? Refactoring ### Todos * [ ] - Replace deprecated Character constructor * [ ] - Change single word's data type ### What is the Jira issue? * Open an issue on [Jira](https://issues.apache.org/jira/browse/ZEPPELIN-6246) ### How should this be tested? * Strongly recommended: add automated unit tests for any new or changed behavior * Outline any manual steps to test the PR here. ### Screenshots (if appropriate) ### Questions: * Does the license files need to update? - No * Is there breaking changes for older versions? - No * Does this needs documentation? - No Closes #4979 from hyunw9/ZEPPELIN-6246. Signed-off-by: Philipp Dallig <philipp.dallig@gmail.com>
1 parent 19b1b08 commit e74ffb2

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

file/src/main/java/org/apache/zeppelin/file/HDFSFileInterpreter.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,13 @@ private String listDate(OneFileStatus fs) {
177177
}
178178

179179
private String listOne(String path, OneFileStatus fs) {
180-
if (args.flags.contains(new Character('l'))) {
180+
if (args.flags.contains(Character.valueOf('l'))) {
181181
StringBuilder sb = new StringBuilder();
182-
sb.append(listPermission(fs) + "\t");
182+
sb.append(listPermission(fs) + '\t');
183183
sb.append(((fs.replication == 0) ? "-" : fs.replication) + "\t ");
184-
sb.append(fs.owner + "\t");
185-
sb.append(fs.group + "\t");
186-
if (args.flags.contains(new Character('h'))){ //human readable
184+
sb.append(fs.owner + '\t');
185+
sb.append(fs.group + '\t');
186+
if (args.flags.contains(Character.valueOf('h'))){ // human readable
187187
sb.append(humanReadableByteCount(fs.length) + "\t\t");
188188
} else {
189189
sb.append(fs.length + "\t");

0 commit comments

Comments
 (0)