Skip to content

Use immutable collections instead of creating unnecessary collection objects #4003

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

sjh836
Copy link
Contributor

@sjh836 sjh836 commented Sep 14, 2021

If a collection is created but not added, it can be refactored into an immutable (static empty) collection.
But in this case, I excluded it. For example, when using new ArrayList to convert Set to List ..

Is there something I missed?

@@ -160,7 +160,7 @@ public Map<String, Object> getJobParameters() {

@SuppressWarnings({"rawtypes", "unchecked"})
public Map<String, Object> getPartitionPlan() {
Copy link
Contributor

Choose a reason for hiding this comment

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

This method was removed in e5c752b, I will omit this change and its related test on merge.

@fmbenhassine
Copy link
Contributor

Rebased and merged as d9bf57e. Thank you for your contribution!

@fmbenhassine fmbenhassine changed the title Instead of creating unnecessary collection objects, change them to immutable or static collections. Use immutable collections instead of creating unnecessary collection objects Sep 13, 2023
@fmbenhassine fmbenhassine added this to the 5.1.0-M3 milestone Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants