[connectors] move activemq connectors to new model (codacy)
@@ -126,11 +126,15 @@ class ActiveMQConnector extends ComponentProxyComponent {
// Helpers
// ************************************
+ @SuppressWarnings("PMD.AvoidDeeplyNestedIfStmts")
private SjmsComponent lookupComponent() {
final CamelContext context = getCamelContext();
final List<String> names = context.getComponentNames();
- if (ObjectHelper.isNotEmpty(names)) {
+ if (ObjectHelper.isEmpty(names)) {
+ return null;
+ }
+
// Try to check if a component with same set-up has already been
// configured, if so reuse it.
for (String name: names) {
@@ -154,7 +158,6 @@ class ActiveMQConnector extends ComponentProxyComponent {
}
}
}
- }
return null;
}
