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 E3BAC200CA8 for ; Thu, 1 Jun 2017 00:18:46 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E22C1160BDB; Wed, 31 May 2017 22:18:46 +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 34F27160BCB for ; Thu, 1 Jun 2017 00:18:46 +0200 (CEST) Received: (qmail 64366 invoked by uid 500); 31 May 2017 22:18:40 -0000 Mailing-List: contact dev-help@geode.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.apache.org Delivered-To: mailing list dev@geode.apache.org Received: (qmail 64337 invoked by uid 99); 31 May 2017 22:18:40 -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; Wed, 31 May 2017 22:18:40 +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 B71101A0480; Wed, 31 May 2017 22:18:39 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.25 X-Spam-Level: *** X-Spam-Status: No, score=3.25 tagged_above=-999 required=6.31 tests=[HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=2, KAM_LAZY_DOMAIN_SECURITY=1, KAM_LOTSOFHASH=0.25, RP_MATCHES_RCVD=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id pcAcHgCyVFnY; Wed, 31 May 2017 22:18:38 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 50B8F5F19D; Wed, 31 May 2017 22:18:37 +0000 (UTC) Received: from reviews.apache.org (unknown [10.41.0.12]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id A774DE0373; Wed, 31 May 2017 22:18:36 +0000 (UTC) Received: from reviews-vm2.apache.org (localhost [IPv6:::1]) by reviews.apache.org (ASF Mail Server at reviews-vm2.apache.org) with ESMTP id 770E8C40102; Wed, 31 May 2017 22:18:36 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============8903749838280203576==" MIME-Version: 1.0 Subject: Re: Review Request 59686: GEODE-2983: correctly handling --J option value that has ", " inside. From: Jared Stewart To: Kirk Lund , Patrick Rhomberg , Emily Yeh , Jared Stewart , Ken Howe Cc: Jinmei Liao , geode Date: Wed, 31 May 2017 22:18:36 -0000 Message-ID: <20170531221836.8717.58340@reviews-vm2.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: Jared Stewart X-ReviewGroup: geode X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/59686/ X-Sender: Jared Stewart References: <20170531174248.8718.75565@reviews-vm2.apache.org> In-Reply-To: <20170531174248.8718.75565@reviews-vm2.apache.org> Reply-To: Jared Stewart X-ReviewRequest-Repository: geode archived-at: Wed, 31 May 2017 22:18:47 -0000 --===============8903749838280203576== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/59686/#review176535 ----------------------------------------------------------- geode-core/src/main/java/org/apache/geode/management/internal/cli/GfshParser.java Lines 48 (patched) I worry that a user may at some point specify a `--J` option that includes `,,`. I think our code could be more robust by using a delimeter that a user can't type on a standard keyboard. The ASCII "Unit separator" character (decimal code 31, hex 0x1f) seems like a natural candidate. That would make this look like: ``` private static final char ASCII_UNIT_SEPARATOR = '\u001F'; public static final String JARGUMENT_SPLIREGX = "" + ASCII_UNIT_SEPARATOR; ``` I also think that `J_ARGUMENT_DELIMITER` might be a more informative name. geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/LauncherLifecycleCommands.java Lines 233 (patched) What do you think about adding a field to `GfshParser` that can be referenced by all of these `optionContexts`? Basically: ``` class GfshParser { ... J_ARGUMENT_OPTION_CONTEXT = "splittingRegex=" + JARGUMENT_SPLIREGX; } ``` ``` @CliOption(key = CliStrings.START_LOCATOR__J, optionContext = GfshParser.J_ARGUMENT_OPTION_CONTEXT, help = CliStrings.START_LOCATOR__J__HELP) final String[] jvmArgsOpts, ``` - Jared Stewart On May 31, 2017, 5:42 p.m., Jinmei Liao wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/59686/ > ----------------------------------------------------------- > > (Updated May 31, 2017, 5:42 p.m.) > > > Review request for geode, Emily Yeh, Jared Stewart, Ken Howe, Kirk Lund, and Patrick Rhomberg. > > > Repository: geode > > > Description > ------- > > GEODE-2983: correctly handling --J option value that has "," inside. > > > Diffs > ----- > > geode-core/src/main/java/org/apache/geode/management/internal/cli/GfshParser.java 288ea054ae1230c480d141c0159d6ccf9c299a7d > geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/LauncherLifecycleCommands.java 74acfd6e03613ac4d0c62fcdd4ea859d1c74d2f2 > geode-core/src/test/java/org/apache/geode/management/internal/cli/GfshParserParsingTest.java 4467792f60a2a3bf7cc53cf35e997e7462882539 > > > Diff: https://reviews.apache.org/r/59686/diff/1/ > > > Testing > ------- > > precheckin running > > > Thanks, > > Jinmei Liao > > --===============8903749838280203576==--