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 EF4EC200C21 for ; Mon, 20 Feb 2017 23:19:16 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id EDC3D160B73; Mon, 20 Feb 2017 22:19:16 +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 47494160B58 for ; Mon, 20 Feb 2017 23:19:16 +0100 (CET) Received: (qmail 16022 invoked by uid 500); 20 Feb 2017 22:19:15 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 16013 invoked by uid 99); 20 Feb 2017 22:19:15 -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; Mon, 20 Feb 2017 22:19:15 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 19EE9DFADC; Mon, 20 Feb 2017 22:19:15 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: pascalschumacher@apache.org To: commits@commons.apache.org Message-Id: <97b4c2efc7ee426aa2a12277f4f3fcdc@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [lang] Validate's String.format without arguments (closes #238) Date: Mon, 20 Feb 2017 22:19:15 +0000 (UTC) archived-at: Mon, 20 Feb 2017 22:19:17 -0000 Repository: commons-lang Updated Branches: refs/heads/master 954ade4c1 -> a64153a37 Validate's String.format without arguments (closes #238) While calling String.format("some string") without any additional arguments is not technically wrong, it's redundant, as it just returns the same string. Removing these calls and just using the string instead both cleans up the code and offers a (very slight) performance gain. Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/a64153a3 Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/a64153a3 Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/a64153a3 Branch: refs/heads/master Commit: a64153a3710c5035988690f0acf57dd61b711cf4 Parents: 954ade4 Author: Allon Mureinik Authored: Sat Feb 18 11:56:09 2017 +0200 Committer: pascalschumacher Committed: Mon Feb 20 23:18:50 2017 +0100 ---------------------------------------------------------------------- src/main/java/org/apache/commons/lang3/Validate.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-lang/blob/a64153a3/src/main/java/org/apache/commons/lang3/Validate.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/lang3/Validate.java b/src/main/java/org/apache/commons/lang3/Validate.java index 508845a..fc52cb4 100644 --- a/src/main/java/org/apache/commons/lang3/Validate.java +++ b/src/main/java/org/apache/commons/lang3/Validate.java @@ -1052,7 +1052,7 @@ public class Validate { public static void inclusiveBetween(final long start, final long end, final long value, final String message) { // TODO when breaking BC, consider returning value if (value < start || value > end) { - throw new IllegalArgumentException(String.format(message)); + throw new IllegalArgumentException(message); } } @@ -1096,7 +1096,7 @@ public class Validate { public static void inclusiveBetween(final double start, final double end, final double value, final String message) { // TODO when breaking BC, consider returning value if (value < start || value > end) { - throw new IllegalArgumentException(String.format(message)); + throw new IllegalArgumentException(message); } } @@ -1190,7 +1190,7 @@ public class Validate { public static void exclusiveBetween(final long start, final long end, final long value, final String message) { // TODO when breaking BC, consider returning value if (value <= start || value >= end) { - throw new IllegalArgumentException(String.format(message)); + throw new IllegalArgumentException(message); } } @@ -1234,7 +1234,7 @@ public class Validate { public static void exclusiveBetween(final double start, final double end, final double value, final String message) { // TODO when breaking BC, consider returning value if (value <= start || value >= end) { - throw new IllegalArgumentException(String.format(message)); + throw new IllegalArgumentException(message); } }