} else if (employee1.getEmployeeHeadquarter() != null && employee1.getEmployeeHeadquarter().getHeadquarterId() < 1) {
// Throw IAE
throw new IllegalArgumentException(MessageFormat.format("employee1.employeeHeadquarter.headquarterId={0} is invalid.", employee1.getEmployeeHeadquarter().getHeadquarterId())); //NOI18N
- } else if ((employee1.getEmployeePersonalData() == null) && (employee1.getEmployeeNumber() == null)) {
- // Both are null
- throw new NullPointerException("employee1.employeePersonalData and employee1.employeeNumber are null"); //NOI18N
+ } else if ((employee1.getEmployeePersonalData() == null) && (employee1.getEmployeeBranchOffice() == null) && (employee1.getEmployeeHeadquarter() == null) && (employee1.getEmployeeNumber() == null)) {
+ // All are null
+ throw new NullPointerException("employee1.employeePersonalData, employee1.employeeBranchOffice, employee1.employeeHeadquarter and employee1.employeeNumber are null"); //NOI18N
} else if ((employee1.getEmployeePersonalData() != null) && (employee1.getEmployeePersonalData().getContactId() == null)) {
// Throw NPE
throw new NullPointerException("employee1.employeePersonalData.contactId is null"); //NOI18N
} else if (employee2.getEmployeeHeadquarter() != null && employee2.getEmployeeHeadquarter().getHeadquarterId() < 1) {
// Throw IAE
throw new IllegalArgumentException(MessageFormat.format("employee2.employeeHeadquarter.headquarterId={0} is invalid.", employee2.getEmployeeHeadquarter().getHeadquarterId())); //NOI18N
- } else if ((employee2.getEmployeePersonalData() == null) && (employee2.getEmployeeNumber() == null)) {
- // Both are null
- throw new NullPointerException("employee2.employeePersonalData and employee2.employeeNumber are null"); //NOI18N
+ } else if ((employee2.getEmployeePersonalData() == null) && (employee2.getEmployeeBranchOffice() == null) && (employee2.getEmployeeHeadquarter() == null) && (employee2.getEmployeeNumber() == null)) {
+ // All are null
+ throw new NullPointerException("employee2.employeePersonalData, employee2.employeeBranchOffice, employee2.employeeHeadquarter and employee2.employeeNumber are null"); //NOI18N
} else if ((employee2.getEmployeePersonalData() != null) && (employee2.getEmployeePersonalData().getContactId() == null)) {
// Throw NPE
throw new NullPointerException("employee2.employeePersonalData.contactId is null"); //NOI18N