Tracing Transaction wrappers delegate equals/hashCode/equals 08/65808/2
authorMichael Vorburger <vorburger@redhat.com>
Tue, 21 Nov 2017 17:13:06 +0000 (18:13 +0100)
committerTom Pantelis <tompantelis@gmail.com>
Thu, 23 Nov 2017 01:09:33 +0000 (01:09 +0000)
to fix IllegalStateException due to DOMBrokerTransactionChain !equals
TracingTransactionChain (only affected odl-mdsal-trace for
trace:transaction anyway)

see https://jira.opendaylight.org/browse/CONTROLLER-1792

Change-Id: I079ff9e99edfd55bec2acbe1984a5c2b7667c2de
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
opendaylight/md-sal/mdsal-trace/dom-impl/src/main/java/org/opendaylight/controller/md/sal/trace/dom/impl/AbstractTracingWriteTransaction.java
opendaylight/md-sal/mdsal-trace/dom-impl/src/main/java/org/opendaylight/controller/md/sal/trace/dom/impl/TracingReadOnlyTransaction.java
opendaylight/md-sal/mdsal-trace/dom-impl/src/main/java/org/opendaylight/controller/md/sal/trace/dom/impl/TracingTransactionChain.java

index a06ee5e..319f214 100644 (file)
@@ -113,4 +113,21 @@ abstract class AbstractTracingWriteTransaction implements DOMDataWriteTransactio
     public Object getIdentifier() {
         return delegate.getIdentifier();
     }
+
+    // https://jira.opendaylight.org/browse/CONTROLLER-1792
+
+    @Override
+    public final boolean equals(Object object) {
+        return object == this || delegate.equals(object);
+    }
+
+    @Override
+    public final int hashCode() {
+        return delegate.hashCode();
+    }
+
+    @Override
+    public final String toString() {
+        return getClass().getName() + "; delegate=" + delegate;
+    }
 }
index 6bc6d66..e275880 100644 (file)
@@ -53,4 +53,22 @@ class TracingReadOnlyTransaction
         super.removeFromTrackedRegistry();
     }
 
+
+    // https://jira.opendaylight.org/browse/CONTROLLER-1792
+
+    @Override
+    public final boolean equals(Object object) {
+        return object == this || delegate.equals(object);
+    }
+
+    @Override
+    public final int hashCode() {
+        return delegate.hashCode();
+    }
+
+    @Override
+    public final String toString() {
+        return getClass().getName() + "; delegate=" + delegate;
+    }
+
 }
index bb65031..b6f2fe0 100644 (file)
@@ -72,4 +72,23 @@ class TracingTransactionChain extends AbstractCloseTracked<TracingTransactionCha
     public CloseTrackedRegistry<TracingWriteTransaction> getWriteTransactionsRegistry() {
         return writeTransactionsRegistry;
     }
+
+
+    // https://jira.opendaylight.org/browse/CONTROLLER-1792
+
+    @Override
+    public final boolean equals(Object object) {
+        return object == this || delegate.equals(object);
+    }
+
+    @Override
+    public final int hashCode() {
+        return delegate.hashCode();
+    }
+
+    @Override
+    public final String toString() {
+        return getClass().getName() + "; delegate=" + delegate;
+    }
+
 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.