You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by oh...@apache.org on 2014/03/17 22:16:13 UTC
svn commit: r1578589 -
/commons/proper/configuration/branches/immutableNodes/src/main/java/org/apache/commons/configuration/tree/NodeTracker.java
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);