From dev-return-110555-archive-asf-public=cust-asf.ponee.io@cloudstack.apache.org Thu Jan 11 00:12:05 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 9AAF418072F for ; Thu, 11 Jan 2018 00:12:05 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 8AA55160C40; Wed, 10 Jan 2018 23:12:05 +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 A9405160C2E for ; Thu, 11 Jan 2018 00:12:04 +0100 (CET) Received: (qmail 16906 invoked by uid 500); 10 Jan 2018 23:12:03 -0000 Mailing-List: contact dev-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list dev@cloudstack.apache.org Received: (qmail 16895 invoked by uid 99); 10 Jan 2018 23:12:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Jan 2018 23:12:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id ADAD018057F for ; Wed, 10 Jan 2018 23:12:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.001 X-Spam-Level: X-Spam-Status: No, score=-0.001 tagged_above=-999 required=6.31 tests=[SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 34Yclrf-ZF9n for ; Wed, 10 Jan 2018 23:12:00 +0000 (UTC) Received: from smtp.artifact-software.com (modemcable202.79-37-24.static.videotron.ca [24.37.79.202]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id C59C95F343 for ; Wed, 10 Jan 2018 23:11:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp.artifact-software.com (Postfix) with ESMTP id 0E36421EEB20 for ; Wed, 10 Jan 2018 18:11:59 -0500 (EST) X-Virus-Scanned: amavisd-new at artifact-software.com Received: from smtp.artifact-software.com ([127.0.0.1]) by localhost (smtp.artifact-software.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 1ShvlHz8X_vI for ; Wed, 10 Jan 2018 18:11:57 -0500 (EST) Received: from [192.168.3.196] (unknown [192.168.3.196]) by smtp.artifact-software.com (Postfix) with ESMTPSA id 5A70420ED977 for ; Wed, 10 Jan 2018 18:11:57 -0500 (EST) Reply-To: "dev@cloudstack.apache.org" Subject: Re: Which StringUtils to use? To: dev@cloudstack.apache.org References: <5beebeae-d862-5d81-de7c-f88182016309@widodh.nl> <78446554-c8f3-1b53-75cd-b3bd82a2b837@widodh.nl> <7e9d56ca-07e2-6f3c-128f-c70a843da501@widodh.nl> From: Ron Wheeler Organization: Artifact Software Message-ID: <1a787434-90bd-1bcf-ed28-834a995ff7f8@artifact-software.com> Date: Wed, 10 Jan 2018 18:11:51 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-CA Certainly better to find the references and remove them if you can get that done in a single effort. Just a technical question: Could one not just add the Warning to the constructor? Might have to create a null (log warning only) constructor. Ron On 10/01/2018 3:58 PM, Daan Hoogland wrote: > We can add log messages to each of the methods in StringUtils but I do not > think that is a good way to go. Any method you touch you can reform or > remove anyhow. > > On Wed, Jan 10, 2018 at 9:51 PM, Ron Wheeler > wrote: >> Agreed about deprecation. >> A logged WARNing would be detected during testing as well as at run-time. >> >> Ron >> >> On 10/01/2018 3:34 PM, Daan Hoogland wrote: >> >> Ron, we could but that would only log during compile-time, not on runtime. >> I am doing some analysis and commenting in Wido's ticket. >> >> On Wed, Jan 10, 2018 at 9:23 PM, Ron Wheeler > com> wrote: >> >>> Is it possible to mark it as deprecated and have it log a warning when >>> used? >>> >>> Ron >>> >>> >>> On 10/01/2018 2:26 PM, Daan Hoogland wrote: >>> >>>> I think we could start with giving it an explicit non standard name like >>>> CloudStackLocalStringUtils or something a little shorter. Making sure >>>> that >>>> we prefer for these types of utils to be imported from other projects. >>>> >>>> On Wed, Jan 10, 2018 at 4:26 PM, Wido den Hollander >>>> wrote: >>>> >>>> >>>>> On 01/10/2018 01:09 PM, Rafael Weingärtner wrote: >>>>> >>>>> Instead of creating a PR for that, we could do the bit by bit job >>>>>> (hopefully one day we finish the job). >>>>>> Every time we see a code using ACS's StringUtils, we check if it can be >>>>>> replaced by Apache's one. >>>>>> >>>>>> >>>>>> Yes, but that will slip from peoples attention and we will probably see >>>>> cases where people still use the old one by accident. >>>>> >>>>> I've created a issue: https://issues.apache.org/jira >>>>> /browse/CLOUDSTACK-10225 >>>>> >>>>> I also started on some low hanging fruit as some methods in StringUtils >>>>> are not used or are very easy to replace. >>>>> >>>>> >>>>> Wido >>>>> >>>>> On Wed, Jan 10, 2018 at 10:01 AM, Wido den Hollander >>>>> >>>>>> wrote: >>>>>> >>>>>> >>>>>> On 01/10/2018 12:01 PM, Daan Hoogland wrote: >>>>>>> I'd say remove as much functionality as we can from 'our' StringUtils >>>>>>> and >>>>>>> >>>>>>>> phase them out asap. >>>>>>>> >>>>>>>> >>>>>>>> Yes, but such a PR would be invasive and would be difficult to merge >>>>>>>> and >>>>>>>> >>>>>>> also break a lot of other code. >>>>>>> >>>>>>> It's not easy since it will touch a lot, but I mean, a lot of files. >>>>>>> >>>>>>> Our StringUtils was a very good solution, but the Apache one is >>>>>>> better I >>>>>>> think. >>>>>>> >>>>>>> Wido >>>>>>> >>>>>>> >>>>>>> On Wed, Jan 10, 2018 at 11:59 AM, Wido den Hollander >>>>>>> >>>>>>> wrote: >>>>>>>> Hi, >>>>>>>> >>>>>>>> We have com.cloud.utils.StringUtils which has a few nice functions, >>>>>>>>> but >>>>>>>>> throughout the code I also see org.apache.commons.lang.StringUtils >>>>>>>>> >>>>>>>>> They both provide about the same functionality, but which one do we >>>>>>>>> prefer? >>>>>>>>> >>>>>>>>> I'd say org.apache.commons.lang.StringUtils as that allows us to >>>>>>>>> remove >>>>>>>>> our own StringUtils, but we could also have 'our' StringUtils simply >>>>>>>>> be a >>>>>>>>> wrapper around org.apache.commons.lang.StringUtils >>>>>>>>> >>>>>>>>> Opinions? >>>>>>>>> >>>>>>>>> Wido >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>> >>> -- >>> Ron Wheeler >>> President >>> Artifact Software Inc >>> email: rwheeler@artifact-software.com >>> skype: ronaldmwheeler >>> phone: 866-970-2435, ext 102 >>> >>> >> >> -- >> Daan >> >> >> -- >> Ron Wheeler >> President >> Artifact Software Inc >> email: rwheeler@artifact-software.com >> skype: ronaldmwheeler >> phone: 866-970-2435, ext 102 >> >> > -- Ron Wheeler President Artifact Software Inc email: rwheeler@artifact-software.com skype: ronaldmwheeler phone: 866-970-2435, ext 102