commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r1578589 - /commons/proper/configuration/branches/immutableNodes/src/main/java/org/apache/commons/configuration/tree/NodeTracker.java
Date Mon, 17 Mar 2014 21:16:13 GMT
Author: oheger
Date: Mon Mar 17 21:16:13 2014
New Revision: 1578589

URL: http://svn.apache.org/r1578589
Log:
Catch exceptions when reevaluate the keys of tracked nodes.

It is possible that the evaluation of a key causes an exception to be thrown,
e.g. if the expression engine has changed in the meantime. In this case, the
node becomes detached.

Modified:
    commons/proper/configuration/branches/immutableNodes/src/main/java/org/apache/commons/configuration/tree/NodeTracker.java

Modified: commons/proper/configuration/branches/immutableNodes/src/main/java/org/apache/commons/configuration/tree/NodeTracker.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/immutableNodes/src/main/java/org/apache/commons/configuration/tree/NodeTracker.java?rev=1578589&r1=1578588&r2=1578589&view=diff
==============================================================================
--- commons/proper/configuration/branches/immutableNodes/src/main/java/org/apache/commons/configuration/tree/NodeTracker.java
(original)
+++ commons/proper/configuration/branches/immutableNodes/src/main/java/org/apache/commons/configuration/tree/NodeTracker.java
Mon Mar 17 21:16:13 2014
@@ -317,7 +317,21 @@ class NodeTracker
         {
             return e.getValue();
         }
-        ImmutableNode newTarget = e.getKey().select(root, resolver, handler);
+
+        ImmutableNode newTarget;
+        try
+        {
+            newTarget = e.getKey().select(root, resolver, handler);
+        }
+        catch (Exception ex)
+        {
+            /*
+            Evaluation of the key caused an exception. This can happen for
+            instance if the expression engine was changed. In this case,
+            the node becomes detached.
+            */
+            newTarget = null;
+        }
         if (newTarget == null)
         {
             return detachedTrackedNodeData(txTarget, e);



Mime
View raw message