Return-Path: Delivered-To: apmail-click-commits-archive@www.apache.org Received: (qmail 33864 invoked from network); 14 Mar 2011 13:02:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Mar 2011 13:02:08 -0000 Received: (qmail 95698 invoked by uid 500); 14 Mar 2011 13:02:08 -0000 Delivered-To: apmail-click-commits-archive@click.apache.org Received: (qmail 95686 invoked by uid 500); 14 Mar 2011 13:02:07 -0000 Mailing-List: contact commits-help@click.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: click-dev@click.apache.org Delivered-To: mailing list commits@click.apache.org Received: (qmail 95678 invoked by uid 99); 14 Mar 2011 13:02:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Mar 2011 13:02:07 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Mar 2011 13:02:05 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 2016E23889B9; Mon, 14 Mar 2011 13:01:42 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1081355 - /click/trunk/click/framework/src/org/apache/click/util/ErrorReport.java Date: Mon, 14 Mar 2011 13:01:42 -0000 To: commits@click.apache.org From: sabob@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110314130142.2016E23889B9@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sabob Date: Mon Mar 14 13:01:41 2011 New Revision: 1081355 URL: http://svn.apache.org/viewvc?rev=1081355&view=rev Log: fix potential IndexOutOfBoundsException Modified: click/trunk/click/framework/src/org/apache/click/util/ErrorReport.java Modified: click/trunk/click/framework/src/org/apache/click/util/ErrorReport.java URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/util/ErrorReport.java?rev=1081355&r1=1081354&r2=1081355&view=diff ============================================================================== --- click/trunk/click/framework/src/org/apache/click/util/ErrorReport.java (original) +++ click/trunk/click/framework/src/org/apache/click/util/ErrorReport.java Mon Mar 14 13:01:41 2011 @@ -414,10 +414,13 @@ public class ErrorReport { if (isParseError()) { String message = error.getMessage(); + String parseMsg = message; int startIndex = message.indexOf('\n'); int endIndex = message.lastIndexOf("..."); - String parseMsg = message.substring(startIndex + 1, endIndex); + if (startIndex != -1 && endIndex > startIndex) { + parseMsg = message.substring(startIndex + 1, endIndex); + } parseMsg = ClickUtils.escapeHtml(parseMsg);