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 A588A200BDA for ; Tue, 29 Nov 2016 00:34:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id A42F4160B0D; Mon, 28 Nov 2016 23:34:00 +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 C56B2160B22 for ; Tue, 29 Nov 2016 00:33:59 +0100 (CET) Received: (qmail 56056 invoked by uid 500); 28 Nov 2016 23:33:59 -0000 Mailing-List: contact commits-help@beam.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@beam.incubator.apache.org Delivered-To: mailing list commits@beam.incubator.apache.org Received: (qmail 56045 invoked by uid 99); 28 Nov 2016 23:33:59 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Nov 2016 23:33:59 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 908F4C0FD4 for ; Mon, 28 Nov 2016 23:33:58 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -6.219 X-Spam-Level: X-Spam-Status: No, score=-6.219 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id CHmpCgoa14BW for ; Mon, 28 Nov 2016 23:33:57 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 233E45F252 for ; Mon, 28 Nov 2016 23:33:55 +0000 (UTC) Received: (qmail 55727 invoked by uid 99); 28 Nov 2016 23:33:55 -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; Mon, 28 Nov 2016 23:33:55 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 302B9EEE1D; Mon, 28 Nov 2016 23:33:55 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: kenn@apache.org To: commits@beam.incubator.apache.org Date: Mon, 28 Nov 2016 23:33:56 -0000 Message-Id: <5f68dfa6488247dc88e9750454e4121a@git.apache.org> In-Reply-To: <8d2fe048267c425aafd16ff6b1440ea8@git.apache.org> References: <8d2fe048267c425aafd16ff6b1440ea8@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/2] incubator-beam git commit: [BEAM-1009] Upgrade byte-buddy version to 1.5.5. archived-at: Mon, 28 Nov 2016 23:34:00 -0000 [BEAM-1009] Upgrade byte-buddy version to 1.5.5. Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/fcd09915 Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/fcd09915 Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/fcd09915 Branch: refs/heads/master Commit: fcd09915fac49f66f6a65f234b34dc34f16fef18 Parents: 0609282 Author: Pei He Authored: Mon Nov 28 12:52:14 2016 -0800 Committer: Kenneth Knowles Committed: Mon Nov 28 15:33:15 2016 -0800 ---------------------------------------------------------------------- pom.xml | 2 +- .../reflect/ByteBuddyDoFnInvokerFactory.java | 23 +++++++++++--------- .../reflect/ByteBuddyOnTimerInvokerFactory.java | 10 ++++----- 3 files changed, 19 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/fcd09915/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index e0ef47c..4e60fab 100644 --- a/pom.xml +++ b/pom.xml @@ -754,7 +754,7 @@ net.bytebuddy byte-buddy - 1.4.3 + 1.5.5 http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/fcd09915/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/ByteBuddyDoFnInvokerFactory.java ---------------------------------------------------------------------- diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/ByteBuddyDoFnInvokerFactory.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/ByteBuddyDoFnInvokerFactory.java index 408ea98..8750d64 100644 --- a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/ByteBuddyDoFnInvokerFactory.java +++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/ByteBuddyDoFnInvokerFactory.java @@ -44,11 +44,11 @@ import net.bytebuddy.implementation.FixedValue; import net.bytebuddy.implementation.Implementation; import net.bytebuddy.implementation.Implementation.Context; import net.bytebuddy.implementation.MethodDelegation; -import net.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder; import net.bytebuddy.implementation.bytecode.ByteCodeAppender; import net.bytebuddy.implementation.bytecode.StackManipulation; import net.bytebuddy.implementation.bytecode.Throw; import net.bytebuddy.implementation.bytecode.assign.Assigner; +import net.bytebuddy.implementation.bytecode.assign.Assigner.Typing; import net.bytebuddy.implementation.bytecode.assign.TypeCasting; import net.bytebuddy.implementation.bytecode.constant.TextConstant; import net.bytebuddy.implementation.bytecode.member.FieldAccess; @@ -425,7 +425,7 @@ public class ByteBuddyDoFnInvokerFactory implements DoFnInvokerFactory { StackManipulation manipulation = new StackManipulation.Compound( // Push "this" (DoFnInvoker on top of the stack) - MethodVariableAccess.REFERENCE.loadOffset(0), + MethodVariableAccess.REFERENCE.loadFrom(0), // Access this.delegate (DoFn on top of the stack) FieldAccess.forField(delegateField).getter(), // Cast it to the more precise type @@ -471,8 +471,11 @@ public class ByteBuddyDoFnInvokerFactory implements DoFnInvokerFactory { * returns void) or contain the value for the instrumented method to return). */ protected StackManipulation afterDelegation(MethodDescription instrumentedMethod) { - return TargetMethodAnnotationDrivenBinder.TerminationHandler.Returning.INSTANCE.resolve( - Assigner.DEFAULT, instrumentedMethod, targetMethod); + return new StackManipulation.Compound( + Assigner.DEFAULT.assign( + targetMethod.getReturnType(), + instrumentedMethod.getReturnType(), Typing.STATIC), + MethodReturn.of(instrumentedMethod.getReturnType())); } } @@ -491,7 +494,7 @@ public class ByteBuddyDoFnInvokerFactory implements DoFnInvokerFactory { TypeList.Generic paramTypes = targetMethod.getParameters().asTypeList(); for (int i = 0; i < paramTypes.size(); i++) { TypeDescription.Generic paramT = paramTypes.get(i); - pushParameters.add(MethodVariableAccess.of(paramT).loadOffset(i + 1)); + pushParameters.add(MethodVariableAccess.of(paramT).loadFrom(i + 1)); if (!paramT.isPrimitive()) { pushParameters.add(TypeCasting.to(paramT)); } @@ -634,10 +637,10 @@ public class ByteBuddyDoFnInvokerFactory implements DoFnInvokerFactory { // To load the delegate, push `this` and then access the field StackManipulation pushDelegate = new StackManipulation.Compound( - MethodVariableAccess.REFERENCE.loadOffset(0), + MethodVariableAccess.REFERENCE.loadFrom(0), FieldAccess.forField(delegateField).getter()); - StackManipulation pushExtraContextFactory = MethodVariableAccess.REFERENCE.loadOffset(1); + StackManipulation pushExtraContextFactory = MethodVariableAccess.REFERENCE.loadFrom(1); // Push the arguments in their actual order. for (DoFnSignature.Parameter param : signature.extraParameters()) { @@ -654,7 +657,7 @@ public class ByteBuddyDoFnInvokerFactory implements DoFnInvokerFactory { return new StackManipulation.Compound( MethodInvocation.invoke(PROCESS_CONTINUATION_STOP_METHOD), MethodReturn.REFERENCE); } else { - return MethodReturn.returning(targetMethod.getReturnType().asErasure()); + return MethodReturn.of(targetMethod.getReturnType().asErasure()); } } } @@ -820,9 +823,9 @@ public class ByteBuddyDoFnInvokerFactory implements DoFnInvokerFactory { StackManipulation.Size size = new StackManipulation.Compound( // Load the this reference - MethodVariableAccess.REFERENCE.loadOffset(0), + MethodVariableAccess.REFERENCE.loadFrom(0), // Load the delegate argument - MethodVariableAccess.REFERENCE.loadOffset(1), + MethodVariableAccess.REFERENCE.loadFrom(1), // Invoke the super constructor (default constructor of Object) MethodInvocation.invoke( new TypeDescription.ForLoadedType(DoFnInvokerBase.class) http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/fcd09915/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/ByteBuddyOnTimerInvokerFactory.java ---------------------------------------------------------------------- diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/ByteBuddyOnTimerInvokerFactory.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/ByteBuddyOnTimerInvokerFactory.java index 7a39ed1..786857a 100644 --- a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/ByteBuddyOnTimerInvokerFactory.java +++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/ByteBuddyOnTimerInvokerFactory.java @@ -238,10 +238,10 @@ class ByteBuddyOnTimerInvokerFactory implements OnTimerInvokerFactory { // To load the delegate, push `this` and then access the field StackManipulation pushDelegate = new StackManipulation.Compound( - MethodVariableAccess.REFERENCE.loadOffset(0), + MethodVariableAccess.REFERENCE.loadFrom(0), FieldAccess.forField(delegateField).getter()); - StackManipulation pushExtraContextFactory = MethodVariableAccess.REFERENCE.loadOffset(1); + StackManipulation pushExtraContextFactory = MethodVariableAccess.REFERENCE.loadFrom(1); // Push the extra arguments in their actual order. for (DoFnSignature.Parameter param : signature.extraParameters()) { @@ -275,7 +275,7 @@ class ByteBuddyOnTimerInvokerFactory implements OnTimerInvokerFactory { StackManipulation.Size size = new StackManipulation.Compound( // Load the this reference - MethodVariableAccess.REFERENCE.loadOffset(0), + MethodVariableAccess.REFERENCE.loadFrom(0), // Invoke the super constructor (default constructor of Object) MethodInvocation.invoke( new TypeDescription.ForLoadedType(Object.class) @@ -285,9 +285,9 @@ class ByteBuddyOnTimerInvokerFactory implements OnTimerInvokerFactory { .and(ElementMatchers.takesArguments(0))) .getOnly()), // Load the this reference - MethodVariableAccess.REFERENCE.loadOffset(0), + MethodVariableAccess.REFERENCE.loadFrom(0), // Load the delegate argument - MethodVariableAccess.REFERENCE.loadOffset(1), + MethodVariableAccess.REFERENCE.loadFrom(1), // Assign the delegate argument to the delegate field FieldAccess.forField( implementationTarget