Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A5A772004F5 for ; Fri, 11 Aug 2017 15:39:28 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A447716D40F; Fri, 11 Aug 2017 13:39:28 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CC25816D40C for ; Fri, 11 Aug 2017 15:39:27 +0200 (CEST) Received: (qmail 20394 invoked by uid 500); 11 Aug 2017 13:39:27 -0000 Mailing-List: contact commits-help@tinkerpop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tinkerpop.apache.org Delivered-To: mailing list commits@tinkerpop.apache.org Received: (qmail 20358 invoked by uid 99); 11 Aug 2017 13:39:27 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Aug 2017 13:39:27 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E3DC3EE68A; Fri, 11 Aug 2017 13:39:26 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dkuppitz@apache.org To: commits@tinkerpop.apache.org Date: Fri, 11 Aug 2017 13:39:27 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [02/29] tinkerpop git commit: Fixed a lambda-leak in SackValueStep where BiFunction could be a real lambda. archived-at: Fri, 11 Aug 2017 13:39:28 -0000 Fixed a lambda-leak in SackValueStep where BiFunction could be a real lambda. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/839dd616 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/839dd616 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/839dd616 Branch: refs/heads/TINKERPOP-1742-master Commit: 839dd616729e7b11baf044c5bbbbd65723b1f383 Parents: 1e46fc4 Author: Marko A. Rodriguez Authored: Tue Aug 8 10:12:11 2017 -0600 Committer: Stephen Mallette Committed: Wed Aug 9 07:11:20 2017 -0400 ---------------------------------------------------------------------- CHANGELOG.asciidoc | 1 + .../gremlin/process/traversal/step/sideEffect/SackValueStep.java | 4 ++++ .../strategy/verification/LambdaRestrictionStrategy.java | 3 +++ .../strategy/verification/LambdaRestrictionStrategyTest.java | 4 ++++ 4 files changed, 12 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/839dd616/CHANGELOG.asciidoc ---------------------------------------------------------------------- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 803f3b2..767ba09 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -28,6 +28,7 @@ TinkerPop 3.2.6 (Release Date: NOT OFFICIALLY RELEASED YET) This release also includes changes from <>. +* Fixed a lambda-leak in `SackValueStep` where `BiFunction` must be tested for true lambda status. * Allowed access to `InjectStep.injections` for `TraversalStrategy` analysis. * Exceptions that occur during result iteration in Gremlin Server will now return `SCRIPT_EVALUATION_EXCEPTION` rather than `SERVER_ERROR`. * `AddEdgeStep` attaches detached vertices prior to edge creation. http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/839dd616/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/SackValueStep.java ---------------------------------------------------------------------- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/SackValueStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/SackValueStep.java index 7f030d6..3281fa7 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/SackValueStep.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/SackValueStep.java @@ -70,6 +70,10 @@ public final class SackValueStep extends SideEffectStep implements T return super.hashCode() ^ this.sackFunction.hashCode() ^ ((null == this.sackTraversal) ? "null".hashCode() : this.sackTraversal.hashCode()); } + public BiFunction getSackFunction() { + return this.sackFunction; + } + @Override public Set getRequirements() { return getSelfAndChildRequirements(TraverserRequirement.SACK); http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/839dd616/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/LambdaRestrictionStrategy.java ---------------------------------------------------------------------- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/LambdaRestrictionStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/LambdaRestrictionStrategy.java index 9828d61..1b925ca 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/LambdaRestrictionStrategy.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/LambdaRestrictionStrategy.java @@ -23,6 +23,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.Traversal; import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy; import org.apache.tinkerpop.gremlin.process.traversal.step.ComparatorHolder; import org.apache.tinkerpop.gremlin.process.traversal.step.LambdaHolder; +import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SackValueStep; import org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy; import org.javatuples.Pair; @@ -64,6 +65,8 @@ public final class LambdaRestrictionStrategy extends AbstractTraversalStrategy a+b}.by('age')", __.sack((a, b) -> (int) a + (int) b).by("age"), false}, }); }