|| areConflicting(preEnvEntry.getValue(), curEnvEntry.getValue())) {
throwConflictException(name, namespace.toString());
}
} else if (preObject instanceof EjbReference
&& curEntry instanceof EjbReference) {
EjbReference preRef = (EjbReference) preObject;
EjbReference curRef = (EjbReference) curEntry;
if (areConflicting(preRef.getType(), curRef.getType())
|| areConflicting(preRef.getEjbHomeInterface(),
curRef.getEjbHomeInterface())
|| areConflicting(preRef.getEjbInterface(),
curRef.getEjbInterface())
// link name is optional. compare only when they are both not null.
|| ((preRef.getLinkName() != null && curRef.getLinkName() != null && !preRef.getLinkName().equals(curRef.getLinkName())))
|| (preRef.isLocal() != curRef.isLocal())
|| areConflicting(preRef.getLookupName(), curRef.getLookupName())) {
throwConflictException(name, namespace.toString());
}
} else if (preObject instanceof ResourceReferenceDescriptor
&& curEntry instanceof ResourceReferenceDescriptor) {
ResourceReferenceDescriptor preRef = (ResourceReferenceDescriptor) preObject;
ResourceReferenceDescriptor curRef = (ResourceReferenceDescriptor) curEntry;
if (areConflicting(preRef.getType(), curRef.getType())
|| areConflicting(preRef.getAuthorization(),
curRef.getAuthorization())
|| areConflicting(preRef.getSharingScope(),
curRef.getSharingScope())
|| areConflicting(preRef.getMappedName(), curRef.getMappedName())
|| areConflicting(preRef.getLookupName(), curRef.getLookupName())) {
throwConflictException(name, namespace.toString());
}
} else if (preObject instanceof ResourceEnvReferenceDescriptor
&& curEntry instanceof ResourceEnvReferenceDescriptor) {
ResourceEnvReferenceDescriptor preRef = (ResourceEnvReferenceDescriptor) preObject;
ResourceEnvReferenceDescriptor curRef = (ResourceEnvReferenceDescriptor) curEntry;
if (areConflicting(preRef.getType(), curRef.getType())
|| areConflicting(preRef.getRefType(), curRef.getRefType())
|| areConflicting(preRef.getMappedName(), curRef.getMappedName())
|| areConflicting(preRef.getLookupName(), curRef.getLookupName())) {
throwConflictException(name, namespace.toString());
}
} else {
throwConflictException(name, namespace.toString());
}