This is an automated email from the ASF dual-hosted git repository.
pdallig pushed a commit to branch branch-0.12
in repository https://gitbox.apache.org/repos/asf/zeppelin.git
The following commit(s) were added to refs/heads/branch-0.12 by this push:
new cc7259017b [ZEPPELIN-6240] Use generics in CommandArgs constructor to
improve type safety
cc7259017b is described below
commit cc7259017b7767cab620e7ffbda9f0eb78b71309
Author: 강현욱 <[email protected]>
AuthorDate: Wed Jul 16 16:29:55 2025 +0900
[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 <[email protected]>
(cherry picked from commit 91f091e287b94295ec7f10254b4f4ac800209899)
Signed-off-by: Philipp Dallig <[email protected]>
---
file/src/main/java/org/apache/zeppelin/file/FileInterpreter.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/file/src/main/java/org/apache/zeppelin/file/FileInterpreter.java
b/file/src/main/java/org/apache/zeppelin/file/FileInterpreter.java
index 8275215efa..9f87a0275a 100644
--- a/file/src/main/java/org/apache/zeppelin/file/FileInterpreter.java
+++ b/file/src/main/java/org/apache/zeppelin/file/FileInterpreter.java
@@ -64,8 +64,8 @@ public abstract class FileInterpreter extends Interpreter {
public CommandArgs(String cmd) {
input = cmd;
- args = new ArrayList();
- flags = new HashSet();
+ args = new ArrayList<>();
+ flags = new HashSet<>();
}
private void parseArg(String arg) {