Index: src/test/java/org/apache/jackrabbit/core/SetNonExactTypedPropertyValueTest.java =================================================================== --- src/test/java/org/apache/jackrabbit/core/SetNonExactTypedPropertyValueTest.java (revision 0) +++ src/test/java/org/apache/jackrabbit/core/SetNonExactTypedPropertyValueTest.java (revision 0) @@ -0,0 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.jackrabbit.core; + +import org.apache.jackrabbit.test.AbstractJCRTest; + +import javax.jcr.Node; +import javax.jcr.RepositoryException; +import javax.jcr.Session; +import javax.jcr.Value; +import javax.jcr.ValueFactory; + +/** + * This tests that JCR-2652 is fixed + */ +public class SetNonExactTypedPropertyValueTest extends AbstractJCRTest { + + public void testSetNonExactTypedPropertyValue() throws RepositoryException { + Session session = testRootNode.getSession(); + Node node = testRootNode.addNode("dummy", "nt:resource"); // Create a node + ValueFactory vf = session.getValueFactory(); + Value value = vf.createValue("1234", 3); // Create a LongValue + node.setProperty("jcr:lastModified", value); // Attempt to use the LongValue to set a Date property + } + +} Index: src/main/java/org/apache/jackrabbit/core/ItemManager.java =================================================================== --- src/main/java/org/apache/jackrabbit/core/ItemManager.java (revision 953247) +++ src/main/java/org/apache/jackrabbit/core/ItemManager.java (working copy) @@ -222,7 +222,7 @@ try { NodeImpl parent = (NodeImpl) getItem(state.getParentId()); return parent.getApplicablePropertyDefinition( - state.getName(), state.getType(), state.isMultiValued(), true); + state.getName(), state.getType(), state.isMultiValued(), false); // was 'true' < JCR-2652 } catch (ItemNotFoundException e) { // parent probably removed, get it from attic }