Return-Path: X-Original-To: apmail-incubator-chukwa-dev-archive@www.apache.org Delivered-To: apmail-incubator-chukwa-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 F0ED2D668 for ; Wed, 26 Sep 2012 02:12:08 +0000 (UTC) Received: (qmail 16662 invoked by uid 500); 26 Sep 2012 02:12:08 -0000 Delivered-To: apmail-incubator-chukwa-dev-archive@incubator.apache.org Received: (qmail 15849 invoked by uid 500); 26 Sep 2012 02:12:08 -0000 Mailing-List: contact chukwa-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: chukwa-dev@incubator.apache.org Delivered-To: mailing list chukwa-dev@incubator.apache.org Received: (qmail 15775 invoked by uid 99); 26 Sep 2012 02:12:07 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Sep 2012 02:12:07 +0000 Date: Wed, 26 Sep 2012 13:12:07 +1100 (NCT) From: "Eric Spishak (JIRA)" To: chukwa-dev@incubator.apache.org Message-ID: <1294845149.126525.1348625527773.JavaMail.jiratomcat@arcas> In-Reply-To: <1391500044.58811.1336862448023.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (CHUKWA-642) Unvalidated Regular Expression Usage 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/CHUKWA-642?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Eric Spishak updated CHUKWA-642: -------------------------------- Attachment: CHUKWA-642-1.patch > Unvalidated Regular Expression Usage > ------------------------------------ > > Key: CHUKWA-642 > URL: https://issues.apache.org/jira/browse/CHUKWA-642 > Project: Chukwa > Issue Type: Bug > Reporter: Eric Spishak > Assignee: Eric Spishak > Attachments: CHUKWA-642-1.patch, CHUKWA-642.patch > > > There are seven additional places in Chukwa where regular expressions are used without first being validated as syntactically valid regular expressions. These could lead to unhelpful PatternSyntaxException strack traces instead of useful error messages. Unfortunately, I was not able to produce test conditions to highlight any of these issues. > The attached patch fixes the issues. Note that the patch adds a small RegexUtil class with helper methods to determine whether a String is a valid regular expression and to generate error messages for invalid regular expressions. I feel that these helper methods are more readable than catching the PatternSyntaxException. Furthermore, they allow simpler re-use if needed elsewhere. > I discovered these bugs using a tool named the Regex Checker ([http://types.cs.washington.edu/checker-framework/current/checkers-manual.html#regex-checker]). If you periodically run it on your codebase, then you will learn of other errors like this as soon as they appear. If you are interested, I can share my annotations for Chukwa, which will enable you to run the Regex Checker yourself without any additional effort. -- 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