From 4884f18deb35403dec062619f4a0fdb259e982be Mon Sep 17 00:00:00 2001 From: Michael Hirsch Date: Tue, 5 Apr 2016 19:06:14 +0200 Subject: [PATCH] remove local variable which is never read only returned Signed-off-by: Michael Hirsch --- .../hawkbit/amqp/AmqpMessageHandlerService.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpMessageHandlerService.java b/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpMessageHandlerService.java index c5fff29ad..41e70f91f 100644 --- a/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpMessageHandlerService.java +++ b/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpMessageHandlerService.java @@ -214,19 +214,18 @@ public class AmqpMessageHandlerService extends BaseAmqpService { } private LocalArtifact findLocalArtifactByFileResource(final FileResource fileResource) { - LocalArtifact localArtifact = null; if (fileResource.getSha1() != null) { - localArtifact = artifactManagement.findFirstLocalArtifactsBySHA1(fileResource.getSha1()); + return artifactManagement.findFirstLocalArtifactsBySHA1(fileResource.getSha1()); } else if (fileResource.getFilename() != null) { - localArtifact = artifactManagement.findLocalArtifactByFilename(fileResource.getFilename()).stream() - .findFirst().orElse(null); + return artifactManagement.findLocalArtifactByFilename(fileResource.getFilename()).stream().findFirst() + .orElse(null); } else if (fileResource.getSoftwareModuleFilenameResource() != null) { - localArtifact = artifactManagement + return artifactManagement .findByFilenameAndSoftwareModule(fileResource.getSoftwareModuleFilenameResource().getFilename(), fileResource.getSoftwareModuleFilenameResource().getSoftwareModuleId()) .stream().findFirst().orElse(null); } - return localArtifact; + return null; } private static Artifact convertDbArtifact(final DbArtifact dbArtifact) {