Skip to content

Commit 91f091e

Browse files
authored
[ZEPPELIN-6240] Use generics in CommandArgs constructor to improve type safety
### What is this PR for? As <at>ParkGyeongTae mentioned, in the file zeppelin/file/src/main/java/org/apache/zeppelin/file/FileInterpreter.java, the variables args and flags were originally created using raw types: ``` args = new ArrayList(); flags = new HashSet(); ``` To resolve compiler warnings and ensure proper type checking, I updated the code to use generic types with diamond operators (<>) like this: ``` args = new ArrayList<String>(); flags = new HashSet<String>(); ``` ### What type of PR is it? Refactoring ### Todos * [x] - Use generics in CommandArgs constructor ### What is the Jira issue? * Open an issue on [Jira](https://issues.apache.org/jira/browse/ZEPPELIN-6240) ### 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 #4971 from hyunw9/feat/Use-generics-in-CommandArgs-constructor. Signed-off-by: Philipp Dallig <philipp.dallig@gmail.com>
1 parent a6fcb9d commit 91f091e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ public class CommandArgs {
6464

6565
public CommandArgs(String cmd) {
6666
input = cmd;
67-
args = new ArrayList();
68-
flags = new HashSet();
67+
args = new ArrayList<>();
68+
flags = new HashSet<>();
6969
}
7070

7171
private void parseArg(String arg) {

0 commit comments

Comments
 (0)