Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Commit 9aa6951

Browse files
SORMAS-Foundation#2943 small refactoring
1 parent de2031e commit 9aa6951

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseDataForm.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@ private void onFollowUpUntilChanged(Property.ValueChangeEvent valueChangeEvent,
916916
CaseDataDto originalCase = getInternalValue();
917917
Date oldFollowUpUntil = originalCase.getFollowUpUntil();
918918
Date oldQuarantineEnd = originalCase.getQuarantineTo();
919-
if (adjustQuarantine(quarantineTo, newFollowUpUntil, oldFollowUpUntil)) {
919+
if (shouldAdjustQuarantine(quarantineTo, newFollowUpUntil, oldFollowUpUntil)) {
920920
VaadinUiUtil.showConfirmationPopup(
921921
I18nProperties.getString(Strings.headingAdjustQuarantine),
922922
new Label(I18nProperties.getString(Strings.confirmationAlsoAdjustQuarantine)),
@@ -928,7 +928,7 @@ private void onFollowUpUntilChanged(Property.ValueChangeEvent valueChangeEvent,
928928
quarantineChangedByFollowUpUntilChange = true;
929929
quarantineTo.setValue(newFollowUpUntil);
930930
if (oldQuarantineEnd != null) {
931-
boolean quarantineExtended = newFollowUpUntil.after(oldQuarantineEnd);
931+
boolean quarantineExtended = quarantineTo.getValue().after(oldQuarantineEnd);
932932
quarantineExtendedCheckBox.setValue(quarantineExtended);
933933
quarantineReducedCheckBox.setValue(!quarantineExtended);
934934
setVisible(quarantineExtended, CaseDataDto.QUARANTINE_EXTENDED);
@@ -939,7 +939,7 @@ private void onFollowUpUntilChanged(Property.ValueChangeEvent valueChangeEvent,
939939
}
940940
}
941941

942-
private boolean adjustQuarantine(DateField quarantineTo, Date newFollowUpUntil, Date oldFollowUpUntil) {
942+
private boolean shouldAdjustQuarantine(DateField quarantineTo, Date newFollowUpUntil, Date oldFollowUpUntil) {
943943
return newFollowUpUntil != null &&
944944
(oldFollowUpUntil == null || newFollowUpUntil.after(oldFollowUpUntil)) &&
945945
quarantineTo.getValue() != null && newFollowUpUntil.compareTo(quarantineTo.getValue()) != 0;

sormas-ui/src/main/java/de/symeda/sormas/ui/contact/ContactDataForm.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ private void onFollowUpUntilChanged(Property.ValueChangeEvent valueChangeEvent,
660660
ContactDto originalContact = getInternalValue();
661661
Date oldFollowUpUntil = originalContact.getFollowUpUntil();
662662
Date oldQuarantineEnd = originalContact.getQuarantineTo();
663-
if (adjustQuarantine(quarantineTo, newFollowUpUntil, oldFollowUpUntil)) {
663+
if (shouldAdjustQuarantine(quarantineTo, newFollowUpUntil, oldFollowUpUntil)) {
664664
VaadinUiUtil.showConfirmationPopup(
665665
I18nProperties.getString(Strings.headingAdjustQuarantine),
666666
new Label(I18nProperties.getString(Strings.confirmationAlsoAdjustQuarantine)),
@@ -672,7 +672,7 @@ private void onFollowUpUntilChanged(Property.ValueChangeEvent valueChangeEvent,
672672
quarantineChangedByFollowUpUntilChange = true;
673673
quarantineTo.setValue(newFollowUpUntil);
674674
if (oldQuarantineEnd != null) {
675-
boolean quarantineExtended = newFollowUpUntil.after(oldQuarantineEnd);
675+
boolean quarantineExtended = quarantineTo.getValue().after(oldQuarantineEnd);
676676
quarantineExtendedCheckBox.setValue(quarantineExtended);
677677
quarantineReducedCheckBox.setValue(!quarantineExtended);
678678
setVisible(quarantineExtended, ContactDto.QUARANTINE_EXTENDED);
@@ -683,7 +683,7 @@ private void onFollowUpUntilChanged(Property.ValueChangeEvent valueChangeEvent,
683683
}
684684
}
685685

686-
private boolean adjustQuarantine(DateField quarantineTo, Date newFollowUpUntil, Date oldFollowUpUntil) {
686+
private boolean shouldAdjustQuarantine(DateField quarantineTo, Date newFollowUpUntil, Date oldFollowUpUntil) {
687687
return newFollowUpUntil != null &&
688688
(oldFollowUpUntil == null || newFollowUpUntil.after(oldFollowUpUntil)) &&
689689
quarantineTo.getValue() != null && newFollowUpUntil.compareTo(quarantineTo.getValue()) != 0;

0 commit comments

Comments
 (0)