Return-Path: X-Original-To: apmail-hadoop-common-dev-archive@www.apache.org Delivered-To: apmail-hadoop-common-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E69C8DF20 for ; Sat, 15 Sep 2012 20:21:09 +0000 (UTC) Received: (qmail 69872 invoked by uid 500); 15 Sep 2012 20:21:08 -0000 Delivered-To: apmail-hadoop-common-dev-archive@hadoop.apache.org Received: (qmail 69747 invoked by uid 500); 15 Sep 2012 20:21:07 -0000 Mailing-List: contact common-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-dev@hadoop.apache.org Received: (qmail 69451 invoked by uid 99); 15 Sep 2012 20:21:07 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 15 Sep 2012 20:21:07 +0000 Date: Sun, 16 Sep 2012 07:21:07 +1100 (NCT) From: "Brandon Li (JIRA)" To: common-dev@hadoop.apache.org Message-ID: <1511209515.84742.1347740467721.JavaMail.jiratomcat@arcas> Subject: [jira] [Created] (HADOOP-8814) Inefficient comparison with the empty string. Use isEmpty() instead MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Brandon Li created HADOOP-8814: ---------------------------------- Summary: Inefficient comparison with the empty string. Use isEmpty() instead Key: HADOOP-8814 URL: https://issues.apache.org/jira/browse/HADOOP-8814 Project: Hadoop Common Issue Type: Improvement Components: conf, fs, fs/s3, ha, io, metrics, performance, record, security, util Reporter: Brandon Li Assignee: Brandon Li Priority: Minor Prior to JDK 6, we can check if a string is empty in 2 ways: * if(s != null && s.length() == 0) * if(("").equals(s)) or if( s.equals("")) Starting from JDK 6, String class has a new convenience and efficient method isEmpty() to check string's length. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira