[email protected] wrote:
> Project sipXecs
> New Revision 14236
> <http://sipxecs.sipfoundry.org/ViewVC/sipXecs?view=rev&rev=14236>
> Committer jattardi (Joe Attardi)
> Date 2008-12-10 17:49:58 -0500 (Wed, 10 Dec 2008)
>
>
Some questions to the version of Location.removeServiceByBeanId the this
checkin introduces...
public void removeServiceByBeanId(String beanId) {
if (m_services == null) {
return;
}
Iterator<LocationSpecificService> iterator = m_services.iterator();
while (iterator.hasNext()) {
LocationSpecificService next = iterator.next();
SipxService service = next.getSipxService();
if (beanId != null && beanId.equals(service.getBeanId())) { <-- line 1
if (service instanceof SipxAcdService) {
m_daoEventPublisher.publishDelete(next);
}
iterator.remove(); <--- line 2
break;
}
}
m_services.remove(beanId); <--- line 3
}
line 1: why check for null beanId - if something calls this method with
null I'd rather it fails loudly since we probably have a bug somewhere
else, and if we were to check for null why here and not at the beginning of
the method?
line 2 and 3: we remove the service in line 2, why call m_services.remove
in line 3 passing a String and not a Service object?
D.
_______________________________________________
sipx-dev mailing list
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipx-dev
Unsubscribe: http://list.sipfoundry.org/mailman/listinfo/sipx-dev