Skip to content

[ZEPPELIN-6240] Use generics in CommandArgs constructor to improve type safety#4971

Merged
Reamer merged 1 commit into
apache:masterfrom
hyunw9:feat/Use-generics-in-CommandArgs-constructor
Jul 16, 2025
Merged

[ZEPPELIN-6240] Use generics in CommandArgs constructor to improve type safety#4971
Reamer merged 1 commit into
apache:masterfrom
hyunw9:feat/Use-generics-in-CommandArgs-constructor

Conversation

@hyunw9

@hyunw9 hyunw9 commented Jul 15, 2025

Copy link
Copy Markdown
Contributor

What is this PR for?

As @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

  • - Use generics in CommandArgs constructor

What is the Jira issue?

  • Open an issue on Jira

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

@ParkGyeongTae

Copy link
Copy Markdown
Member

Could you update the PR title from ZEPPELIN-6225 to ZEPPELIN-6240?

@ParkGyeongTae

Copy link
Copy Markdown
Member

Please update the Jira link in the PR description.

@hyunw9 hyunw9 changed the title [ZEPPELIN-6225] Use generics in CommandArgs constructor to improve type safety [ZEPPELIN-6240] Use generics in CommandArgs constructor to improve type safety Jul 15, 2025
@hyunw9

hyunw9 commented Jul 15, 2025

Copy link
Copy Markdown
Contributor Author

Thanks for the review ! I just updated title & Jira link.

@ParkGyeongTae ParkGyeongTae left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM

@Reamer

Reamer commented Jul 15, 2025

Copy link
Copy Markdown
Contributor

Please change the JIRA Link in your description to https://issues.apache.org/jira/browse/ZEPPELIN-6240

@Reamer Reamer merged commit 91f091e into apache:master Jul 16, 2025
17 of 18 checks passed
asf-gitbox-commits pushed a commit that referenced this pull request Jul 16, 2025
…pe 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>
(cherry picked from commit 91f091e)
Signed-off-by: Philipp Dallig <philipp.dallig@gmail.com>
@Reamer

Reamer commented Jul 16, 2025

Copy link
Copy Markdown
Contributor

Merged into master and branch-0.12
@hyunw9
Thank you for your contribution. In the following class there are also two places where the constructor call for Character is deprecated. You may also want to correct this.

if (args.flags.contains(new Character('l'))) {

@hyunw9

hyunw9 commented Jul 16, 2025

Copy link
Copy Markdown
Contributor Author

Happy to handle this request @Reamer! I will take the issue and update it to ASF Jira 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants