incubator-bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
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 GMT
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> T navigateAndReturn(CharSequence propertyPath, Callback<?
extends T> 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 {



Mime
View raw message