You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mb...@apache.org on 2007/08/27 19:05:53 UTC

svn commit: r570184 - /commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/VariablePointerFactory.java

Author: mbenson
Date: Mon Aug 27 10:05:52 2007
New Revision: 570184

URL: http://svn.apache.org/viewvc?rev=570184&view=rev
Log:
[JXPATH-101] Original context from VariableContextWrapper is not visible; from Sergey Vladimirov

Modified:
    commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/VariablePointerFactory.java

Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/VariablePointerFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/VariablePointerFactory.java?rev=570184&r1=570183&r2=570184&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/VariablePointerFactory.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/VariablePointerFactory.java Mon Aug 27 10:05:52 2007
@@ -35,11 +35,20 @@
      * Node value wrapper to trigger a VariablePointerFactory.
      */
     public static class VariableContextWrapper {
-        final JXPathContext context;
+        private final JXPathContext context;
 
         private VariableContextWrapper(JXPathContext context) {
             this.context = context;
         }
+
+        /**
+         * Get the original (unwrapped) context.
+         * 
+         * @return JXPathContext.
+         */
+        public JXPathContext getContext() {
+            return context;
+        }
     }
 
     /**
@@ -60,7 +69,7 @@
     public NodePointer createNodePointer(QName name, Object object,
             Locale locale) {
         if (object instanceof VariableContextWrapper) {
-            JXPathContext varCtx = ((VariableContextWrapper) object).context;
+            JXPathContext varCtx = ((VariableContextWrapper) object).getContext();
             while (varCtx != null) {
                 Variables vars = varCtx.getVariables();
                 if (vars.isDeclaredVariable(name.toString())) {