Skip to content

Commit

Permalink
objectForms fix
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed May 25, 2017
1 parent 21af8fc commit 5f48321
Showing 1 changed file with 21 additions and 19 deletions.
Expand Up @@ -112,32 +112,34 @@ private static void joinForms(ObjectFormsType objectForms, ObjectFormType newFor
}

private static boolean isTheSameObjectForm(ObjectFormType oldForm, ObjectFormType newForm){
if (oldForm.getType().equals(newForm.getType())){
if (!oldForm.getType().equals(newForm.getType())){
return false;
}
if (oldForm.getFormSpecification() == null || newForm.getFormSpecification() == null){
return true;
}
String oldFormPanelUri = oldForm.getFormSpecification().getPanelUri();
String newFormPanelUri = newForm.getFormSpecification().getPanelUri();
if (oldFormPanelUri != null && oldFormPanelUri.equals(newFormPanelUri)){
if (oldForm.isIncludeDefaultForms() != null &&
newForm.isIncludeDefaultForms() != null){
return true;
}
if (oldForm.getFormSpecification() == null && newForm.getFormSpecification() == null) {
String oldFormPanelUri = oldForm.getFormSpecification().getPanelUri();
String newFormPanelUri = newForm.getFormSpecification().getPanelUri();
if (oldFormPanelUri != null && oldFormPanelUri.equals(newFormPanelUri)) {
return true;
}

String oldFormPanelClass = oldForm.getFormSpecification().getPanelClass();
String newFormPanelClass = newForm.getFormSpecification().getPanelClass();
if (oldFormPanelClass != null && oldFormPanelClass.equals(newFormPanelClass)){
return true;
}
String oldFormPanelClass = oldForm.getFormSpecification().getPanelClass();
String newFormPanelClass = newForm.getFormSpecification().getPanelClass();
if (oldFormPanelClass != null && oldFormPanelClass.equals(newFormPanelClass)) {
return true;
}

String oldFormRefOid = oldForm.getFormSpecification().getFormRef() == null ?
null : oldForm.getFormSpecification().getFormRef().getOid();
String newFormRefOid = newForm.getFormSpecification().getFormRef() == null ?
null : newForm.getFormSpecification().getFormRef().getOid();
if (oldFormRefOid != null && oldFormRefOid.equals(newFormRefOid)){
return true;
String oldFormRefOid = oldForm.getFormSpecification().getFormRef() == null ?
null : oldForm.getFormSpecification().getFormRef().getOid();
String newFormRefOid = newForm.getFormSpecification().getFormRef() == null ?
null : newForm.getFormSpecification().getFormRef().getOid();
if (oldFormRefOid != null && oldFormRefOid.equals(newFormRefOid)) {
return true;
}
}

return false;
}

Expand Down

0 comments on commit 5f48321

Please sign in to comment.