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 2FF1A200D26 for ; Fri, 20 Oct 2017 09:50:21 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2E6D5160BCB; Fri, 20 Oct 2017 07:50:21 +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 9B5E61609E1 for ; Fri, 20 Oct 2017 09:50:20 +0200 (CEST) Received: (qmail 35503 invoked by uid 500); 20 Oct 2017 07:50:19 -0000 Mailing-List: contact users-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@groovy.apache.org Delivered-To: mailing list users@groovy.apache.org Received: (qmail 35493 invoked by uid 99); 20 Oct 2017 07:50:19 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Oct 2017 07:50:19 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 5B01B1A0278 for ; Fri, 20 Oct 2017 07:50:18 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.001 X-Spam-Level: * X-Spam-Status: No, score=1.001 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id fosFNE9wy24C for ; Fri, 20 Oct 2017 07:50:17 +0000 (UTC) Received: from dd23128.kasserver.com (dd23128.kasserver.com [85.13.142.182]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 2DD845FC38 for ; Fri, 20 Oct 2017 07:50:17 +0000 (UTC) Received: from [10.10.10.12] (p3EE07378.dip0.t-ipconnect.de [62.224.115.120]) by dd23128.kasserver.com (Postfix) with ESMTPSA id F069D2F60194 for ; Fri, 20 Oct 2017 09:50:15 +0200 (CEST) To: users@groovy.apache.org From: Michael Kunz Subject: Unexpected byte[] parameter conversion when calling java method Message-ID: <47df1fa1-5316-da08-1ff8-48533b7f9a2d@kuebrich.com> Date: Fri, 20 Oct 2017 09:51:01 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:58.0) Gecko/20100101 Thunderbird/58.0a1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US archived-at: Fri, 20 Oct 2017 07:50:21 -0000 Hello, I'm having problems calling a Java method call(byte[]... data) from groovy 2.4.12. I'm trying to call it with a single byte[] value from groovy like this: byte[] data = [0,1,2,3,4,5,6,7] TestJava.call(data) I was expecting to receive a byte[][] data = {{0,1,2,3,4,5,6,7}} in Java but instead have a split array of the form byte[][] data = {{0},{1},{2},{3},{4},{5},{6},{7}} which doesn't make sense to me. A full example is available at https://gist.github.com/protogenes/93a5d76075b45ba5a946034820f03c76 What is the expected behaviour and why? Can I change the Java method signature in a way so that the arrays are preserved? Regards, Michael