Skip to content
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

chore:2733 design level refactoring #2736

Conversation

snehit221
Copy link
Contributor

Checklist

@snehit221 snehit221 changed the title Snehit 2733 design level refactoring chore:2733 design level refactoring Nov 18, 2023
Copy link
Member

Choose a reason for hiding this comment

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

Is this the same refactor as #2734?

Copy link
Contributor Author

@snehit221 snehit221 Nov 18, 2023

Choose a reason for hiding this comment

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

yes, to avoid confusion I have created a new separate PR which covers 2 additional commits for refactor. will discard this PR.
New ref PR: #2738

Copy link
Member

Choose a reason for hiding this comment

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

Is this the same refactor as #2734 ?

Comment on lines +36 to +66
@Override
public int hashCode() {
int h = hash;
if (h == 0) {
h = internalHashCode();
hash = h;
}
return h;
}

protected int internalHashCode() {
final int prime = 31;
int result = 1;
result =
prime * result
+ ((this.getPortletWindowId() == null)
? 0
: this.getPortletWindowId().hashCode());
result =
prime * result
+ ((this.getEventType() == null) ? 0 : this.getEventType().hashCode());
return result;
}

@Override
public String toString() {
return this.getClass().getSimpleName()
+ " ["
+ "portletWindowId="
+ this.getPortletWindowId()
+ "]";
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@snehit221 snehit221 Nov 18, 2023

Choose a reason for hiding this comment

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

Thanks @ChristianMurphy for sharing the link.
My primary goal was to find code duplicates like this and refactor them.
Since this code was duplicated in 5/6 classes, I have pulled up this method and variable to promote code re-use.

Meanwhile, If my refactor change is fine, May I request it to be merged ?

I will explore this and update this part in a separate PR subsequently.
ref PR: #2738

Copy link
Member

Choose a reason for hiding this comment

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

is this the same as #2734 ?

@bjagg bjagg closed this Dec 22, 2023
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