-
Notifications
You must be signed in to change notification settings - Fork 273
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 final refactor #2738
base: master
Are you sure you want to change the base?
Changes from all commits
04a3ad7
5509742
c1af0c8
6929826
df16096
e8018df
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,8 +21,6 @@ public final class PortletContentPlaceholderEventImpl extends PortletPlaceholder | |
implements PortletContentPlaceholderEvent { | ||
private static final long serialVersionUID = 1L; | ||
|
||
private int hash = 0; | ||
|
||
public PortletContentPlaceholderEventImpl(IPortletWindowId portletWindowId) { | ||
super(portletWindowId); | ||
} | ||
|
@@ -35,30 +33,6 @@ public CharacterEventTypes getEventType() { | |
return CharacterEventTypes.PORTLET_CONTENT; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
int h = hash; | ||
if (h == 0) { | ||
h = internalHashCode(); | ||
hash = h; | ||
} | ||
return h; | ||
} | ||
|
||
private 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; | ||
} | ||
Comment on lines
-38
to
-60
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What has this been replaced by? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All such implementations have been pulled up in the parent class to remove code duplicates. I can explore how I can replace the single implementation of this method ( now in the parent class) through Lombok in the next iteration. |
||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) return true; | ||
|
@@ -73,12 +47,4 @@ public boolean equals(Object obj) { | |
} else if (!this.getPortletWindowId().equals(other.getPortletWindowId())) return false; | ||
return true; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "PortletContentPlaceholderEvent [" | ||
+ "portletWindowId=" | ||
+ this.getPortletWindowId() | ||
+ "]"; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package org.apereo.portal.security; | ||
|
||
import org.apereo.portal.portlet.om.IPortletDefinition; | ||
|
||
public interface IPortletPermissionHandler { | ||
|
||
boolean checkPermission(IAuthorizationPrincipal ap, IPortletDefinition portletDefinition); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't these tests assert something?
Why has the testing part of the test been removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was previously handled in a different way as this same switch case with method calls was used in the class. Now since that is now handled and replaced with a single polymorphic call, I did not need this any more in my test. Hence, I modified the existing flow to test whether the my polymorphism methods are being invoked properly.