Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 24375 invoked from network); 29 Nov 2009 05:54:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 29 Nov 2009 05:54:45 -0000 Received: (qmail 48496 invoked by uid 500); 29 Nov 2009 05:54:45 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 48196 invoked by uid 500); 29 Nov 2009 05:54:43 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 48186 invoked by uid 99); 29 Nov 2009 05:54:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 29 Nov 2009 05:54:43 +0000 X-ASF-Spam-Status: No, hits=-10.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 29 Nov 2009 05:54:40 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C36DC234C052 for ; Sat, 28 Nov 2009 21:54:20 -0800 (PST) Message-ID: <756091771.1259474060784.JavaMail.jira@brutus> Date: Sun, 29 Nov 2009 05:54:20 +0000 (UTC) From: "Paul Benedict (JIRA)" To: issues@commons.apache.org Subject: [jira] Commented: (LANG-508) Validate: add message parameter construction via elllipsis notation to speed up processing In-Reply-To: <1711795915.1244405647624.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LANG-508?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12783363#action_12783363 ] Paul Benedict commented on LANG-508: ------------------------------------ I am preparing to use java.lang.String#format over MessageFormat. > Validate: add message parameter construction via elllipsis notation to speed up processing > ------------------------------------------------------------------------------------------ > > Key: LANG-508 > URL: https://issues.apache.org/jira/browse/LANG-508 > Project: Commons Lang > Issue Type: Improvement > Affects Versions: 2.4 > Reporter: Mark Struberg > Fix For: 3.0 > > Attachments: LANG-508.patch > > > Currently passing verbose message strings to a log of commons.lang.Validate functions costs a lot of performance. > A typical usecase currently is: > {noformat} > Validate.isTrue (argInt1.intValue > argInt2.intValue, "param2 actually is " + argInt2 + " but must larger than param1 " + argInt1 +" !"); > {noformat} > So all the string operations get executed regardless if the validation fails or not. > This can be made perform much better by moving all the string operations inside the respective validation function and execute it only if the validation fails: > {noformat} > Validate.isTrue(argInt1.intValue > argInt2.intValue, "param2 actually is {1} but must larger than param1 {0} !", argInt1, argInt2); > {noformat} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.