Relax visibility on FrontendReadWriteTransaction methods 67/57367/2
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 21 Apr 2017 13:38:03 +0000 (15:38 +0200)
committerRobert Varga <nite@hq.sk>
Thu, 18 May 2017 15:23:46 +0000 (15:23 +0000)
We are invoking these methods from anonymous subclasses, hence
keeping them private forces redirection via synthetic accessors:

 at org.opendaylight.controller.cluster.datastore.FrontendReadWriteTransaction.successfulDirectCanCommit
 at org.opendaylight.controller.cluster.datastore.FrontendReadWriteTransaction.access$300
 at org.opendaylight.controller.cluster.datastore.FrontendReadWriteTransaction$5.onSuccess

This patch makes the methods package-private, which will eliminate
the accessor, improving the stack trace.

Change-Id: Idbd803c43d7ed7333fc392a17edaf61c9721d76f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit abe229278329771993cc6ae09eef2a0a7afc2598)

opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/FrontendReadWriteTransaction.java

index ced91b5acd0cd7b5449a90f70f266c92379b4bc8..64aef6838b1af2969fbe077a7127ff4a04e24c17 100644 (file)
@@ -199,7 +199,7 @@ final class FrontendReadWriteTransaction extends FrontendTransaction {
         });
     }
 
         });
     }
 
-    private void successfulDirectCanCommit(final RequestEnvelope envelope, final long startTime) {
+    void successfulDirectCanCommit(final RequestEnvelope envelope, final long startTime) {
         readyCohort.preCommit(new FutureCallback<DataTreeCandidate>() {
             @Override
             public void onSuccess(final DataTreeCandidate result) {
         readyCohort.preCommit(new FutureCallback<DataTreeCandidate>() {
             @Override
             public void onSuccess(final DataTreeCandidate result) {
@@ -214,7 +214,7 @@ final class FrontendReadWriteTransaction extends FrontendTransaction {
         });
     }
 
         });
     }
 
-    private void successfulDirectPreCommit(final RequestEnvelope envelope, final long startTime) {
+    void successfulDirectPreCommit(final RequestEnvelope envelope, final long startTime) {
         readyCohort.commit(new FutureCallback<UnsignedLong>() {
             @Override
             public void onSuccess(final UnsignedLong result) {
         readyCohort.commit(new FutureCallback<UnsignedLong>() {
             @Override
             public void onSuccess(final UnsignedLong result) {
@@ -229,7 +229,7 @@ final class FrontendReadWriteTransaction extends FrontendTransaction {
         });
     }
 
         });
     }
 
-    private void successfulCommit(final RequestEnvelope envelope, final long startTime) {
+    void successfulCommit(final RequestEnvelope envelope, final long startTime) {
         recordAndSendSuccess(envelope, startTime, new TransactionCommitSuccess(readyCohort.getIdentifier(),
             envelope.getMessage().getSequence()));
         readyCohort = null;
         recordAndSendSuccess(envelope, startTime, new TransactionCommitSuccess(readyCohort.getIdentifier(),
             envelope.getMessage().getSequence()));
         readyCohort = null;