Skip to content

Commit

Permalink
Last spotbug revert/fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
conniey committed Apr 27, 2019
1 parent de624d2 commit 8660233
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -332,15 +332,16 @@ public CompletableFuture<List<BaseLease>> getAllLeases() {
(bp.getLeaseState() == LeaseState.LEASED)));
});
future = CompletableFuture.completedFuture(infos);
} catch (Exception e) {
} catch (URISyntaxException | StorageException | NoSuchElementException e) {
Throwable effective = e;
if (e instanceof NoSuchElementException) {
// If there is a StorageException in the forEach, it arrives wrapped in a NoSuchElementException.
// Strip the misleading NoSuchElementException to provide a meaningful error for the user.
effective = e.getCause();
}
TRACE_LOGGER.warn(this.hostContext.withHost("Failure while getting lease state details"), effective);
future = new CompletableFuture<List<BaseLease>>();

TRACE_LOGGER.warn(this.hostContext.withHost("Failure while getting lease state details"), e);
future = new CompletableFuture<>();
future.completeExceptionally(LoggingUtils.wrapException(effective, EventProcessorHostActionStrings.GETTING_LEASE));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,14 +269,13 @@ public EventProcessorHost(
if (leaseManager == null) {
throw new IllegalArgumentException("Must provide an object which implements ILeaseManager");
}

// executorService argument is allowed to be null, that is the indication to use an internal threadpool.

if (this.partitionManagerOptions == null) {
// Normally will not be null because we're using the AzureStorage implementation.
// If it is null, we're using user-supplied implementation. Establish generic defaults
// in case the user doesn't provide an options object.
this.partitionManagerOptions = new PartitionManagerOptions();
}
// Normally will not be null because we're using the AzureStorage implementation.
// If it is null, we're using user-supplied implementation. Establish generic defaults
// in case the user doesn't provide an options object.
this.partitionManagerOptions = new PartitionManagerOptions();

if (executorService != null) {
// User has supplied an ExecutorService, so use that.
Expand Down

0 comments on commit 8660233

Please sign in to comment.