Return-Path: Delivered-To: apmail-jackrabbit-commits-archive@www.apache.org Received: (qmail 72417 invoked from network); 13 Oct 2008 16:44:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Oct 2008 16:44:29 -0000 Received: (qmail 10305 invoked by uid 500); 13 Oct 2008 16:44:30 -0000 Delivered-To: apmail-jackrabbit-commits-archive@jackrabbit.apache.org Received: (qmail 10219 invoked by uid 500); 13 Oct 2008 16:44:29 -0000 Mailing-List: contact commits-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list commits@jackrabbit.apache.org Received: (qmail 10210 invoked by uid 99); 13 Oct 2008 16:44:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Oct 2008 09:44:29 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.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; Mon, 13 Oct 2008 16:43:31 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 5720B238895D; Mon, 13 Oct 2008 09:43:38 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r704160 - in /jackrabbit/branches/1.5: ./ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalFrozenNodeImpl.java jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractSession.java Date: Mon, 13 Oct 2008 16:43:37 -0000 To: commits@jackrabbit.apache.org From: jukka@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081013164338.5720B238895D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jukka Date: Mon Oct 13 09:43:37 2008 New Revision: 704160 URL: http://svn.apache.org/viewvc?rev=704160&view=rev Log: 1.5: Merged revisions 704002, 704005, and 704158 (JCR-1793 and JCR-1803) Modified: jackrabbit/branches/1.5/ (props changed) jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalFrozenNodeImpl.java jackrabbit/branches/1.5/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractSession.java Propchange: jackrabbit/branches/1.5/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Oct 13 09:43:37 2008 @@ -1,2 +1,2 @@ /jackrabbit/branches/1.3:631261 -/jackrabbit/trunk:703928 +/jackrabbit/trunk:703899-704158 Modified: jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalFrozenNodeImpl.java URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalFrozenNodeImpl.java?rev=704160&r1=704159&r2=704160&view=diff ============================================================================== --- jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalFrozenNodeImpl.java (original) +++ jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalFrozenNodeImpl.java Mon Oct 13 09:43:37 2008 @@ -110,7 +110,17 @@ PropertyState prop = props[i]; if (prop.getName().equals(NameConstants.JCR_FROZENUUID)) { // special property - frozenUUID = UUID.fromString(node.getPropertyValue(NameConstants.JCR_FROZENUUID).getString()); + InternalValue value = + node.getPropertyValue(NameConstants.JCR_FROZENUUID); + // JCR-1803: The value should be a STRING, but older Jackrabbit + // versions (< 1.1, see JCR-487) used REFERENCE values. Since + // we do not automatically upgrade old content, we need to be + // ready to handle both types of values here. + if (value.getType() == PropertyType.STRING) { + frozenUUID = UUID.fromString(value.getString()); + } else { + frozenUUID = value.getUUID(); + } } else if (prop.getName().equals(NameConstants.JCR_FROZENPRIMARYTYPE)) { // special property frozenPrimaryType = node.getPropertyValue(NameConstants.JCR_FROZENPRIMARYTYPE).getQName(); Modified: jackrabbit/branches/1.5/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractSession.java URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractSession.java?rev=704160&r1=704159&r2=704160&view=diff ============================================================================== --- jackrabbit/branches/1.5/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractSession.java (original) +++ jackrabbit/branches/1.5/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractSession.java Mon Oct 13 09:43:37 2008 @@ -57,6 +57,9 @@ /** * Local namespace mappings. Prefixes as keys and namespace URIs as values. + *

+ * This map is only accessed from synchronized methods (see + * JCR-1793). */ private final Map namespaces = new HashMap(); @@ -66,7 +69,7 @@ * super.logout() when overriding this method to avoid * namespace mappings to be carried over to a new session. */ - public void logout() { + public synchronized void logout() { namespaces.clear(); } @@ -85,7 +88,7 @@ * @throws NamespaceException if the namespace is not found * @throws RepositoryException if a repository error occurs */ - public String getNamespacePrefix(String uri) + public synchronized String getNamespacePrefix(String uri) throws NamespaceException, RepositoryException { Iterator iterator = namespaces.entrySet().iterator(); while (iterator.hasNext()) { @@ -121,7 +124,7 @@ * @throws NamespaceException if the namespace is not found * @throws RepositoryException if a repository error occurs */ - public String getNamespaceURI(String prefix) + public synchronized String getNamespaceURI(String prefix) throws NamespaceException, RepositoryException { String uri = (String) namespaces.get(prefix); @@ -152,7 +155,8 @@ * @return namespace prefixes * @throws RepositoryException if a repository error occurs */ - public String[] getNamespacePrefixes() throws RepositoryException { + public synchronized String[] getNamespacePrefixes() + throws RepositoryException { NamespaceRegistry registry = getWorkspace().getNamespaceRegistry(); String[] uris = registry.getURIs(); for (int i = 0; i < uris.length; i++) { @@ -175,7 +179,7 @@ * @throws NamespaceException if the mapping is illegal * @throws RepositoryException if a repository error occurs */ - public void setNamespacePrefix(String prefix, String uri) + public synchronized void setNamespacePrefix(String prefix, String uri) throws NamespaceException, RepositoryException { if (prefix == null) { throw new IllegalArgumentException("Prefix must not be null"); @@ -450,7 +454,7 @@ * @throws SAXException if the SAX event handler failed * @throws RepositoryException if another error occurs */ - private void export(String path, Exporter exporter) + private synchronized void export(String path, Exporter exporter) throws PathNotFoundException, SAXException, RepositoryException { Item item = getItem(path); if (item.isNode()) {