Skip to content

[FLINK-37665]: Simplify DoubleMaximum.clone() Implementation #26449

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

atu-sharm
Copy link
Contributor

@atu-sharm atu-sharm commented Apr 13, 2025

What is the purpose of the change

The purpose of this change is to simplify the implementation of the clone() method in the DoubleMaximum class by leveraging the existing constructor DoubleMaximum(double value) instead of manually setting the max field

Brief change log:

The current implementation of the clone() method in the DoubleMaximum class uses the default constructor and manually sets the max field:

// Some comments here
@OverRide
public DoubleMaximum clone() {
DoubleMaximum clone = new DoubleMaximum();
clone.max = this.max;
return clone;
}
This can be simplified by directly using the existing constructor DoubleMaximum(double value) to initialize the cloned object. The proposed change is:

@OverRide
public DoubleMaximum clone() {
return new DoubleMaximum(this.max);
}

Verifying this change:

This change is a trivial rework / code cleanup without any test coverage.

Does this pull request potentially affect one of the following parts:

Dependencies (does it add or upgrade a dependency): no
The serializers: no
The runtime per-record code paths (performance sensitive): no
Anything that affects deployment or recovery: no
The S3 file system connector: no

Documentation
Does this pull request introduce a new feature? no
If yes, how is the feature documented? not applicable

@adealjason
Copy link

adealjason commented Apr 13, 2025 via email

@flinkbot
Copy link
Collaborator

flinkbot commented Apr 13, 2025

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

Copy link
Contributor

@davidradl davidradl left a comment

Choose a reason for hiding this comment

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

Trivial change - approving

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.

4 participants