X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-dom-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fdom%2Fbroker%2Fimpl%2FPingPongFuture.java;h=611303a41adcfede958c88fb1bb1d8d32304c129;hb=9f1061c46af5220ad95d8d0b94411ba2fd832a50;hp=1dfc607e6f069ae4d62878cb329d25aa0260b116;hpb=dcf33df6f7666290340163a0f7c71a63430c827b;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 1dfc607e6f..611303a41a 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 @@ -7,7 +7,6 @@ */ package org.opendaylight.controller.md.sal.dom.broker.impl; -import com.google.common.base.Preconditions; import com.google.common.util.concurrent.AbstractCheckedFuture; import com.google.common.util.concurrent.ListenableFuture; import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; @@ -16,13 +15,17 @@ import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFaile * A {@link 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) { - Preconditions.checkArgument(e instanceof TransactionCommitFailedException); - return (TransactionCommitFailedException) e; + @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); } + } } +