Sameera,
Sonar found the following code segment (
http://wso2.org/sonar/drilldown/violations/2?&rule=findbugs%3ADB_DUPLICATE_SWITCH_CLAUSES&rule_sev=CRITICAL&severity=CRITICAL#
).
public void bundleChanged(BundleEvent event) {
Bundle bundle = event.getBundle();
switch (event.getType()) {
case BundleEvent.STARTED:
if (context.getBundle() != bundle) {
registry.register(event.getBundle());
}
break;
case BundleEvent.STOPPED:
if (context.getBundle() != bundle) {
registry.register(event.getBundle());
}
break;
}
}
As can be seen, for bot STARTED & STOPPED events, we
call registry.register(event.getBundle()). Is this correct?
--
*Afkham Azeez*
Director of Architecture; WSO2, Inc.; http://wso2.com
Member; Apache Software Foundation; http://www.apache.org/
* <http://www.apache.org/>**
email: **[email protected]* <[email protected]>* cell: +94 77 3320919
blog: **http://blog.afkham.org* <http://blog.afkham.org>*
twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
*
linked-in: **http://lk.linkedin.com/in/afkhamazeez*
*
*
*Lean . Enterprise . Middleware*
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev