Skip to content

Commit

Permalink
SCB-1081 clean up the code format
Browse files Browse the repository at this point in the history
  • Loading branch information
WillemJiang committed Dec 17, 2018
1 parent 39d2d05 commit 76cd97d
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ public void compensate(TxEvent event) {
OmegaCallback omegaCallback = serviceCallbacks.get(event.instanceId());
if (omegaCallback == null) {
LOG.info("Cannot find the service with the instanceId {}, call the other instance.", event.instanceId());

// TODO extract an Interface to let user define the serviceCallback instance pick strategy
Iterator<OmegaCallback> iterator = new ArrayList<>(serviceCallbacks.values()).iterator();
if(iterator.hasNext()) omegaCallback=iterator.next();
if(iterator.hasNext()) {
omegaCallback = iterator.next();
}
}
if(omegaCallback==null){
throw new AlphaException("No such omega callback found for service " + event.serviceName());
Expand Down

0 comments on commit 76cd97d

Please sign in to comment.