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 67074200C88 for ; Fri, 19 May 2017 01:28:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 65925160BC4; Thu, 18 May 2017 23:28:10 +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 87075160BB5 for ; Fri, 19 May 2017 01:28:09 +0200 (CEST) Received: (qmail 59766 invoked by uid 500); 18 May 2017 23:28:08 -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 59755 invoked by uid 99); 18 May 2017 23:28:08 -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; Thu, 18 May 2017 23:28:08 +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 423771A0420 for ; Thu, 18 May 2017 23:28:08 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] 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 w7YiuC8hPPOI for ; Thu, 18 May 2017 23:28:06 +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 C53715FD9C for ; Thu, 18 May 2017 23:28:05 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id E8577E0D4D for ; Thu, 18 May 2017 23:28:04 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 3E6A121B5A for ; Thu, 18 May 2017 23:28:04 +0000 (UTC) Date: Thu, 18 May 2017 23:28:04 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: dev@geode.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (GEODE-1994) Change geode StringUtils to extend commons StringUtils MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 18 May 2017 23:28:10 -0000 [ https://issues.apache.org/jira/browse/GEODE-1994?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16016649#comment-16016649 ] ASF GitHub Bot commented on GEODE-1994: --------------------------------------- GitHub user PurelyApplied opened a pull request: https://github.com/apache/geode/pull/521 GEODE-1994: Overhaul of internal.lang.StringUtils to extend and heavily use commons.lang.StringUtils * geode.internal.lang.StringUtils has been deprecated. In the interim, it has been heavily refactored and extends commons.lang.StringUtils. * * Renamed: * -- EMPTY_STRING -> EMPTY (inherited) * -- toUpperCase -> upperCase (inherited) * -- toLowerCase -> lowerCase (inherited) * -- padEnding -> rightPad (inherited) * * Removed: * -- EMPTY_STRING_ARRAY; usage replaced with commons.lang.ArrayUtils.EMPTY_STRING_ARRAY * -- SPACES * -- UTF_8; rare usage replaced with raw string * -- concat; usage replaced with commons.lang.join, refactoring as necessary. * -- getLettersOnly * -- getSpaces * -- truncate * -- valueOf; usage refactored to use defaultString * * Refactored * -- defaultIfBlank: previously relied on varargs and could return null. Usage refactored to allow inheritance from commons. * -- defaultString(s, EMPTY) refactored to use standard signature defaultString(s) for consistency throughout codebase. * -- isBlank: usage refactored to resolve discrepancies with commons.lang.isBlank, which is now inherited. * -- isEmpty: usage refactored to resolve discrepancies with commons.lang.isEmpty, which is now inherited. * * Code Cleanup: * -- Many uses of !isBlank -> isNotBlank * -- Changes suggested by Inspections on most touched files. * -- Explicit -> <> when type is inferable * -- while loops operating on iterators converted to for each loops * -- for loops operating on array indices converted to for each loops * -- Various string typos corrected. * -- isEmpty(s.trim()) -> isBlank(s) * -- s.trim().isEmpty() -> isEmpty(s) * -- Removed some instances of 'dead' code * -- Optimized imports in every touched file * * Qualitative Changes: * -- The following functions now throw an error when called with a null string input: * -- * LocatorLauncher.Builder.setMemberName * -- * ServerLauncher.Builder.setMemberName * -- * ServerLauncher.Builder.setHostnameForClients * -- (Unit tests added to capture these changes) * * Notes: * -- StringUtils.wraps may be inherited from Apache Commons when the dependency is updated. * -- AbstractLauncher.getMember has the documented behavior of returning null when both MemberName and ID are blank. Is this the best behavior for this method? You can merge this pull request into a Git repository by running: $ git pull https://github.com/PurelyApplied/geode geode-1994 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/geode/pull/521.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #521 ---- commit 327e1ae4b7b6e3503b0e295e6c883c387fa03b47 Author: Patrick Rhomberg Date: 2017-05-17T23:57:07Z GEODE-1994: Overhaul of internal.lang.StringUtils to extend and heavily use commons.lang.StringUtils * geode.internal.lang.StringUtils has been deprecated. In the interim, it has been heavily refactored and extends commons.lang.StringUtils. * * Renamed: * -- EMPTY_STRING -> EMPTY (inherited) * -- toUpperCase -> upperCase (inherited) * -- toLowerCase -> lowerCase (inherited) * -- padEnding -> rightPad (inherited) * * Removed: * -- EMPTY_STRING_ARRAY; usage replaced with commons.lang.ArrayUtils.EMPTY_STRING_ARRAY * -- SPACES * -- UTF_8; rare usage replaced with raw string * -- concat; usage replaced with commons.lang.join, refactoring as necessary. * -- getLettersOnly * -- getSpaces * -- truncate * -- valueOf; usage refactored to use defaultString * * Refactored * -- defaultIfBlank: previously relied on varargs and could return null. Usage refactored to allow inheritance from commons. * -- defaultString(s, EMPTY) refactored to use standard signature defaultString(s) for consistency throughout codebase. * -- isBlank: usage refactored to resolve discrepancies with commons.lang.isBlank, which is now inherited. * -- isEmpty: usage refactored to resolve discrepancies with commons.lang.isEmpty, which is now inherited. * * Code Cleanup: * -- Many uses of !isBlank -> isNotBlank * -- Changes suggested by Inspections on most touched files. * -- Explicit -> <> when type is inferable * -- while loops operating on iterators converted to for each loops * -- for loops operating on array indices converted to for each loops * -- Various string typos corrected. * -- isEmpty(s.trim()) -> isBlank(s) * -- s.trim().isEmpty() -> isEmpty(s) * -- Removed some instances of 'dead' code * -- Optimized imports in every touched file * * Qualitative Changes: * -- The following functions now throw an error when called with a null string input: * -- * LocatorLauncher.Builder.setMemberName * -- * ServerLauncher.Builder.setMemberName * -- * ServerLauncher.Builder.setHostnameForClients * -- (Unit tests added to capture these changes) * * Notes: * -- StringUtils.wraps may be inherited from Apache Commons when the dependency is updated. * -- AbstractLauncher.getMember has the documented behavior of returning null when both MemberName and ID are blank. Is this the best behavior for this method? ---- > Change geode StringUtils to extend commons StringUtils > ------------------------------------------------------ > > Key: GEODE-1994 > URL: https://issues.apache.org/jira/browse/GEODE-1994 > Project: Geode > Issue Type: Wish > Components: general, management > Reporter: Kirk Lund > Assignee: Patrick Rhomberg > > org.apache.geode.internal.lang.StringUtils duplicates some of the methods in org.apache.commons.lang.StringUtils with some inconsistencies. > isBlank is implemented identically > isEmpty is inconsistent -- commons version returns true if string is null, while geode version returns false if string is null -- This message was sent by Atlassian JIRA (v6.3.15#6346)