X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=opendaylight%2Fmd-sal%2Fsal-dom-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fdom%2Fbroker%2Fimpl%2FPingPongFuture.java;h=63aba6e5f729267ac39340ab4e364bc8f8df6c1c;hb=6cd5778f454ba882d0e15361dfa6a5cd06721d97;hp=611303a41adcfede958c88fb1bb1d8d32304c129;hpb=412db94945c5db5d2da918f5e23bd3abcecc4d10;p=controller.git diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongFuture.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongFuture.java index 611303a41a..63aba6e5f7 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongFuture.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongFuture.java @@ -12,20 +12,22 @@ import com.google.common.util.concurrent.ListenableFuture; import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; /** - * A {@link Future} used to report the status of an future {@link java.util.concurrent.Future}. + * A {@link java.util.concurrent.Future} used to report the status of an future + * {@link java.util.concurrent.Future}. */ final class PingPongFuture extends AbstractCheckedFuture { - protected PingPongFuture(final ListenableFuture delegate) { - super(delegate); - } + protected PingPongFuture(final ListenableFuture delegate) { + super(delegate); + } - @Override - protected TransactionCommitFailedException mapException(final Exception e) { - if (e.getCause() instanceof TransactionCommitFailedException){ - return (TransactionCommitFailedException) e.getCause(); - } else { - return new TransactionCommitFailedException(e.getMessage(), e.getCause(), null); + @Override + protected TransactionCommitFailedException mapException(final Exception exception) { + final Throwable cause = exception.getCause(); + if (cause instanceof TransactionCommitFailedException) { + return (TransactionCommitFailedException) cause; + } else { + return new TransactionCommitFailedException(exception.getMessage(), cause); + } } - } }