Return-Path: X-Original-To: apmail-incubator-bval-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-bval-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 42EAA4C33 for ; Wed, 15 Jun 2011 22:49:49 +0000 (UTC) Received: (qmail 41558 invoked by uid 500); 15 Jun 2011 22:49:49 -0000 Delivered-To: apmail-incubator-bval-commits-archive@incubator.apache.org Received: (qmail 41528 invoked by uid 500); 15 Jun 2011 22:49:49 -0000 Mailing-List: contact bval-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: bval-dev@incubator.apache.org Delivered-To: mailing list bval-commits@incubator.apache.org Received: (qmail 41521 invoked by uid 99); 15 Jun 2011 22:49:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Jun 2011 22:49:49 +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; Wed, 15 Jun 2011 22:49:48 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 2766723888C2; Wed, 15 Jun 2011 22:49:28 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1136233 - /incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/PathNavigation.java Date: Wed, 15 Jun 2011 22:49:28 -0000 To: bval-commits@incubator.apache.org From: mbenson@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110615224928.2766723888C2@eris.apache.org> Author: mbenson Date: Wed Jun 15 22:49:27 2011 New Revision: 1136233 URL: http://svn.apache.org/viewvc?rev=1136233&view=rev Log: call full lifecycle for all callbacks Modified: incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/PathNavigation.java Modified: incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/PathNavigation.java URL: http://svn.apache.org/viewvc/incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/PathNavigation.java?rev=1136233&r1=1136232&r2=1136233&view=diff ============================================================================== --- incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/PathNavigation.java (original) +++ incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/PathNavigation.java Wed Jun 15 22:49:27 2011 @@ -97,7 +97,13 @@ public class PathNavigation { * @return T result */ public static T navigateAndReturn(CharSequence propertyPath, Callback callback) { - navigate(propertyPath, callback); + try { + parse(propertyPath == null ? "" : propertyPath, new PathPosition(callback)); + } catch (ValidationException ex) { + throw ex; + } catch (Exception ex) { + throw new ValidationException(String.format("invalid property: %s", propertyPath), ex); + } return callback.result(); } @@ -108,13 +114,7 @@ public class PathNavigation { * @param callback */ public static void navigate(CharSequence propertyPath, Callback callback) { - try { - parse(propertyPath == null ? "" : propertyPath, new PathPosition(callback)); - } catch (ValidationException ex) { - throw ex; - } catch (Exception ex) { - throw new ValidationException(String.format("invalid property: %s", propertyPath), ex); - } + navigateAndReturn(propertyPath, callback); } private static void parse(CharSequence path, PathPosition pos) throws Exception {