Skip to content

Commit

Permalink
Improvements regarding code review
Browse files Browse the repository at this point in the history
  • Loading branch information
markusweigelt committed Jan 2, 2024
1 parent f42a188 commit be5da8a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,10 @@ public boolean equals(Object o) {
mediaPartialView.getBegin());
}

@Override
public int hashCode() {
final int prime = 31;
return prime * super.hashCode() + Objects.hash(begin, extent);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class MediaPartialForm implements Serializable {
*
* @return True if form is in edit mode.
*/
public boolean isEdit() {
public boolean isEditable() {
return Objects.nonNull(mediaPartialDivision);
}

Expand Down Expand Up @@ -89,7 +89,7 @@ public void save() {
return;
}

if (isEdit()) {
if (isEditable()) {
mediaPartialDivision.getKey().setLabel(getTitle());
mediaPartialDivision.getValue().setBegin(getBegin());
} else {
Expand Down Expand Up @@ -174,7 +174,7 @@ protected boolean valid() {
validationError = "mediaPartialFormStartLessThanMediaDuration";
return false;
}
if (!isEdit() || (isEdit() && !mediaPartialDivision.getValue().getBegin().equals(getBegin()))) {
if (!isEditable() || (isEditable() && !mediaPartialDivision.getValue().getBegin().equals(getBegin()))) {
boolean exists = getMediaSelection().getValue().getChildren().stream().anyMatch(
logicalDivision -> logicalDivision.getViews().getFirst().getPhysicalDivision().getMediaPartialView()
.getBegin().equals(getBegin()));
Expand Down

0 comments on commit be5da8a

Please sign in to comment.