Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-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 E1A8710177 for ; Tue, 4 Feb 2014 16:40:41 +0000 (UTC) Received: (qmail 35227 invoked by uid 500); 4 Feb 2014 16:40:36 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 35148 invoked by uid 500); 4 Feb 2014 16:40:35 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 35130 invoked by uid 99); 4 Feb 2014 16:40:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Feb 2014 16:40:35 +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; Tue, 04 Feb 2014 16:40:32 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 2AAAE2388860; Tue, 4 Feb 2014 16:40:11 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1564371 - in /commons/proper/jxpath/trunk/src: java/org/apache/commons/jxpath/JXPathContext.java test/org/apache/commons/jxpath/ri/JXPathContextReferenceImplTestCase.java Date: Tue, 04 Feb 2014 16:40:11 -0000 To: commits@commons.apache.org From: ggregory@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140204164011.2AAAE2388860@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ggregory Date: Tue Feb 4 16:40:10 2014 New Revision: 1564371 URL: http://svn.apache.org/r1564371 Log: [JXPATH-166] JXPathContextReferenceImpl.addNodePointerFactory not working anymore. Add test case. revert -N C:/vcs/svn/apache/commons/trunks-proper/jxpath/src/java/org/apache/commons/jxpath/JXPathContext.java Reverted C:/vcs/svn/apache/commons/trunks-proper/jxpath/src/java/org/apache/commons/jxpath/JXPathContext.java diff --summarize --depth=infinity --ignoreAncestry -r 1523175:1523033 https://svn.apache.org/repos/asf/commons/proper/jxpath/trunk merge --depth=infinity -r1523175:1523174 https://svn.apache.org/repos/asf/commons/proper/jxpath/trunk C:/vcs/svn/apache/commons/trunks-proper/jxpath --- Reverse-merging r1523175 through r1523174 into C:/vcs/svn/apache/commons/trunks-proper/jxpath U C:/vcs/svn/apache/commons/trunks-proper/jxpath/src/java/org/apache/commons/jxpath/JXPathContext.java Merge info recorded for C:/vcs/svn/apache/commons/trunks-proper/jxpath U C:/vcs/svn/apache/commons/trunks-proper/jxpath Merge complete. ===== File Statistics: ===== Updated: 1 ==== Property Statistics: ===== Updated: 2 Added: commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/JXPathContextReferenceImplTestCase.java (with props) Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathContext.java Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathContext.java URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathContext.java?rev=1564371&r1=1564370&r2=1564371&view=diff ============================================================================== --- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathContext.java (original) +++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathContext.java Tue Feb 4 16:40:10 2014 @@ -380,17 +380,8 @@ import org.apache.commons.jxpath.util.Ke * @version $Revision$ $Date$ */ public abstract class JXPathContext { - - static { - // Initialize in this order: - // 1) contextFactory - contextFactory = JXPathContextFactory.newInstance(); - // 2) compilationContext - compilationContext = JXPathContext.newContext(null); - } - - private static final JXPathContextFactory contextFactory; - private static final JXPathContext compilationContext; + private static volatile JXPathContextFactory contextFactory; + private static volatile JXPathContext compilationContext; private static final PackageFunctions GENERIC_FUNCTIONS = new PackageFunctions("", null); @@ -444,6 +435,9 @@ public abstract class JXPathContext { * @return JXPathContextFactory */ private static JXPathContextFactory getContextFactory () { + if (contextFactory == null) { + contextFactory = JXPathContextFactory.newInstance(); + } return contextFactory; } @@ -652,6 +646,9 @@ public abstract class JXPathContext { * @return CompiledExpression */ public static CompiledExpression compile(String xpath) { + if (compilationContext == null) { + compilationContext = JXPathContext.newContext(null); + } return compilationContext.compilePath(xpath); } Added: commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/JXPathContextReferenceImplTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/JXPathContextReferenceImplTestCase.java?rev=1564371&view=auto ============================================================================== --- commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/JXPathContextReferenceImplTestCase.java (added) +++ commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/JXPathContextReferenceImplTestCase.java Tue Feb 4 16:40:10 2014 @@ -0,0 +1,15 @@ +package org.apache.commons.jxpath.ri; + +import junit.framework.TestCase; + +import org.apache.commons.jxpath.ri.model.container.ContainerPointerFactory; + +public class JXPathContextReferenceImplTestCase extends TestCase { + + /** + * https://issues.apache.org/jira/browse/JXPATH-166 + */ + public void testInit() { + JXPathContextReferenceImpl.addNodePointerFactory(new ContainerPointerFactory()); + } +} Propchange: commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/JXPathContextReferenceImplTestCase.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/JXPathContextReferenceImplTestCase.java ------------------------------------------------------------------------------ svn:keywords = Id