jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r792142 [2/35] - in /jackrabbit/sandbox/JCR-1456: ./ jackrabbit-api/src/main/java/org/apache/jackrabbit/api/ jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/ jackrabbit-core/ jackrabbit-core/src/main/java/org/apache/jackrabb...
Date Wed, 08 Jul 2009 13:57:46 GMT

Propchange: jackrabbit/sandbox/JCR-1456/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jul  8 13:57:13 2009
@@ -1,2 +1,2 @@
 /incubator/jackrabbit/trunk:45992-387421
-/jackrabbit/trunk:387422-777489
+/jackrabbit/trunk:387422-792129

Modified: jackrabbit/sandbox/JCR-1456/README.txt
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/README.txt?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/README.txt (original)
+++ jackrabbit/sandbox/JCR-1456/README.txt Wed Jul  8 13:57:13 2009
@@ -10,28 +10,24 @@
 repositories include content management, document management,
 and records management systems.
 
-Version 1.0 of the JCR API was specified by the Java Specification
-Request 170 (JSR 170, http://jcp.org/en/jsr/detail?id=170) and work
-on the JCR version 2.0 is ongoing in JSR 283.
+Jackrabbit is currently based on the Proposed Final Draft (PFD) version
+of the JCR 2.0 API defined by the Java Specification Request 283
+(JSR 283, http://jcp.org/en/jsr/detail?id=283). Version 1.0 of the
+JCR API was specified by JSR 170.
 
 Apache Jackrabbit is a project of the Apache Software Foundation.
 
 Building Jackrabbit
 ===================
 
-Jackrabbit currently depends on the Proposed Final Draft (PFD) version of
-the JCR 2.0 API jar file from JSR 283. To build Jackrabbit, you need to
-download the PFD from http://jcp.org/en/jsr/detail?id=283 and install the
-contained jcr-2.0.jar file to your local Maven repository.
-
-Use the following command to install the required JCR API jar with metadata
-included in the jcr-2.0-pfd.xml file in this directory:
+To build Jackrabbit, you first need to download the jcr-2.0-b18.jar and
+jcr-2.0-b18.xml files from https://issues.apache.org/jira/browse/JCR-1104
+and install them to your local Maven repository:
 
     mvn install:install-file \
-        -Dfile=/path/to/lib/jcr-2.0.jar -DpomFile=jcr-2.0-pfd.xml    
+        -Dfile=jcr-2.0-b18.jar -DpomFile=jcr-2.0-b18.xml
 
-Once you've installed the JCR 2.0 (PFD) API jar, you can build Jackrabbit
-with the following command:
+Once you've installed the jar, you can build Jackrabbit like this:
 
     mvn clean install
 
@@ -93,3 +89,4 @@
 
 See http://jackrabbit.apache.org/jackrabbit-team.html for the list of 
 Jackrabbit committers and main contributors.
+

Modified: jackrabbit/sandbox/JCR-1456/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/RELEASE-NOTES.txt?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/RELEASE-NOTES.txt (original)
+++ jackrabbit/sandbox/JCR-1456/RELEASE-NOTES.txt Wed Jul  8 13:57:13 2009
@@ -1,660 +1,130 @@
-Release Notes -- Apache Jackrabbit -- Version 1.5.0
+Release Notes -- Apache Jackrabbit -- Version 2.0-alpha3
 
 Introduction
 ------------
 
-Apache Jackrabbit is a fully conforming implementation of the Content
-Repository for Java Technology API (JCR). A content repository is a
-hierarchical content store with support for structured and unstructured
-content, full text search, versioning, transactions, observation, and
-more. Typical applications that use content repositories include content
-management, document management, and records management systems.
+This is the second alpha release of Apache Jackrabbit 2.0. This release
+implements a pre-release version of the JCR 2.0 API, specified by the
+Java Specification Request 283 (JSR 283, http://jcp.org/en/jsr/detail?id=283).
+
+The purpose of this alpha release is to allow people to test and review
+the new JCR 2.0 features before they are finalized. Feedback to both the
+Jackrabbit project and the JSR 283 expert group is highly appreciated.
+Note that an alpha release is not expected to be feature-complete or
+otherwise suitable for production use.
+
+Changes in this release
+-----------------------
+
+Jackrabbit 2.0 is a major upgrade from the earlier 1.x releases. The most
+notable changes in this release are:
+
+  * Upgrade to JCR 2.0. This Jackrabbit release implements and is based
+    on a pre-release version of the JCR 2.0 API. See below for a status
+    listing of the issues related to JCR 2.0 changes. We expect to achieve
+    full feature-completeness in time for the final Jackrabbit 2.0 release.
+
+  * Upgrade to Java 5. All of Jackrabbit (except the jcr-tests component)
+    now requires Java 5 as the base platform. Java 1.4 environments are no
+    longer supported.
+
+  * Removal of deprecated classes and features. Jackrabbit 2.0 is not
+    backwards compatible with client code that used any classes or features
+    that had been deprecated during the 1.x release cycle.
+
+  * Separate JCR Commons components. Many of the general-purpose JCR
+    components like JCR-RMI and OCM are now developed and released
+    separately from the Jackrabbit content repository. See the individual
+    components for their most recent releases.
 
-Apache Jackrabbit 1.5 is an incremental feature release. While
-remaining compatible with previous releases, Jackrabbit 1.5 introduces
-a number of new features, improvements and fixes to known issues.
+For more detailed information about all the changes in this and other
+Jackrabbit releases, please see the Jackrabbit issue tracker at
 
-TODO: Notable new features
+    https://issues.apache.org/jira/browse/JCR
 
-See the Apache Jackrabbit website at http://jackrabbit.apache.org/ for
-more information.
+JCR 2.0 feature completeness
+----------------------------
+
+The following 38 top level JCR 2.0 implementation issues are being tracked in
+the Jackrabbit issue tracker. Most of them have already been partially
+implemented, but the issue will only be marked as resolved once no more
+related work is needed.
+
+Open (16 issues)
+  [JCR-1565] JSR 283 lifecycle management
+  [JCR-1588] JSR 283: Access Control
+  [JCR-1590] JSR 283: Locking
+  [JCR-1608] JSR 283: Workspace Management
+  [JCR-1712] JSR 283: JCR Names
+  [JCR-1974] JSR 283: Evaluate Capabilities
+  [JCR-2058] JSR 283: VersionManager and new versioning methods
+  [JCR-2062] JSR 283: Repository Compliance
+  [JCR-2076] JSR 283: QOM and SQL2
+  [JCR-2085] test case (TCK) maintenance for JCR 2.0
+  [JCR-2086] JSR 283: Implementation of EventIterator.getDate
+  [JCR-2092] make spi query code compatible with JCR 2.0
+  [JCR-2116] JSR 283: Built-In Node Types
+  [JCR-2117] JSR 283: adopt CND syntax changes
+  [JCR-2137] Use type StaticOperand for fullTextSearchExpression
+  [JCR-2140] JSR 283: Baselines
+
+Resolved (22 issues)
+  [JCR-1564] JSR 283 namespace handling
+  [JCR-1589] JSR 283: Retention & Hold Management
+  [JCR-1591] JSR 283: NodeType Management
+  [JCR-1592] JSR 283: Activities
+  [JCR-1593] JSR 283: Simple versioning
+  [JCR-1609] JSR 283: new Property Types
+  [JCR-1834] JSR 283: Create RepositoryFactory implementation
+  [JCR-1839] JSR 283: Introduce Event.getDate()
+  [JCR-1849] JSR 283: EventJournal
+  [JCR-1904] JSR 283: Event user data
+  [JCR-1947] JSR 283: Node Type Attribute Subtyping Rules
+  [JCR-2028] JSR 283: JCR Path
+  [JCR-2053] JSR 283: Shareable nodes support in query
+  [JCR-2056] JSR 283: Binary interfaces
+  [JCR-2059] JSR 283: Access Property/Node from Session
+  [JCR-2060] JSR 283: Access Nodes and Properties by Array of "NameGlob"
+  [JCR-2061] JSR 283: References and Dereferencing of Property Values
+  [JCR-2074] JSR 283: New Event Types
+  [JCR-2075] JSR 283: Identifier based event filtering
+  [JCR-2090] JSR 283: new methods on NodeType
+  [JCR-2091] Searchability settings in PropertyDefinition
+  [JCR-2093] Implement QueryObjectModelFactory.fullTextSearch() in ...
 
 Release Contents
 ----------------
 
-This release consists of a single source archive (jackrabbit-1.5.0-src.jar)
-that contains all the Apache Jackrabbit components. Use the following
-commands (or the equivalent in your system) to build the release with
-Maven 2 and Java 1.4 or higher:
-
-    jar xf jackrabbit-1.5.0-src.jar
-    cd jackrabbit-1.5.0-src
-    mvn install
-
-Note that the OCM components require Java 5 or higher, and are not included
-in the build when using Java 1.4.
+This release consists of a single source archive packaged as a jar file.
+The archive can be unpacked with the jar tool from your JDK installation.
+See the README.txt file for instructions on how to build this release.
 
 The source archive is accompanied by SHA1 and MD5 checksums and a PGP
 signature that you can use to verify the authenticity of your download.
 The public key used for the PGP signature can be found at
 https://svn.apache.org/repos/asf/jackrabbit/dist/KEYS.
 
-The build will result in the following components (with artifactIds in
-parenthesis) being built and installed in your local Maven repository.
-Pre-built binary artifacts of these components are also available on
-the Jackrabbit download page and on the central Maven repository.
-
-  * Jackrabbit API (jackrabbit-api)
-    Interface extensions that Apache Jackrabbit supports in
-    addition to the standard JCR API.
-
-  * Jackrabbit JCR Commons (jackrabbit-jcr-commons)
-    General-purpose classes for use with the JCR API.
-
-  * Jackrabbit JCR Tests (jackrabbit-jcr-tests)
-    Set of JCR API test cases designed for testing the compliance
-    of an implementation. Note that this is not the official JCR TCK!
-
-  * Jackrabbit Core (jackrabbit-core)
-    Core of the Apache Jackrabbit content repository implementation.
-
-  * Jackrabbit Text Extractors (jackrabbit-text-extractors)
-    Text extractor classes that allow Jackrabbit to extract text content
-    from binary properties for full text indexing.
-
-  * Jackrabbit JCR-RMI (jackrabbit-jcr-rmi)
-    RMI remoting layer for the JCR API.
-
-  * Jackrabbit WebDAV Library (jackrabbit-webdav)
-    Interfaces and common utility classes used for building a
-    WebDAV server or client.
-
-  * Jackrabbit JCR Server (jackrabbit-jcr-server)
-    WebDAV servlet implementations based on JCR.
-
-  * Jackrabbit JCR Servlets (jackrabbit-jcr-servlet)
-    Set of servlets and other classes designed to make it easier to use
-    Jackrabbit and other JCR content repositories in web applications.
-
-  * Jackrabbit Repository Classloader (jackrabbit-classloader)
-    Java classloader for loading classes from JCR content repositories.
-
-  * Jackrabbit Web Application (jackrabbit-webapp)
-    Deployable Jackrabbit installation with WebDAV support for JCR.
-
-  * Jackrabbit JCA Resource Adapter (jackrabbit-jca)
-    J2EE Connector Architecture (JCA) resource adapter for Jackrabbit.
-
-  * Jackrabbit SPI (jackrabbit-spi)
-    The SPI defines a layer within a JSR-170 implementation that separates
-    the transient space from the persistent layer.
-
-  * Jackrabbit SPI Commons (jackrabbit-spi-commons)
-    This component contains generic utility classes that might be used
-    to build an SPI implementation.
-
-  * Jackrabbit SPI2JCR (jackrabbit-spi2jcr)
-    This component contains a SPI implementation wrapping around an
-    implementation of JSR-170.
-
-  * Jackrabbit JCR2SPI (jackrabbit-jcr2spi)
-    This component contains an implementation of the JSR-170 API and
-    covers the functionality that is not delegated to the SPI
-    implementation.
-
-  * Jackrabbit OCM (jackrabbit-ocm)
-    Object-Content mapping tool for persisting and accessing Java objects
-    in a JCR content repository.
+About Apache Jackrabbit
+-----------------------
 
-  * Jackrabbit OCM Node Management (jackrabbit-ocm-nodemanagement)
-    This component simplifies registration of node types and namespaces
-    referenced in OCM mapping descriptors.
-
-Upgrading to Jackrabbit 1.5
----------------------------
-
-TODO
-
-Upgrading to Jackrabbit 1.4
----------------------------
-
-Apache Jackrabbit 1.4 is fully compatible with the previous 1.x releases.
-A previous Apache Jackrabbit 1.x installation can be upgraded by replacing
-the relevant jar files with the new versions and adding some new dependencies.
-No changes to repository contents are needed.
-
-Jackrabbit 1.4 introduces the SPI layer described above, and in addition to
-it's earlier dependencies the jackrabbit-core component now also needs the
-jackrabbit-spi and jackrabbit-spi-commons components in the classpath.
-
-A number of classes in jackrabbit-jcr-commons have been deprecated, and you
-should check for the suggested replacements if you use those classes in your
-applications.
-
-The Lucene dependency was upgraded to 2.2.0, and so you need to upgrade
-also the lucene-core jar file in your classpath when upgrading
-jackrabbit-core. No index file changes are needed.
-
-Repository configuration has been extended with a number of options for
-storage, locking and indexing strategies. However, no changes to existing
-configuration files are needed unless you want to enable these new features.
-
-Upgrading to Jackrabbit 1.3
----------------------------
-
-Apache Jackrabbit 1.3 is fully compatible with the previous 1.x releases.
-A previous Apache Jackrabbit 1.x installation can be upgraded by replacing
-the relevant jar files with the new versions. No changes to repository
-contents are needed.
-
-See below for a more detailed description of the structural changes in
-the Apache Jackrabbit 1.2 release.
-
-Upgrading to Jackrabbit 1.2
----------------------------
-
-The most notable effect of the component restructuring in the 1.2 release
-was that the previous jackrabbit-core component has been split in three
-pieces: jackrabbit-api, jackrabbit-jcr-commons, and jackrabbit-core. Thus
-you need to replace the previous jackrabbit-core-1.x.jar file with the
-three new jar archives.
-
-The structure of the WebDAV components have also changed. WebDAV support
-now consists of the webapp component jackrabbit-webapp and the libraries
-jackrabbit-webdav and jackrabbit-jcr-server.
-
-The Apache Lucene dependency used for full text indexing has been upgraded
-to version 2.0 in this release. Lucene 2.0 is able to continue using
-existing index files, but you can also manually recreate the index with
-Lucene 2.0 extensions by removing the "index" directories of a closed
-repository. Jackrabbit will automatically re-index content when the
-repository is next started.
-
-Also the Apache Derby dependency has been upgraded to version 10.2.
-Like Lucene, the new Derby version can keep using existing database files.
-New repositories and workspaces will however be created using extensions
-and improvements introduced in the 10.2 version.
-
-Changes and known issues in this release
-----------------------------------------
-
-All the changes (new features, improvements, bug fixes) and known issues
-in this release are listed below. The listing is organized by Jackrabbit
-component and by issue type. The issue identifier and title is listed for
-each change and known issue.
+Apache Jackrabbit is a fully conforming implementation of the Content
+Repository for Java Technology API (JCR). A content repository is a
+hierarchical content store with support for structured and unstructured
+content, full text search, versioning, transactions, observation, and
+more. Typical applications that use content repositories include content
+management, document management, and records management systems.
 
-You can look up individual issues for more details in the Jackrabbit
-issue tracker at
+For more information, visit http://jackrabbit.apache.org/
 
-    https://issues.apache.org/jira/browse/JCR
+About The Apache Software Foundation
+------------------------------------
 
-Note that some issues may appear more than once in the list below, as
-they may affect more than one component. Generic issues that affect all
-or most components are listed first under the label "jackrabbit".
-
-jackrabbit (since 1.4)
-
-  Improvements
-  [JCR-871]  Provide Readme's for subprojects jcr-mapping and ...
-  [JCR-1619] Update copyright years in READMEs and NOTICEs
-  [JCR-1649] Separate NOTICEs and LICENSEs for binary and source packages
-  [JCR-1751] Update slf4j
-  [JCR-1756] Include OCM in the main Jackrabbit build when using Java 5
-
-jackrabbit-api (since 1.4)
-
-  Improvements
-  [JCR-1342] Create OSGi Bundle Manifest Headers
-  [JCR-1672] Adding Event interface and isLocal()
-
-jackrabbit-classloader (since 1.4.1)
-
-  No changes
-
-jackrabbit-core  (since 1.4.6)
-
-  New features
-  [JCR-954]  Allow to disable referential integrity checking for workspace
-  [JCR-1171] Contribute Pluggable Permission and User Management to Jackrabbit
-  [JCR-1462] repository.xml: throw an exception on error
-  [JCR-1607] Add a NamespaceHelper in jcr-commons
-  [JCR-1717] Configure occurrence of property value in excerpt
-
-  Improvements
-  [JCR-1005] More Fine grained Permission Flags
-  [JCR-1087] Maintain the cluster revision table
-  [JCR-1237] Change default value for respectDocumentOrder
-  [JCR-1290] tm-extractors.jar blocks usage of newer poi versions
-  [JCR-1308] Unnecessary null check in EffectiveNodeType....
-  [JCR-1309] Refactor DBMS support for JNDI datasources
-  [JCR-1313] Additional excerpt provider implementation
-  [JCR-1337] Optimize first execution queries for DescendantSelfAxisWeight/...
-  [JCR-1347] Move Jackrabbit Query Parser from core to spi-commons
-  [JCR-1363] Migrate to Lucene 2.3
-  [JCR-1365] Query path constraints like foo//*/bar do not scale
-  [JCR-1369] indexing-rules should allow wildcards for (global) property names
-  [JCR-1371] [PATCH] unnecessary synchronized collections used only in ...
-  [JCR-1377] Reduce memory usage of DocNumberCache
-  [JCR-1378] Remove SessionImpl dependency from QueryObjectModelFactoryImpl
-  [JCR-1388] Jackrabbit does not allow concurrent reads to the data store ...
-  [JCR-1394] FileDataStore Garbage Collector and empty directories
-  [JCR-1395] Use Commons IO 1.4
-  [JCR-1397] Allow query results with unknown size
-  [JCR-1407] [PATCH] Trivial Javadoc fix for RepositoryConfig
-  [JCR-1413] [PATCH] retain exception stack traces
-  [JCR-1420] Add test for Node.restore() may throw InvalidStateException
-  [JCR-1424] [PATCH] simplify conversion of strings to primitives by using ...
-  [JCR-1425] [PATCH] reduce duplicate conversions from OffsetCharSequence ...
-  [JCR-1430] mvn eclipse:eclipse inconsistent
-  [JCR-1445] [PATCH] Use entrySet iterators to avoid map look ups in loops
-  [JCR-1465] Configurable Similarity
-  [JCR-1471] Error when registering nodetype with same propdef as supertype
-  [JCR-1479] [PATCH] don't use the reflective form of {Collection}.toArray
-  [JCR-1485] Introduce daily integration test suite
-  [JCR-1488] Node deleted while query is executed should not affect result ...
-  [JCR-1510] [PATCH] more verbose exception messages (BatchedItemOperations)
-  [JCR-1520] DatabaseFileSystem's logger references the wrong class
-  [JCR-1531] [PATCH] Add Column and line numbers to repository.xml parse ...
-  [JCR-1538] [patch] add toString for NodeImpl and PropertyImpl
-  [JCR-1570] [PATCH] better exception messages when generating schema
-  [JCR-1575] [PATCH] cleanup unwanted stream closing that isn't used
-  [JCR-1579] Improved XML export handling
-  [JCR-1600] Remove noLockHack in SharedItemStateManager
-  [JCR-1603] Remove getSafeJCRPath methods in HierarchyManagerImpl
-  [JCR-1672] Adding Event interface and isLocal()
-  [JCR-1674] Provide means for exception handling for QueryNodeVisitor ...
-  [JCR-1686] Catch Throwables while calling TextExtractors
-  [JCR-1696] Add PlainTextExtractor to default configuration of ...
-  [JCR-1699] Do not log warning when coercing value in query is not possible
-  [JCR-1700] Deprecate NamespaceListener and AbstractNamespaceResolver
-  [JCR-1705] Reduce memory usage of transient nodes
-  [JCR-1709] Remove Serializable on ItemState classes
-  [JCR-1710] Promote ChildNodeEntry and ChildNodeEntries to top level classes.
-  [JCR-1715] Prevent excessive Path.Element instances
-  [JCR-1716] Prefer PathFactory.createElement() over createPath()....
-  [JCR-1739] Do not use deletable anymore
-  [JCR-1742] CacheManager resizeAll is slow
-  [JCR-1745] Mark pending nodes in IndexingQueue directly in index
-  [JCR-1775] Transaction-safe versioning
-  [JCR-1789] Provide access to cluster records
-
-  Bug fixes
-  [JCR-1466] ConfigurationException constructors are package private
-  [JCR-1563] Data Store: UTFDataFormatException when using large ...
-  [JCR-1572] DbDataStore connection does not always reconnect
-  [JCR-1580] Typo in PropertyDefinitionTemplate
-  [JCR-1581] ClassCastException when registering new node type
-  [JCR-1582] Parameters 'idleTime' and 'queryClass' cause QueryHandler to fail
-  [JCR-1601] Occasional NullPointerException in ItemManager
-  [JCR-1611] Registering NodeType from templates throws exception about ...
-  [JCR-1622] Session.getUserID returns first principal in the set obtained ...
-  [JCR-1640] Not configuring the adminId, anonymousId, or defaultuserId ...
-  [JCR-1641] DefaultLoginModule/SimpleLoginModule don't support custom ...
-  [JCR-1647] UserManager throws javax.jcr.query.InvalidQueryException on ...
-  [JCR-1694] System properties does not get replaced in a Cluster ...
-  [JCR-1703] Oracle JNDI DataSource support
-  [JCR-1714] QueryImpl result offSet must be considered after security ...
-  [JCR-1734] Generated cluster node id should be persisted
-  [JCR-1738] BeanConfig may incorrectly throw ConfigurationException
-  [JCR-1764] Occasional IndexingQueueTest failures
-
-  Known issues
-  [JCR-43]   Restore on nodes creates same-name-sibling of ...
-  [JCR-320]  BinaryValue equals fails for two objects with ...
-  [JCR-392]  Querying element by number does not work
-  [JCR-435]  Node.update() does not work correct for SNS
-  [JCR-449]  inconsistency in internal version items during commits
-  [JCR-517]  Reserved status of namespace jcr not enforced
-  [JCR-522]  XPath parser too tolerant
-  [JCR-537]  Failure to remove a versionable node
-  [JCR-538]  failing Node.checkin() or Node.checkout() might leave ...
-  [JCR-566]  Versioning bug with restore and transactions
-  [JCR-575]  unicode escapes in files generated by JJTree
-  [JCR-591]  XPath position function does not work
-  [JCR-639]  Allow modification of OPV=IGNORE items even if parent ...
-  [JCR-643]  Own AccessManager + VersionManager : AccessDenied problem
-  [JCR-690]  Nodes' and properties' names with invalid XML ...
-  [JCR-709]  ArrayStoreException is thrown when jcr:deref() is used ...
-  [JCR-777]  Order by clause using child axis does not throw ...
-  [JCR-843]  XPath does not work with sub-axes
-  [JCR-888]  javax.jcr.NamespaceException: : is not a registered namespace uri
-  [JCR-908]  Unable to properly restore a previous version of a node that ...
-  [JCR-932]  Lossy SQL parsing
-  [JCR-935]  ConcurrentModificationException during logout (cont'd)
-  [JCR-936]  Using Oracle bundle PM throws SQL exception (cannot insert NULL)
-  [JCR-983]  fn:upper accepted in too many places
-  [JCR-1002] QueryManager does not throw exception if property name ...
-  [JCR-1117] Bundle cache is not rolled back when the storage of a ...
-  [JCR-1135] boolean value constraints exposed in custom format
-  [JCR-1173] Session scoped lock has no effect on other cluster nodes
-  [JCR-1187] Asking a property twice for it's stream returns the same ...
-  [JCR-1211] QueryManager does not throw exception if jcr:deref is used in ...
-  [JCR-1223] Occasional NPE on node checkin
-  [JCR-1248] ParseException if search string ends with '!'
-  [JCR-1334] Deadlock with XA enabled
-  [JCR-1360] Parsing built-in CND and XML nodetypes does not result in ...
-  [JCR-1367] Exception when closing connection under db2
-  [JCR-1387] Lock token not removed from session when node is removed
-  [JCR-1440] NPE Thrown when two Cluster Nodes are hitting the same ...
-  [JCR-1532] ERROR 40XD0: Container has been closed exception with Derby DB
-  [JCR-1549] XATest#testXAVersionsThoroughly fails if 2 checks are ...
-  [JCR-1553] ClusterNode not properly shutdown when repository has shutdown
-  [JCR-1558] Namespace not registered yet prevent ...
-  [JCR-1573] Lucene Query Exception: 'attempt to access a deleted ...
-  [JCR-1605] RepositoryLock does not work on NFS sometimes
-  [JCR-1613] REMOVE access is not checked when moving a node
-  [JCR-1626] The resource committed at the first server via WebDAV does ...
-  [JCR-1633] When node is created and locked in same transaction, ...
-  [JCR-1634] In XA transaction session.addLockToken() does not have effect
-  [JCR-1637] The GarbageCollector ignores InterruptedException and so ...
-  [JCR-1648] Database reconnect during shutdown
-  [JCR-1660] Consistency check / fix skips system nodes
-  [JCR-1666] After transaction rollback session may become 'corrupt'
-  [JCR-1668] After RepositoryImpl instance has been created and shut ...
-  [JCR-1670] NPE when clustered JR queries version history on a node that ...
-  [JCR-1693] JNDIDatabaseJournal doesn't work with "oracle" schema ...
-  [JCR-1707] Node.setProperty(String, String, PropertyType.UNDEFINED) ...
-  [JCR-1729] Node#addNode failes with AccessDeniedException if session ...
-  [JCR-1773] shareable nodes: wrong path returned, causes remove() to ...
-  [JCR-1778] BindableRepositoryFactory doesn't handle repository shutdown
-  [JCR-1779] recursion problem in indexing configuration
-
-jackrabbit-jca (since 1.4)
-
-  Improvements
-  [JCR-1631] Replace commons-logging dependency with SLF4J
-
-  Bug fixes
-  [JCR-1630] Missing third party notices and license info
-  [JCR-1667] JCARepositoryManager does not close InputStream used to ...
-  [JCR-1682] Session returned does not offers transaction support
-
-  Known issues
-  [JCR-607]  Importing XML at root level using a session from JCA ...
-  [JCR-609]  Empty custom_nodetypes.xml after restart
-  [JCR-769]  Unable to login with two different Credentials to the same ...
-  [JCR-861]  Connector should support LocalTransaction as well as XATransaction
-  [JCR-1035] Jackrabbit JCA - The client can bypass the managed connection ...
-  [JCR-1077] Changelog not persisted during two phase commit in prepare phase
-  [JCR-1334] Deadlock with XA enabled
-  [JCR-1496] Problem to invoke createDataStoreGarbageCollector() in ...
-  [JCR-1597] JCARepositoryHandle.login(...) methods never throw ...
-  [JCR-1665] In JCAConnectionRequestInfo, equals() and hashCode() ...
-  [JCR-1692] jackrabbit exceptions on jboss shutdown
-
-jackrabbit-jcr-commons (since 1.4.2)
-
-  New features
-  [JCR-1350] Add a serializing content handler
-  [JCR-1607] Add a NamespaceHelper in jcr-commons
-  [JCR-1697] Simple Google style query
-
-  Improvements
-  [JCR-1342] Create OSGi Bundle Manifest Headers
-  [JCR-1416] [PATCH] No need to call toString on a String
-  [JCR-1486] Introduce Timer idle time
-  [JCR-1579] Improved XML export handling
-  [JCR-1617] Remove commons-collections and slf4j-api dependencies from jcr-commons
-  [JCR-1636] Make shutdown hooks in TransientFileFactory removable
-  [JCR-1698] Remove unnecessary TestAll classes in jcr-commons
-
-  Bug fixes
-  [JCR-1331] Improper deprecation of Locked class
-  [JCR-1355] XML import should not access external entities
-  [JCR-1396] DateValue.getDate not a copy
-  [JCR-1495] NamespaceAdder.addNamespace throws ClassCastException
-  [JCR-1669] Text.isDescendant returns false if parent is '/'
-  [JCR-1706] Fix unexpected behavior of Text.getName()
-
-  Known issues
-  [JCR-1668] After RepositoryImpl instance has been created and shut ...
-
-jackrabbit-jcr-rmi (since 1.4.1)
-
-  Improvements
-  [JCR-1317] Add a MBean method to programatically create a new Workspace.
-  [JCR-1342] Create OSGi Bundle Manifest Headers
-  [JCR-1343] Replace xerces for serialization by JAXP
-
-  Bug fixes
-  [JCR-1333] jackrabbit-jcr-rmi: Supplied javax.transaction.xa.Xid is ..
-  [JCR-1406] Add the org.apache.jackrabbit.rmi.jackrabbit package to the ...
-  [JCR-1454] NullPointerException may be thrown when trying to enumerate ...
-
-  Known issues
-  [JCR-1643] ClientObservationManager causes null pointer
-
-jackrabbit-jcr-server (since 1.4.1)
-
-  New features
-  [JCR-1607] Add a NamespaceHelper in jcr-commons
-
-  Improvements
-  [JCR-1391] [PATCH] remove minor unneeded code stutter
-
-  Bug fixes
-  [JCR-1364] DirListingExportHandler: Should not implement PropertyHandler
-  [JCR-1504] MS Excel Mime Type missing in MsExcelTextExtractor
-  [JCR-1790] terminology: source uses "protected property" for something ...
-
-  Known issues
-  [JCR-1348] simple-webdav: Dav:auto-version property not handled properly
-  [JCR-1352] illegal format for WebDAV lock tokens
-  [JCR-1616] Spi2Dav / 283 Conflict: Creation of PropertyInfoImpl fails ...
-  [JCR-1768] DeltaV: missing support for DAV:supported-method-set and ...
-  [JCR-1787] XmlHandler export functions don't work in XML repository mode ...
-
-jackrabbit-jcr-servlet (since 1.4)
-
-  No changes
-
-jackrabbit-jcr-tests (since 1.4)
-
-  Bug fixes
-  [JCR-1361] Lock test assumes that changes in one session are immediately ...
-  [JCR-1468] LockTest.testLogout fails to refresh session before checking ...
-  [JCR-1497] Incorrect decodedAttributeValue in AbstractImportXmlTest
-  [JCR-1535] Some tests assume that an implementation of javax.jcr.Item ...
-  [JCR-1689] Multiple tests test for locking instead of versioning
-
-  Known issues
-  [JCR-509]  TCK:NodeTest#testNodeIdentity fails if versioning ...
-  [JCR-714]  TCK: Test root path not escaped when used in XPath queries
-  [JCR-752]  Test cases leak sessions
-  [JCR-759]  handling of namespace registrations in AbstractJCRTest
-  [JCR-1094] TCK assumes that repository does not automatically add mixins ...
-  [JCR-1102] bad test assumptions in SQLJoinTest
-  [JCR-1129] bad test assumptions in versioning tests
-  [JCR-1130] bad test assumptions in TextNodeTest with respect to ...
-  [JCR-1161] Export test cases fail with Java 5 on Mac OS X
-  [JCR-1164] Bad test assumptions in observation tests
-  [JCR-1307] TCK: Attribute values may be normalized in document view exports
-  [JCR-1335] bad assumptions on QueryResult.getIterator() semantics in ...
-  [JCR-1411] test session leaks
-  [JCR-1463] TCK: testRestore assumes too much about OPV=VERSION
-
-jackrabbit-jcr2spi (since 1.4)
-
-  New features
-  [JCR-1350] Add a serializing content handler
-
-  Improvements
-  [JCR-1011] JCR2SPI: add configurable cache for Item instances (ItemManager)
-  [JCR-1327] SPI POM improvements
-  [JCR-1417] [PATCH] remove code stutter
-  [JCR-1577] Remove RepositoryService.getRootId()
-  [JCR-1579] Improved XML export handling
-  [JCR-1585] Remove calls to System.out in tests
-  [JCR-1683] JCR2SPI: Move test execution to SPI2JCR
-  [JCR-1700] Deprecate NamespaceListener and AbstractNamespaceResolver
-  [JCR-1720] Jcr2Spi: configuration entry for size of ItemCache
-  [JCR-1771] jcr2spi: avoid unnecessary roundtrips with NodeEntry....
-
-  Bug fixes
-  [JCR-1490] [PATCH] UpdateTest has two typos
-  [JCR-1578] Jcr2Spi: UpdateTest#testUpdateRemovesExtraProperty and ...
-  [JCR-1638] Redundant calls to RepositoryService.getChildInfos
-  [JCR-1658] Executing query throws ...
-
-  Known issues
-  [JCR-1293] ReorderReferenceableSNSTest failure
-  [JCR-1508] Setting a new property value causes read of previous value
-  [JCR-1799] JCR2SPI: updating events swallowed (CacheBehaviour.OBSERVATION)
-  [JCR-1800] JCR2SPI: lockmgr isn't aware about external locks ...
-
-jackrabbit-spi (since 1.4)
-
-  New features
-  [JCR-1405] SPI: Introduce NodeInfo.getChildInfos()
-  [JCR-1629] SPI: Testsuite for the SPI Interfaces
-
-  Improvements
-  [JCR-1327] SPI POM improvements
-  [JCR-1368] improve documentation of SPI Batch addProperty
-  [JCR-1403] SPI: Describe equality requirements of ItemIds
-  [JCR-1543] Improve reliability of canAddMixin
-  [JCR-1550] Remove ItemInfo.getName() since it is redundant
-  [JCR-1576] Remove RepositoryService exists()
-  [JCR-1577] Remove RepositoryService.getRootId()
-
-  Bug fixes
-  [JCR-1158] jcr2spi spi2dav getProperties returns only cached properties
-  [JCR-1434] SPI: Description of Path.isDescendantOf(Path)
-  [JCR-1514] SPI: Javadoc Issue with QNodeTypeDefinition#getPropertyDefs ...
-
-jackrabbit-spi-commons (since 1.4)
-
-  New features
-  [JCR-1662] Add pattern matching for paths
-
-  Improvements
-  [JCR-1327] SPI POM improvements
-  [JCR-1344] Unsynchronized NameFactoryImpl initialization
-  [JCR-1347] Move Jackrabbit Query Parser from core to spi-commons
-  [JCR-1430] mvn eclipse:eclipse inconsistent
-  [JCR-1494] [PATCH] XPathQueryBuilder reports misleading column numbers ...
-  [JCR-1654] Incorrect slf4j-log4j12 dependency scope in spi-commons
-  [JCR-1663] REFERENCE properties produce duplicate strings in memory
-  [JCR-1674] Provide means for exception handling for QueryNodeVisitor ...
-  [JCR-1675] Provide names for constants in QueryConstants
-  [JCR-1700] Deprecate NamespaceListener and AbstractNamespaceResolver
-  [JCR-1715] Prevent excessive Path.Element instances
-
-  Bug fixes
-  [JCR-1280] Path.equals does not work for other Path implementations
-  [JCR-1409] PathFactoryImpl creates illegal Path objects
-  [JCR-1495] NamespaceAdder.addNamespace throws ClassCastException
-  [JCR-1653] NodeIdImpl is not really serializable
-  [JCR-1688] Query parser builds invalid parse tree
-  [JCR-1750] Creating QValue from stream: stream not closed
-
-jackrabbit-spi2jcr (since 1.4)
-
-  Improvements
-  [JCR-1327] SPI POM improvements
-  [JCR-1683] JCR2SPI: Move test execution to SPI2JCR
-  [JCR-1700] Deprecate NamespaceListener and AbstractNamespaceResolver
-
-jackrabbit-text-extractors (since 1.4)
-
-  New features
-  [JCR-1523] [PATCH] png, apng, mng text extractor
-  [JCR-1561] New MsOutlook Message Extractor
-
-  Improvements
-  [JCR-1533] Update POI dependency to 3.0.2-FINAL
-  [JCR-1534] Use POIExtractor wherever possible
-  [JCR-1567] Upgrade to PDFBox 0.7.3
-  [JCR-1655] Upgrade nekohtml dependency
-  [JCR-1661] Extend mimetype list of text extractors
-  [JCR-1691] Includes new (old) mimetypes that OpenOfficeTextExtractor can handle
-
-  Bug fixes
-  [JCR-1504] MS Excel Mime Type missing in MsExcelTextExtractor
-  [JCR-1530] MsPowerPointTextExtractor does not extract from PPTs with € sign
-  [JCR-1646] NPE in OpenOfficeTextExtractor
-  [JCR-1727] HTMLTextExtractor modifying UTF-8 encoded String
-
-jackrabbit-webapp (since 1.4)
-
-  Improvements
-  [JCR-1631] Replace commons-logging dependency with SLF4J
-
-  Bug fixes
-  [JCR-1364] DirListingExportHandler: Should not implement PropertyHandler
-  [JCR-1545] webapp: troubleshooting.jsp fails
-  [JCR-1596] search.jsp doesn't handle utf-8 parameters correctly
-  [JCR-1598] Problematic exception handling in Jackrabbit WebApp
-  [JCR-1630] Missing third party notices and license info
-  [JCR-1737] JSP page compilation errors when depoyed using oc4j
-
-  Known issues
-  [JCR-1301] Trouble undeploying jackrabbit-webapp from Tomcat
-  [JCR-1457] Restart of RMI-component fails (because it's not released ...
-  [JCR-1763] Possible NPE in installer
-
-jackrabbit-webdav (since 1.4)
-
-  New features
-  [JCR-1733] WebDAV BIND support
-
-  Improvements
-  [JCR-1310] Webdav: Drop xerces dependency
-  [JCR-1615] WebDAV: drop dependency on commons-collections
-  [JCR-1769] RFC4918 feature: PROPFIND/include
-
-  Bug fixes
-  [JCR-1439] MOVE method returns error 412 Precondition Failed
-  [JCR-1571] DavMethodBase#getResponseException fails if the body is not ...
-  [JCR-1623] Typo in the DeltaVConstants class in constant ...
-  [JCR-1782] Destination header not containing URI scheme causes NPE
-  [JCR-1790] terminology: source uses "protected property" for something ...
-
-  Known issues
-  [JCR-406]  If header evaluation compliance problems
-  [JCR-1744] PROPFIND response to a request for a property taht does not ...
-  [JCR-1767] WebDAV XML serialization in JDK 1.4 broken
-  [JCR-1785] If header checking lacks etag checks
-  [JCR-1796] DAV compliance class for observation should use a URI instead ...
-
-jackrabbit-ocm (since 1.4)
-
-  New features
-  [JCR-1467] Hide ugly repository init code for OCM
-  [JCR-1645] Add support for Map of referenced beans
-  [JCR-1721] make collection element names configurable
-  [JCR-1761] OCM:Add the ability to specify name of a Collection Element ...
-
-  Improvements
-  [JCR-876]  ManageableCollectionUtil should not throw "unsupported" ...
-  [JCR-966]  [OCM] Add unit tests with BundleDbPersistenceManager
-  [JCR-1316] ID Field Descriptor is not inherited as is the case with UUID ...
-  [JCR-1404] javadoc writing and generation with mvn
-  [JCR-1505] Improve handling of inherited mixins
-  [JCR-1624] Proxies improvement
-  [JCR-1740] Make ObjectIterator implement RangeIterator interface
-  [JCR-1752] Allow users to disable validation
-  [JCR-1754] The jackrabbit-ocm DTD 1.5 is missing and has to be publish
-  [JCR-1758] Improvement to UndefinedTypeConverterImpl to map super types ...
-  [JCR-1759] Simplify the usage of OCM annotations
-  [JCR-1762] Improvement to MultiValueCollectionConverterImpl to Map ...
-
-  Bug fixes
-  [JCR-1286] FilterImpl.getStringValue() does not use custom converter ...
-  [JCR-1303] Missing derby dependency
-  [JCR-1325] Problems mapping custom collections
-  [JCR-1336] Bug in duplicate mapping check
-  [JCR-1339] ManageableCollectionUtil doesn't support Maps
-  [JCR-1381] Path is not indexed when inserting a new node with SNS
-  [JCR-1385] UUID field not populated when saving a new node
-  [JCR-1398] [PATCH] ClassDescriptor.hasIdField uses faulty logic
-  [JCR-1448] nt:versionedChild problem
-  [JCR-1524] [PATCH] tests use 12 for month which is invalid
-  [JCR-1537] ClassDescriptor.hasIdField() fails if id is declared in upper ...
-  [JCR-1548] Several bugs in last SVN commit
-  [JCR-1757] OCM: translate-project goal not found
-  [JCR-1776] Some unit tests are not well configured
+Established in 1999, The Apache Software Foundation provides organizational,
+legal, and financial support for more than 100 freely-available,
+collaboratively-developed Open Source projects. The pragmatic Apache License
+enables individual and commercial users to easily deploy Apache software;
+the Foundation's intellectual property framework limits the legal exposure
+of its 2,500+ contributors.
 
-jackrabbit-ocm-nodemanagement (since 1.4)
+For more information, visit http://www.apache.org/
 
-  No changes

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/JackrabbitSession.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/JackrabbitSession.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/JackrabbitSession.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/JackrabbitSession.java Wed Jul  8 13:57:13 2009
@@ -32,12 +32,12 @@
     /**
      * Returns the <code>PrincipalManager</code> for the current <code>Session</code>.
      *
-     * @return this sessions principal manager.
-     *
-     * @throws AccessDeniedException
+     * @return the <code>PrincipalManager</code> associated with this <code>Session</code>.
+     * @throws AccessDeniedException If the session lacks privileges to access
+     * the principal manager or principals in general.
      * @throws UnsupportedRepositoryOperationException If principal management
      * is not supported.
-     * @throws RepositoryException
+     * @throws RepositoryException If another error occors.
      * @see PrincipalManager
      */
     PrincipalManager getPrincipalManager() throws AccessDeniedException, UnsupportedRepositoryOperationException, RepositoryException;
@@ -45,6 +45,7 @@
     /**
      * Returns the <code>UserManager</code> for the current <code>Session</code>.
      *
+     * @return the <code>UserManager</code> associated with this <code>Session</code>.
      * @throws javax.jcr.AccessDeniedException If this session is not allowed to
      * to access user data.
      * @throws UnsupportedRepositoryOperationException If user management is

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/pom.xml?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/pom.xml (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/pom.xml Wed Jul  8 13:57:13 2009
@@ -49,6 +49,9 @@
                 <copy todir="${project.build.directory}/repository">
                   <fileset dir="${basedir}/src/test/repository"/>
                 </copy>
+                <copy todir="${project.build.directory}/repository-2">
+                  <fileset dir="${basedir}/src/test/repository"/>
+                </copy>
               </tasks>
             </configuration>
             <goals>
@@ -88,9 +91,9 @@
               <name>known.issues</name>
               <value>
                 org.apache.jackrabbit.core.xml.DocumentViewTest#testMultiValue
-                org.apache.jackrabbit.test.api.ShareableNodeTest#testSharedNodePath
-                org.apache.jackrabbit.test.api.version.VersionHistoryTest#testInitialNumberOfLinearVersions
-                org.apache.jackrabbit.test.api.version.VersionHistoryTest#testInitiallyGetAllLinearVersionsContainsTheRootAndTheBaseVersion
+                org.apache.jackrabbit.test.api.NodeReadMethodsTest#testGetPropertiesNamePatternArray
+                org.apache.jackrabbit.test.api.version.ActivitiesTest#testActivitiesPath
+                org.apache.jackrabbit.test.api.nodetype.NodeTypeCreationTest#testPropertyDefinitionTemplate
               </value>
             </property>
           </systemProperties>
@@ -117,14 +120,16 @@
         </configuration>
       </plugin>
       <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>rat-maven-plugin</artifactId>
+        <groupId>org.apache.rat</groupId>
+        <artifactId>apache-rat-plugin</artifactId>
         <configuration>
           <excludes>
             <exclude>src/main/javadoc/**/*.uxf</exclude>
             <exclude>src/test/repository/**</exclude>
             <exclude>src/test/resources/**/*.txt</exclude>
             <exclude>src/test/resources/**/*.cnd</exclude>
+            <exclude>repository/**</exclude>
+            <exclude>*.log</exclude>
           </excludes>
         </configuration>
       </plugin>

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java Wed Jul  8 13:57:13 2009
@@ -434,11 +434,12 @@
 
         // adjust references that refer to uuid's which have been mapped to
         // newly generated uuid's on copy/clone
-        Iterator iter = refTracker.getProcessedReferences();
+        Iterator<Object> iter = refTracker.getProcessedReferences();
         while (iter.hasNext()) {
             PropertyState prop = (PropertyState) iter.next();
             // being paranoid...
-            if (prop.getType() != PropertyType.REFERENCE) {
+            if (prop.getType() != PropertyType.REFERENCE
+                    && prop.getType() != PropertyType.WEAKREFERENCE) {
                 continue;
             }
             boolean modified = false;
@@ -546,8 +547,8 @@
         // 2. check if target state can be removed from old/added to new parent
 
         checkRemoveNode(target, srcParent.getNodeId(),
-                CHECK_ACCESS | CHECK_LOCK | CHECK_VERSIONING | CHECK_CONSTRAINTS |
-                        CHECK_HOLD | CHECK_RETENTION);
+                CHECK_ACCESS | CHECK_LOCK | CHECK_VERSIONING | CHECK_CONSTRAINTS
+                | CHECK_HOLD | CHECK_RETENTION);
         checkAddNode(destParent, destName.getName(),
                 target.getNodeTypeName(), CHECK_ACCESS | CHECK_LOCK
                 | CHECK_VERSIONING | CHECK_CONSTRAINTS | CHECK_HOLD | CHECK_RETENTION);
@@ -1121,7 +1122,7 @@
         }
         NodeState node = stateMgr.createNew(id, nodeTypeName, parent.getNodeId());
         if (mixinNames != null && mixinNames.length > 0) {
-            node.setMixinTypeNames(new HashSet(Arrays.asList(mixinNames)));
+            node.setMixinTypeNames(new HashSet<Name>(Arrays.asList(mixinNames)));
         }
         node.setDefinitionId(def.getId());
 
@@ -1143,16 +1144,12 @@
         }
 
         // add 'auto-create' properties defined in node type
-        PropDef[] pda = ent.getAutoCreatePropDefs();
-        for (int i = 0; i < pda.length; i++) {
-            PropDef pd = pda[i];
+        for (PropDef pd : ent.getAutoCreatePropDefs()) {
             createPropertyState(node, pd.getName(), pd.getRequiredType(), pd);
         }
 
         // recursively add 'auto-create' child nodes defined in node type
-        NodeDef[] nda = ent.getAutoCreateNodeDefs();
-        for (int i = 0; i < nda.length; i++) {
-            NodeDef nd = nda[i];
+        for (NodeDef nd : ent.getAutoCreateNodeDefs()) {
             createNodeState(node, nd.getName(), nd.getDefaultPrimaryType(),
                     null, null, nd);
         }
@@ -1523,6 +1520,7 @@
         // compute system generated values
         Name declaringNT = def.getDeclaringNodeType();
         Name name = def.getName();
+        // TODO JCR-2116: Built-In Node Types; => adapt to JCR 2.0 built-in node types (mix:created, etc)
         if (NameConstants.MIX_REFERENCEABLE.equals(declaringNT)) {
             // mix:referenceable node type
             if (NameConstants.JCR_UUID.equals(name)) {
@@ -1537,15 +1535,15 @@
                 genValues = new InternalValue[]{InternalValue.create(parent.getNodeTypeName())};
             } else if (NameConstants.JCR_MIXINTYPES.equals(name)) {
                 // jcr:mixinTypes property
-                Set mixins = parent.getMixinTypeNames();
-                ArrayList values = new ArrayList(mixins.size());
-                Iterator iter = mixins.iterator();
-                while (iter.hasNext()) {
-                    values.add(InternalValue.create((Name) iter.next()));
+                Set<Name> mixins = parent.getMixinTypeNames();
+                ArrayList<InternalValue> values = new ArrayList<InternalValue>(mixins.size());
+                for (Name n : mixins) {
+                    values.add(InternalValue.create(n));
                 }
-                genValues = (InternalValue[]) values.toArray(new InternalValue[values.size()]);
+                genValues = values.toArray(new InternalValue[values.size()]);
             }
-        } else if (NameConstants.NT_HIERARCHYNODE.equals(declaringNT)) {
+        } else if (NameConstants.NT_HIERARCHYNODE.equals(declaringNT)
+                || NameConstants.MIX_CREATED.equals(declaringNT)) {
             // nt:hierarchyNode node type
             if (NameConstants.JCR_CREATED.equals(name)) {
                 // jcr:created property
@@ -1589,10 +1587,10 @@
         if (targetState.hasChildNodeEntries()) {
             // remove child nodes
             // use temp array to avoid ConcurrentModificationException
-            ArrayList tmp = new ArrayList(targetState.getChildNodeEntries());
+            ArrayList<ChildNodeEntry> tmp = new ArrayList<ChildNodeEntry>(targetState.getChildNodeEntries());
             // remove from tail to avoid problems with same-name siblings
             for (int i = tmp.size() - 1; i >= 0; i--) {
-                ChildNodeEntry entry = (ChildNodeEntry) tmp.get(i);
+                ChildNodeEntry entry = tmp.get(i);
                 NodeId nodeId = entry.getId();
                 try {
                     NodeState nodeState = (NodeState) stateMgr.getItemState(nodeId);
@@ -1623,9 +1621,8 @@
 
         // remove properties
         // use temp set to avoid ConcurrentModificationException
-        HashSet tmp = new HashSet(targetState.getPropertyNames());
-        for (Iterator iter = tmp.iterator(); iter.hasNext();) {
-            Name propName = (Name) iter.next();
+        HashSet<Name> tmp = new HashSet<Name>(targetState.getPropertyNames());
+        for (Name propName : tmp) {
             PropertyId propId =
                     new PropertyId(targetState.getNodeId(), propName);
             try {
@@ -1756,9 +1753,7 @@
                 newState.addShare(destParentId);
             }
             // copy child nodes
-            Iterator iter = srcState.getChildNodeEntries().iterator();
-            while (iter.hasNext()) {
-                ChildNodeEntry entry = (ChildNodeEntry) iter.next();
+            for (ChildNodeEntry entry : srcState.getChildNodeEntries()) {
                 Path srcChildPath = PathFactoryImpl.getInstance().create(srcPath, entry.getName(), true);
                 if (!srcAccessMgr.isGranted(srcChildPath, Permission.READ)) {
                     continue;
@@ -1809,10 +1804,22 @@
                 // add new child node entry to new node
                 newState.addChildNodeEntry(entry.getName(), newChildState.getNodeId());
             }
+            // init version history if needed
+            VersionHistoryInfo history = null;
+            if (versionable && flag == COPY) {
+                NodeId copiedFrom = null;
+                if (fullVersionable) {
+                    // base version of copied versionable node is reference value of
+                    // the histories jcr:copiedFrom property
+                    PropertyId propId = new PropertyId(srcState.getNodeId(), NameConstants.JCR_BASEVERSION);
+                    PropertyState prop = (PropertyState) srcStateMgr.getItemState(propId);
+                    copiedFrom = new NodeId(prop.getValues()[0].getUUID());
+                }
+                VersionManager manager = session.getVersionManager();
+                history = manager.getVersionHistory(session, newState, copiedFrom);
+            }
             // copy properties
-            iter = srcState.getPropertyNames().iterator();
-            while (iter.hasNext()) {
-                Name propName = (Name) iter.next();
+            for (Name propName : srcState.getPropertyNames()) {
                 Path propPath = PathFactoryImpl.getInstance().create(srcPath, propName, true);
                 if (!srcAccessMgr.canRead(propPath)) {
                     continue;
@@ -1838,26 +1845,16 @@
                 PropertyState newChildState =
                         copyPropertyState(srcChildState, id, propName);
 
-                if (versionable && flag == COPY) {
-                    /**
-                     * a versionable node is being copied:
-                     * copied properties declared by mix:versionable need to be
-                     * adjusted accordingly.
-                     */
-                    VersionManager manager = session.getVersionManager();
+                if (history != null) {
                     if (fullVersionable) {
                         if (propName.equals(NameConstants.JCR_VERSIONHISTORY)) {
                             // jcr:versionHistory
-                            VersionHistoryInfo history =
-                                manager.getVersionHistory(session, newState);
                             InternalValue value = InternalValue.create(
                                     history.getVersionHistoryId().getUUID());
                             newChildState.setValues(new InternalValue[] { value });
                         } else if (propName.equals(NameConstants.JCR_BASEVERSION)
                                 || propName.equals(NameConstants.JCR_PREDECESSORS)) {
                             // jcr:baseVersion or jcr:predecessors
-                            VersionHistoryInfo history =
-                                manager.getVersionHistory(session, newState);
                             InternalValue value = InternalValue.create(
                                     history.getRootVersionId().getUUID());
                             newChildState.setValues(new InternalValue[] { value });
@@ -1871,12 +1868,12 @@
                         if (propName.equals(NameConstants.JCR_ISCHECKEDOUT)) {
                             // jcr:isCheckedOut
                             newChildState.setValues(new InternalValue[]{InternalValue.create(true)});
-                            manager.getVersionHistory(session, newState);
                         }
                     }
                 }
 
-                if (newChildState.getType() == PropertyType.REFERENCE) {
+                if (newChildState.getType() == PropertyType.REFERENCE
+                        || newChildState.getType() == PropertyType.WEAKREFERENCE) {
                     refTracker.processedReference(newChildState);
                 }
                 // store new property
@@ -1961,7 +1958,7 @@
     private boolean isShareable(NodeState state) throws RepositoryException {
         // shortcut: check some wellknown built-in types first
         Name primary = state.getNodeTypeName();
-        Set mixins = state.getMixinTypeNames();
+        Set<Name> mixins = state.getMixinTypeNames();
         if (mixins.contains(NameConstants.MIX_SHAREABLE)) {
             return true;
         }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/CachingHierarchyManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/CachingHierarchyManager.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/CachingHierarchyManager.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/CachingHierarchyManager.java Wed Jul  8 13:57:13 2009
@@ -308,9 +308,8 @@
                 // Item not cached, ignore
                 return;
             }
-            PathMap.Element[] elements = entry.getElements();
-            for (int i = 0; i < elements.length; i++) {
-                Iterator iter = elements[i].getChildren();
+            for (PathMap.Element element : entry.getElements()) {
+                Iterator iter = element.getChildren();
                 while (iter.hasNext()) {
                     PathMap.Element child = (PathMap.Element) iter.next();
                     ChildNodeEntry cne = modified.getChildNodeEntry(
@@ -393,12 +392,11 @@
             if (entry == null) {
                 return;
             }
-            PathMap.Element[] parents = entry.getElements();
-            for (int i = 0; i < parents.length; i++) {
-                HashMap newChildrenOrder = new HashMap();
+            for (PathMap.Element parent : entry.getElements()) {
+                HashMap<Path.Element, PathMap.Element> newChildrenOrder = new HashMap<Path.Element, PathMap.Element>();
                 boolean orderChanged = false;
 
-                Iterator iter = parents[i].getChildren();
+                Iterator iter = parent.getChildren();
                 while (iter.hasNext()) {
                     PathMap.Element child = (PathMap.Element) iter.next();
                     LRUEntry childEntry = (LRUEntry) child.get();
@@ -436,7 +434,7 @@
 
                 if (orderChanged) {
                     /* If at least one child changed its position, reorder */
-                    parents[i].setChildren(newChildrenOrder);
+                    parent.setChildren(newChildrenOrder);
                 }
             }
             checkConsistency();

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/DefaultSecurityManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/DefaultSecurityManager.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/DefaultSecurityManager.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/DefaultSecurityManager.java Wed Jul  8 13:57:13 2009
@@ -83,7 +83,7 @@
     private static final Logger log = LoggerFactory.getLogger(DefaultSecurityManager.class);
 
     /**
-     *
+     * Flag indicating if the security manager was properly initialized.
      */
     private boolean initialized;
 
@@ -126,7 +126,7 @@
      * key = name of the workspace,
      * value = {@link AccessControlProvider}
      */
-    private final Map acProviders = new HashMap();
+    private final Map<String, AccessControlProvider> acProviders = new HashMap();
 
     /**
      * the AccessControlProviderFactory
@@ -171,10 +171,10 @@
 
         // build AuthContextProvider based on appName + optional LoginModuleConfig
         authContextProvider = new AuthContextProvider(config.getAppName(), loginModConf);
-        if (authContextProvider.isJAAS()) {
-            log.info("init: use JAAS login-configuration for " + config.getAppName());
-        } else if (authContextProvider.isLocal()) {
+        if (authContextProvider.isLocal()) {
             log.info("init: use Repository Login-Configuration for " + config.getAppName());
+        } else if (authContextProvider.isJAAS()) {
+            log.info("init: use JAAS login-configuration for " + config.getAppName());
         } else {
             String msg = "Neither JAAS nor RepositoryConfig contained a valid Configuriation for " + config.getAppName();
             log.error(msg);
@@ -184,12 +184,12 @@
         Properties[] moduleConfig = authContextProvider.getModuleConfig();
 
         // retrieve default-ids (admin and anomymous) from login-module-configuration.
-        for (int i = 0; i < moduleConfig.length; i++) {
-            if (moduleConfig[i].containsKey(LoginModuleConfig.PARAM_ADMIN_ID)) {
-                adminId = moduleConfig[i].getProperty(LoginModuleConfig.PARAM_ADMIN_ID);
+        for (Properties props : moduleConfig) {
+            if (props.containsKey(LoginModuleConfig.PARAM_ADMIN_ID)) {
+                adminId = props.getProperty(LoginModuleConfig.PARAM_ADMIN_ID);
             }
-            if (moduleConfig[i].containsKey(LoginModuleConfig.PARAM_ANONYMOUS_ID)) {
-                anonymousId = moduleConfig[i].getProperty(LoginModuleConfig.PARAM_ANONYMOUS_ID);
+            if (props.containsKey(LoginModuleConfig.PARAM_ANONYMOUS_ID)) {
+                anonymousId = props.getProperty(LoginModuleConfig.PARAM_ANONYMOUS_ID);
             }
         }
         // fallback:
@@ -228,8 +228,8 @@
         // 2) create registry instance
         principalProviderRegistry = new ProviderRegistryImpl(defaultPP);
         // 3) register all configured principal providers.
-        for (int i = 0; i < moduleConfig.length; i++) {
-            principalProviderRegistry.registerProvider(moduleConfig[i]);
+        for (Properties props : moduleConfig) {
+            principalProviderRegistry.registerProvider(props);
         }
 
         // create the principal manager for the security workspace
@@ -244,7 +244,7 @@
     public void dispose(String workspaceName) {
         checkInitialized();
         synchronized (acProviders) {
-            AccessControlProvider prov = (AccessControlProvider) acProviders.remove(workspaceName);
+            AccessControlProvider prov = acProviders.remove(workspaceName);
             if (prov != null) {
                 prov.close();
             }
@@ -257,9 +257,9 @@
     public void close() {
         checkInitialized();
         synchronized (acProviders) {
-            Iterator itr = acProviders.values().iterator();
+            Iterator<AccessControlProvider> itr = acProviders.values().iterator();
             while (itr.hasNext()) {
-                ((AccessControlProvider) itr.next()).close();
+                itr.next().close();
             }
             acProviders.clear();
         }
@@ -289,7 +289,8 @@
             throw e;
         } catch (Exception e) {
             // wrap in RepositoryException
-            String msg = "Failed to instantiate AccessManager (" + amConfig.getClassName() + ")";
+            String clsName = (amConfig == null) ? "-- missing access manager configuration --" : amConfig.getClassName();
+            String msg = "Failed to instantiate AccessManager (" + clsName + ")";
             log.error(msg, e);
             throw new RepositoryException(msg, e);
         }
@@ -298,8 +299,7 @@
     /**
      * @see JackrabbitSecurityManager#getPrincipalManager(Session)
      */
-    public synchronized PrincipalManager getPrincipalManager(Session session)
-            throws RepositoryException {
+    public PrincipalManager getPrincipalManager(Session session) throws RepositoryException {
         checkInitialized();
         if (session == securitySession) {
             return systemPrincipalManager;
@@ -410,17 +410,22 @@
     private AccessControlProvider getAccessControlProvider(String workspaceName)
             throws NoSuchWorkspaceException, RepositoryException {
         checkInitialized();
-        synchronized (acProviders) {
-            AccessControlProvider provider = (AccessControlProvider) acProviders.get(workspaceName);
-            if (provider == null) {
-                SystemSession systemSession = repository.getSystemSession(workspaceName);
-                WorkspaceConfig conf = repository.getConfig().getWorkspaceConfig(workspaceName);
-                WorkspaceSecurityConfig secConf = (conf == null) ?  null : conf.getSecurityConfig();
+        AccessControlProvider provider = acProviders.get(workspaceName);
+        if (provider == null || !provider.isLive()) {
+            SystemSession systemSession = repository.getSystemSession(workspaceName);
+            // mark this session as 'active' so the workspace does not get disposed
+            // by the workspace-janitor until the garbage collector is done
+            // TODO: review again... this workaround is now used in several places.
+            repository.onSessionCreated(systemSession);
+            
+            WorkspaceConfig conf = repository.getConfig().getWorkspaceConfig(workspaceName);
+            WorkspaceSecurityConfig secConf = (conf == null) ?  null : conf.getSecurityConfig();
+            synchronized (acProviders) {
                 provider = acProviderFactory.createProvider(systemSession, secConf);
                 acProviders.put(workspaceName, provider);
             }
-            return provider;
         }
+        return provider;
     }
 
     /**
@@ -495,13 +500,8 @@
          * {@inheritDoc}
          */
         public boolean grants(Set principals, String workspaceName) throws RepositoryException {
-            try {
-                AccessControlProvider prov = getAccessControlProvider(workspaceName);
-                return prov.canAccessRoot(principals);
-            } catch (NoSuchWorkspaceException e) {
-                // no such workspace -> return false.
-                return false;
-            }
+            AccessControlProvider prov = getAccessControlProvider(workspaceName);
+            return prov.canAccessRoot(principals);
         }
     }
 }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/HierarchyManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/HierarchyManagerImpl.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/HierarchyManagerImpl.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/HierarchyManagerImpl.java Wed Jul  8 13:57:13 2009
@@ -17,7 +17,6 @@
 package org.apache.jackrabbit.core;
 
 import java.util.Collections;
-import java.util.Iterator;
 import java.util.LinkedHashSet;
 import java.util.Set;
 
@@ -186,7 +185,7 @@
      * @return set of parent <code>NodeId</code>s. If state has no parent,
      *         array has length <code>0</code>.
      */
-    protected Set getParentIds(ItemState state, boolean useOverlayed) {
+    protected Set<NodeId> getParentIds(ItemState state, boolean useOverlayed) {
         if (state.isNode()) {
             // if this is a node, quickly check whether it is shareable and
             // whether it contains more than one parent
@@ -194,18 +193,18 @@
             if (ns.isShareable() && useOverlayed && ns.hasOverlayedState()) {
                 ns = (NodeState) ns.getOverlayedState();
             }
-            Set s = ns.getSharedSet();
+            Set<NodeId> s = ns.getSharedSet();
             if (s.size() > 1) {
                 return s;
             }
         }
         NodeId parentId = getParentId(state);
         if (parentId != null) {
-            LinkedHashSet s = new LinkedHashSet();
+            LinkedHashSet<NodeId> s = new LinkedHashSet<NodeId>();
             s.add(parentId);
             return s;
         }
-        return Collections.EMPTY_SET;
+        return Collections.emptySet();
     }
 
     /**
@@ -306,7 +305,7 @@
      * Internal implementation of {@link #resolvePath(Path)} that will either
      * resolve to a node or a property. Should be overridden by a subclass
      * that can resolve an intermediate path into an <code>ItemId</code>. This
-     * subclass can then invoke {@link #resolvePath(Path.Element[], int, ItemId, int)}
+     * subclass can then invoke {@link #resolvePath(org.apache.jackrabbit.spi.Path.Element[], int, ItemId, int)}
      * with a value of <code>next</code> greater than <code>1</code>.
      *
      * @param path path to resolve
@@ -331,7 +330,7 @@
     }
 
     /**
-     * Called by {@link #resolvePath(Path.Element[], int, ItemId, int)}.
+     * Called by {@link #resolvePath(org.apache.jackrabbit.spi.Path.Element[], int, ItemId, int)}.
      * May be overridden by some subclass to process/cache intermediate state.
      *
      * @param id      id of resolved item
@@ -577,15 +576,13 @@
         }
         try {
             ItemState state = getItemState(descendant);
-            Set parentIds = getParentIds(state, false);
+            Set<NodeId> parentIds = getParentIds(state, false);
             while (parentIds.size() > 0) {
                 if (parentIds.contains(ancestor)) {
                     return true;
                 }
-                Set grandparentIds = new LinkedHashSet();
-                Iterator iter = parentIds.iterator();
-                while (iter.hasNext()) {
-                    NodeId parentId = (NodeId) iter.next();
+                Set<NodeId> grandparentIds = new LinkedHashSet<NodeId>();
+                for (NodeId parentId : parentIds) {
                     grandparentIds.addAll(getParentIds(getItemState(parentId), false));
                 }
                 parentIds = grandparentIds;
@@ -617,16 +614,14 @@
         int depth = 1;
         try {
             ItemState state = getItemState(descendant);
-            Set parentIds = getParentIds(state, true);
+            Set<NodeId> parentIds = getParentIds(state, true);
             while (parentIds.size() > 0) {
                 if (parentIds.contains(ancestor)) {
                     return depth;
                 }
                 depth++;
-                Set grandparentIds = new LinkedHashSet();
-                Iterator iter = parentIds.iterator();
-                while (iter.hasNext()) {
-                    NodeId parentId = (NodeId) iter.next();
+                Set<NodeId> grandparentIds = new LinkedHashSet<NodeId>();
+                for (NodeId parentId : parentIds) {
                     state = getItemState(parentId);
                     grandparentIds.addAll(getParentIds(state, true));
                 }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemImpl.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemImpl.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemImpl.java Wed Jul  8 13:57:13 2009
@@ -222,17 +222,17 @@
      * @throws InvalidItemStateException
      * @throws RepositoryException
      */
-    private Collection getTransientStates()
+    private Collection<ItemState> getTransientStates()
             throws InvalidItemStateException, RepositoryException {
         // list of transient states that should be persisted
-        ArrayList dirty = new ArrayList();
+        ArrayList<ItemState> dirty = new ArrayList<ItemState>();
         ItemState transientState;
 
         if (isNode()) {
             // build list of 'new' or 'modified' descendants
-            Iterator iter = stateMgr.getDescendantTransientItemStates((NodeId) id);
+            Iterator<ItemState> iter = stateMgr.getDescendantTransientItemStates((NodeId) id);
             while (iter.hasNext()) {
-                transientState = (ItemState) iter.next();
+                transientState = iter.next();
                 // fail-fast test: check status of transient state
                 switch (transientState.getStatus()) {
                     case ItemState.STATUS_NEW:
@@ -312,15 +312,15 @@
      * @throws InvalidItemStateException
      * @throws RepositoryException
      */
-    private Collection getRemovedStates()
+    private Collection<ItemState> getRemovedStates()
             throws InvalidItemStateException, RepositoryException {
-        ArrayList removed = new ArrayList();
+        ArrayList<ItemState> removed = new ArrayList<ItemState>();
         ItemState transientState;
 
         if (isNode()) {
-            Iterator iter = stateMgr.getDescendantTransientItemStatesInAttic((NodeId) id);
+            Iterator<ItemState> iter = stateMgr.getDescendantTransientItemStatesInAttic((NodeId) id);
             while (iter.hasNext()) {
-                transientState = (ItemState) iter.next();
+                transientState = iter.next();
                 // check if stale
                 if (transientState.getStatus() == ItemState.STATUS_STALE_MODIFIED) {
                     String msg = transientState.getId()
@@ -340,7 +340,7 @@
         return removed;
     }
 
-    private void validateTransientItems(Iterator dirtyIter, Iterator removedIter)
+    private void validateTransientItems(Iterator<ItemState> dirtyIter, Iterator<ItemState> removedIter)
             throws AccessDeniedException, ConstraintViolationException,
             RepositoryException {
         /**
@@ -368,7 +368,7 @@
         NodeTypeManagerImpl ntMgr = session.getNodeTypeManager();
         // walk through list of dirty transient items and validate each
         while (dirtyIter.hasNext()) {
-            ItemState itemState = (ItemState) dirtyIter.next();
+            ItemState itemState = dirtyIter.next();
             ItemDefinition def;
             if (itemState.isNode()) {
                 def = ntMgr.getNodeDefinition(((NodeState) itemState).getDefinitionId());
@@ -506,12 +506,18 @@
                          * be checked)
                          */
                         if (constraints.length > 0
-                                && propDef.getRequiredType() == PropertyType.REFERENCE) {
+                                && (propDef.getRequiredType() == PropertyType.REFERENCE
+                                    || propDef.getRequiredType() == PropertyType.WEAKREFERENCE)) {
                             for (int i = 0; i < values.length; i++) {
                                 boolean satisfied = false;
                                 String constraintViolationMsg = null;
                                 try {
                                     UUID targetUUID = values[i].getUUID();
+                                    if (propDef.getRequiredType() == PropertyType.WEAKREFERENCE
+                                        && !itemMgr.itemExists(new NodeId(targetUUID))) {
+                                        // target of weakref doesn;t exist, skip
+                                        continue;
+                                    }
                                     Node targetNode = session.getNodeByUUID(targetUUID);
                                     /**
                                      * constraints are OR-ed, i.e. at least one
@@ -519,7 +525,7 @@
                                      */
                                     for (int j = 0; j < constraints.length; j++) {
                                         /**
-                                         * a REFERENCE value constraint specifies
+                                         * a [WEAK]REFERENCE value constraint specifies
                                          * the name of the required node type of
                                          * the target node
                                          */
@@ -547,7 +553,9 @@
                                     }
                                 } catch (RepositoryException re) {
                                     String msg = itemMgr.safeGetJCRPath(propId)
-                                            + ": failed to check REFERENCE value constraint";
+                                            + ": failed to check "
+                                            + ((propDef.getRequiredType() == PropertyType.REFERENCE) ? "REFERENCE" : "WEAKREFERENCE")
+                                            + " value constraint";
                                     log.debug(msg);
                                     throw new ConstraintViolationException(msg, re);
                                 }
@@ -569,7 +577,7 @@
 
         // walk through list of removed transient items and check REMOVE permission
         while (removedIter.hasNext()) {
-            ItemState itemState = (ItemState) removedIter.next();
+            ItemState itemState = removedIter.next();
             ItemDefinition def;
             if (itemState.isNode()) {
                 def = ntMgr.getNodeDefinition(((NodeState) itemState).getDefinitionId());
@@ -590,14 +598,14 @@
         }
     }
 
-    private void removeTransientItems(Iterator iter) {
+    private void removeTransientItems(Iterator<ItemState> iter) {
 
         /**
          * walk through list of transient items marked 'removed' and
          * definitively remove each one
          */
         while (iter.hasNext()) {
-            ItemState transientState = (ItemState) iter.next();
+            ItemState transientState = iter.next();
             ItemState persistentState = transientState.getOverlayedState();
             /**
              * remove persistent state
@@ -609,22 +617,22 @@
         }
     }
 
-    private void persistTransientItems(Iterator iter)
+    private void persistTransientItems(Iterator<ItemState> iter)
             throws RepositoryException {
 
         // walk through list of transient items and persist each one
         while (iter.hasNext()) {
-            ItemState state = (ItemState) iter.next();
+            ItemState state = iter.next();
             ItemImpl item = itemMgr.getItem(state.getId());
             // persist state of transient item
             item.makePersistent();
         }
     }
 
-    private void restoreTransientItems(Iterator iter) {
+    private void restoreTransientItems(Iterator<ItemState> iter) {
         // walk through list of transient states and re-apply transient changes
         while (iter.hasNext()) {
-            ItemState itemState = (ItemState) iter.next();
+            ItemState itemState = iter.next();
             ItemId id = itemState.getId();
             ItemImpl item;
 
@@ -677,9 +685,9 @@
      * has been removed, throw.</li>
      * </ul>
      */
-    private void processShareableNodes(Iterator iter) throws RepositoryException {
+    private void processShareableNodes(Iterator<ItemState> iter) throws RepositoryException {
         while (iter.hasNext()) {
-            ItemState is = (ItemState) iter.next();
+            ItemState is = iter.next();
             if (is.isNode()) {
                 NodeState ns = (NodeState) is;
                 boolean wasShareable = false;
@@ -715,11 +723,11 @@
      * @return true if this call generated new transient state; otherwise false
      * @throws RepositoryException
      */
-    private boolean initVersionHistories(Iterator iter) throws RepositoryException {
+    private boolean initVersionHistories(Iterator<ItemState> iter) throws RepositoryException {
         // walk through list of transient items and search for new versionable nodes
         boolean createdTransientState = false;
         while (iter.hasNext()) {
-            ItemState itemState = (ItemState) iter.next();
+            ItemState itemState = iter.next();
             if (itemState.isNode()) {
                 NodeState nodeState = (NodeState) itemState;
                 EffectiveNodeType nt = getEffectiveNodeType(nodeState);
@@ -736,7 +744,7 @@
                          * otherwise create a new version history
                          */
                         VersionHistoryInfo history =
-                            vMgr.getVersionHistory(session, nodeState);
+                            vMgr.getVersionHistory(session, nodeState, null);
                         InternalValue historyId = InternalValue.create(
                                 history.getVersionHistoryId().getUUID());
                         InternalValue versionId = InternalValue.create(
@@ -758,7 +766,7 @@
                     // version history, since simple versioning does not
                     // expose it's reference in a property
                     VersionManager vMgr = session.getVersionManager();
-                    vMgr.getVersionHistory(session, nodeState);
+                    vMgr.getVersionHistory(session, nodeState, null);
 
                     // create isCheckedOutProperty if not already exists
                     NodeImpl node = (NodeImpl) itemMgr.getItem(itemState.getId());
@@ -936,7 +944,7 @@
              * build list of transient (i.e. new & modified) states that
              * should be persisted
              */
-            Collection dirty = getTransientStates();
+            Collection<ItemState> dirty = getTransientStates();
             if (dirty.size() == 0) {
                 // no transient items, nothing to do here
                 return;
@@ -946,17 +954,17 @@
              * build list of transient descendants in the attic
              * (i.e. those marked as 'removed')
              */
-            Collection removed = getRemovedStates();
+            Collection<ItemState> removed = getRemovedStates();
 
             /**
              * build set of item id's which are within the scope of
              * (i.e. affected by) this save operation
              */
-            Set affectedIds = new HashSet(dirty.size() + removed.size());
-            for (Iterator it =
+            Set<ItemId> affectedIds = new HashSet<ItemId>(dirty.size() + removed.size());
+            for (Iterator<ItemState> it =
                     new IteratorChain(dirty.iterator(), removed.iterator());
                  it.hasNext();) {
-                affectedIds.add(((ItemState) it.next()).getId());
+                affectedIds.add(it.next().getId());
             }
 
             /**
@@ -966,13 +974,13 @@
              * (e.g. moving a node requires that the target node including both
              * old and new parents are saved)
              */
-            for (Iterator it =
+            for (Iterator<ItemState> it =
                     new IteratorChain(dirty.iterator(), removed.iterator());
                  it.hasNext();) {
-                ItemState transientState = (ItemState) it.next();
+                ItemState transientState = it.next();
                 if (transientState.isNode()) {
                     NodeState nodeState = (NodeState) transientState;
-                    Set dependentIDs = new HashSet();
+                    Set<NodeId> dependentIDs = new HashSet<NodeId>();
                     if (nodeState.hasOverlayedState()) {
                         NodeState overlayedState =
                                 (NodeState) nodeState.getOverlayedState();
@@ -1001,11 +1009,11 @@
                                         try {
                                             NodeState parent = (NodeState) stateMgr.getTransientItemState(newParentId);
                                             // check parent's renamed child node entries
-                                            for (Iterator cneIt =
+                                            for (Iterator<ChildNodeEntry> cneIt =
                                                     parent.getRenamedChildNodeEntries().iterator();
                                                  cneIt.hasNext();) {
                                                 ChildNodeEntry cne =
-                                                        (ChildNodeEntry) cneIt.next();
+                                                        cneIt.next();
                                                 if (cne.getId().equals(nodeState.getId())) {
                                                     // node has been renamed,
                                                     // add parent to dependencies
@@ -1023,25 +1031,25 @@
                     }
 
                     // removed child node entries
-                    for (Iterator cneIt =
+                    for (Iterator<ChildNodeEntry> cneIt =
                             nodeState.getRemovedChildNodeEntries().iterator();
                          cneIt.hasNext();) {
-                        ChildNodeEntry cne = (ChildNodeEntry) cneIt.next();
+                        ChildNodeEntry cne = cneIt.next();
                         dependentIDs.add(cne.getId());
                     }
                     // added child node entries
-                    for (Iterator cneIt =
+                    for (Iterator<ChildNodeEntry> cneIt =
                             nodeState.getAddedChildNodeEntries().iterator();
                          cneIt.hasNext();) {
-                        ChildNodeEntry cne = (ChildNodeEntry) cneIt.next();
+                        ChildNodeEntry cne = cneIt.next();
                         dependentIDs.add(cne.getId());
                     }
 
                     // now walk through dependencies and check whether they
                     // are within the scope of this save operation
-                    Iterator depIt = dependentIDs.iterator();
+                    Iterator<NodeId> depIt = dependentIDs.iterator();
                     while (depIt.hasNext()) {
-                        NodeId id = (NodeId) depIt.next();
+                        NodeId id = depIt.next();
                         if (!affectedIds.contains(id)) {
                             // JCR-1359 workaround: check whether unresolved
                             // dependencies originate from 'this' session;
@@ -1101,8 +1109,8 @@
                 // transient item states must be removed now. otherwise
                 // the session item state provider will return an orphaned
                 // item state which is not referenced by any node instance.
-                for (Iterator it = dirty.iterator(); it.hasNext();) {
-                    ItemState transientState = (ItemState) it.next();
+                for (Iterator<ItemState> it = dirty.iterator(); it.hasNext();) {
+                    ItemState transientState = it.next();
                     // dispose the transient state, it is no longer used
                     stateMgr.disposeTransientItemState(transientState);
                 }
@@ -1135,8 +1143,8 @@
             // item states in attic are removed after store, because
             // the observation mechanism needs to build paths of removed
             // items in store().
-            for (Iterator it = removed.iterator(); it.hasNext();) {
-                ItemState transientState = (ItemState) it.next();
+            for (Iterator<ItemState> it = removed.iterator(); it.hasNext();) {
+                ItemState transientState = it.next();
                 // dispose the transient state, it is no longer used
                 stateMgr.disposeTransientItemStateInAttic(transientState);
             }
@@ -1168,7 +1176,7 @@
         }
 
         // list of transient items that should be discarded
-        ArrayList list = new ArrayList();
+        ArrayList<ItemState> list = new ArrayList<ItemState>();
         ItemState transientState;
 
         // check status of this item's state
@@ -1205,9 +1213,9 @@
 
         if (isNode()) {
             // build list of 'new', 'modified' or 'stale' descendants
-            Iterator iter = stateMgr.getDescendantTransientItemStates((NodeId) id);
+            Iterator<ItemState> iter = stateMgr.getDescendantTransientItemStates((NodeId) id);
             while (iter.hasNext()) {
-                transientState = (ItemState) iter.next();
+                transientState = iter.next();
                 switch (transientState.getStatus()) {
                     case ItemState.STATUS_STALE_MODIFIED:
                     case ItemState.STATUS_STALE_DESTROYED:
@@ -1226,9 +1234,9 @@
         }
 
         // process list of 'new', 'modified' or 'stale' transient states
-        Iterator iter = list.iterator();
+        Iterator<ItemState> iter = list.iterator();
         while (iter.hasNext()) {
-            transientState = (ItemState) iter.next();
+            transientState = iter.next();
             // dispose the transient state, it is no longer used;
             // this will indirectly (through stateDiscarded listener method)
             // either restore or permanently invalidate the wrapping Item instances
@@ -1240,7 +1248,7 @@
             // as 'removed'); this will resurrect the removed items
             iter = stateMgr.getDescendantTransientItemStatesInAttic((NodeId) id);
             while (iter.hasNext()) {
-                transientState = (ItemState) iter.next();
+                transientState = iter.next();
                 // dispose the transient state; this will indirectly (through
                 // stateDiscarded listener method) resurrect the wrapping Item instances
                 stateMgr.disposeTransientItemStateInAttic(transientState);



Mime
View raw message