Code cleanup (#427)

* Removed dead code.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Fix sonar issues.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
This commit is contained in:
Kai Zimmermann
2017-01-30 11:10:46 +01:00
committed by GitHub
parent d553716cda
commit 59f218e841
54 changed files with 141 additions and 1137 deletions

View File

@@ -10,8 +10,10 @@ package org.eclipse.hawkbit.amqp;
import java.util.concurrent.TimeUnit;
import org.eclipse.hawkbit.repository.exception.EntityNotFoundException;
import org.eclipse.hawkbit.repository.exception.InvalidTargetAddressException;
import org.eclipse.hawkbit.repository.exception.TenantNotExistException;
import org.eclipse.hawkbit.repository.exception.ToManyAttributeEntriesException;
import org.eclipse.hawkbit.repository.exception.TooManyStatusEntriesException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -40,8 +42,7 @@ public class DelayedRequeueExceptionStrategy extends ConditionalRejectingErrorHa
@Override
protected boolean isUserCauseFatal(final Throwable cause) {
if (cause instanceof TenantNotExistException || cause instanceof TooManyStatusEntriesException
|| cause instanceof InvalidTargetAddressException) {
if (invalidMessage(cause)) {
return true;
}
@@ -56,4 +57,13 @@ public class DelayedRequeueExceptionStrategy extends ConditionalRejectingErrorHa
return false;
}
private boolean invalidMessage(final Throwable cause) {
return doesNotExist(cause) || cause instanceof TooManyStatusEntriesException
|| cause instanceof InvalidTargetAddressException || cause instanceof ToManyAttributeEntriesException;
}
private boolean doesNotExist(final Throwable cause) {
return cause instanceof TenantNotExistException || cause instanceof EntityNotFoundException;
}
}