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 9563F200C5B for ; Thu, 27 Apr 2017 14:25:42 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 93F6B160BA7; Thu, 27 Apr 2017 12:25:42 +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 0CEDF160B98 for ; Thu, 27 Apr 2017 14:25:41 +0200 (CEST) Received: (qmail 17298 invoked by uid 500); 27 Apr 2017 12:25:41 -0000 Mailing-List: contact dev-help@jmeter.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jmeter.apache.org Delivered-To: mailing list dev@jmeter.apache.org Received: (qmail 17287 invoked by uid 99); 27 Apr 2017 12:25:40 -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; Thu, 27 Apr 2017 12:25:40 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D450BDFBBB; Thu, 27 Apr 2017 12:25:40 +0000 (UTC) From: emilianbold To: dev@jmeter.apache.org Reply-To: dev@jmeter.apache.org References: In-Reply-To: Subject: [GitHub] jmeter issue #293: Prevent use of the same array in CollectionProperty (clos... Content-Type: text/plain Message-Id: <20170427122540.D450BDFBBB@git1-us-west.apache.org> Date: Thu, 27 Apr 2017 12:25:40 +0000 (UTC) archived-at: Thu, 27 Apr 2017 12:25:42 -0000 Github user emilianbold commented on the issue: https://github.com/apache/jmeter/pull/293 Like I've said, I wanted my patch to be low-impact. Ideally normalizeList should be something like this: ```java protected Collection normalizeList(Collection coll) { return coll.stream() .map(this::convertObject) .collect(Collectors.toCollection(ArrayList::new)); } ``` Then normalizeMap should be like this: ```java protected Map normalizeMap(Map coll) { return coll.entrySet() .stream() .collect(Collectors.toMap(entry -> { Object key = entry.getKey(); if (key == null) { return null; } else { if (!(key instanceof String)) { log.error("Expected key type String, found: {}", key.getClass()); } return key.toString(); } }, entry -> convertObject(entry.getValue()))); } ``` --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---