Fix code smells (#447)
* fix sonar condition always true Signed-off-by: Michael Hirsch <michael.hirsch@bosch-si.com> * remove useless assignment and useless private methods Signed-off-by: Michael Hirsch <michael.hirsch@bosch-si.com> * fix unsafe usage of Optional.get Signed-off-by: Michael Hirsch <michael.hirsch@bosch-si.com>
This commit is contained in:
@@ -109,16 +109,14 @@ public class AmqpMessageDispatcherService extends BaseAmqpService {
|
||||
LOG.debug("targetAssignDistributionSet retrieved for controller {}. I will forward it to DMF broker.",
|
||||
assignedEvent.getControllerId());
|
||||
|
||||
sendUpdateMessageToTarget(assignedEvent.getTenant(),
|
||||
targetManagement.findTargetByControllerID(assignedEvent.getControllerId()).get(),
|
||||
assignedEvent.getActionId(), assignedEvent.getModules());
|
||||
targetManagement.findTargetByControllerID(assignedEvent.getControllerId()).ifPresent(target -> sendUpdateMessageToTarget(assignedEvent.getTenant(),
|
||||
target,
|
||||
assignedEvent.getActionId(), assignedEvent.getModules()));
|
||||
|
||||
}
|
||||
|
||||
void sendUpdateMessageToTarget(final String tenant, final Target target, final Long actionId,
|
||||
final Collection<org.eclipse.hawkbit.repository.model.SoftwareModule> modules) {
|
||||
if (target == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
final URI targetAdress = target.getTargetInfo().getAddress();
|
||||
if (!IpUtil.isAmqpUri(targetAdress)) {
|
||||
|
||||
Reference in New Issue
Block a user