You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2015/08/17 21:31:31 UTC

incubator-tinkerpop git commit: Remove deprecation from Transaction.close() related methods/enums.

Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/tp30 46688dd80 -> 2e8d052c9


Remove deprecation from Transaction.close() related methods/enums.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/2e8d052c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/2e8d052c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/2e8d052c

Branch: refs/heads/tp30
Commit: 2e8d052c9aebf2def04ae169b27dc808ef11a22b
Parents: 46688dd
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Aug 17 15:30:56 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Aug 17 15:30:56 2015 -0400

----------------------------------------------------------------------
 .../gremlin/structure/Transaction.java          | 44 +-------------------
 .../structure/util/AbstractTransaction.java     |  1 -
 2 files changed, 1 insertion(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2e8d052c/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Transaction.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Transaction.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Transaction.java
index b3eb69e..56b22e0 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Transaction.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Transaction.java
@@ -44,7 +44,7 @@ import java.util.function.Function;
  * @author Stephen Mallette (http://stephen.genoprime.com)
  * @author TinkerPop Community (http://tinkerpop.com)
  */
-public interface Transaction extends Closeable {
+public interface Transaction extends AutoCloseable {
 
     /**
      * Opens a transaction.
@@ -89,19 +89,8 @@ public interface Transaction extends Closeable {
     /**
      * Closes the transaction where the default close behavior defined by {{@link #onClose(Consumer)}} will be
      * executed.
-     *
-     * @deprecated As of release 3.0.1 and will not be replaced.
-     *             The intention is to no longer have {@code Transaction} implement {@code Closeable} as the
-     *             semantics of closing in this context don't make sense.  {@code Transaction}
-     *             is not a "transaction object" - it exists to hide methods from {@link Graph} that manage a
-     *             transaction.  Closing it doesn't make much sense.  It is also doesn't work quite in the intended
-     *             way as it was expected that calls to {@link Graph#close()} would in turn call this method,
-     *             however doing so will not properly close all transactions as most graphs operate in a
-     *             {@code ThreadLocal} context and so a call to this method would typically just close the
-     *             transaction of the current thread.
      */
     @Override
-    @Deprecated
     public void close();
 
     /**
@@ -113,12 +102,7 @@ public interface Transaction extends Closeable {
     /**
      * Describes what happens to a transaction on a call to {@link Graph#close()}. This value can be set using
      * standard behavior defined in {@link CLOSE_BEHAVIOR} or a mapper {@link Consumer} function.
-     *
-     * @deprecated As of release 3.0.1 and will not be replaced.
-     *             Given the deprecation of {@link #close()}, the need to supply a method to set the close
-     *             behavior is unecessary.
      */
-    @Deprecated
     public Transaction onClose(final Consumer<Transaction> consumer);
 
     /**
@@ -167,12 +151,6 @@ public interface Transaction extends Closeable {
             return new UnsupportedOperationException("Graph does not support threaded transactions");
         }
 
-        /**
-         * @deprecated As of release 3.0.1 and will not be replaced.
-         *             Given the deprecation of {@link #close()}, the need to supply a method to set the close
-         *             behavior is unecessary.
-         */
-        @Deprecated
         public static IllegalArgumentException onCloseBehaviorCannotBeNull() {
             return new IllegalArgumentException("Transaction behavior for onClose cannot be null");
         }
@@ -185,21 +163,11 @@ public interface Transaction extends Closeable {
     /**
      * Behaviors to supply to the {@link #onClose(Consumer)}. The semantics of these behaviors must be examined in
      * the context of the implementation.  In most cases, these behaviors will be applied as {{@link ThreadLocal}}.
-     *
-     * @deprecated As of release 3.0.1 and will not be replaced.
-     *             Given the deprecation of {@link #close()}, the need to supply a method to set the close
-     *             behavior is unecessary.
      */
-    @Deprecated
     public enum CLOSE_BEHAVIOR implements Consumer<Transaction> {
         /**
          * Commit the transaction when {@link #close()} is called.
-         *
-         * @deprecated As of release 3.0.1 and will not be replaced.
-         *             Given the deprecation of {@link #close()}, the need to supply a method to set the close
-         *             behavior is unecessary.
          */
-        @Deprecated
         COMMIT {
             @Override
             public void accept(final Transaction transaction) {
@@ -209,12 +177,7 @@ public interface Transaction extends Closeable {
 
         /**
          * Rollback the transaction when {@link #close()} is called.
-         *
-         * @deprecated As of release 3.0.1 and will not be replaced.
-         *             Given the deprecation of {@link #close()}, the need to supply a method to set the close
-         *             behavior is unecessary.
          */
-        @Deprecated
         ROLLBACK {
             @Override
             public void accept(final Transaction transaction) {
@@ -224,12 +187,7 @@ public interface Transaction extends Closeable {
 
         /**
          * Throw an exception if the current transaction is open when {@link #close()} is called.
-         *
-         * @deprecated As of release 3.0.1 and will not be replaced.
-         *             Given the deprecation of {@link #close()}, the need to supply a method to set the close
-         *             behavior is unecessary.
          */
-        @Deprecated
         MANUAL {
             @Override
             public void accept(final Transaction transaction) {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2e8d052c/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/AbstractTransaction.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/AbstractTransaction.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/AbstractTransaction.java
index 3b3fd6d..4d15a45 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/AbstractTransaction.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/AbstractTransaction.java
@@ -130,7 +130,6 @@ public abstract class AbstractTransaction implements Transaction {
      * {@inheritDoc}
      */
     @Override
-    @Deprecated
     public void close() {
         closeConsumer.accept(this);
     }