Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 83471 invoked from network); 11 Oct 2010 13:16:06 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 11 Oct 2010 13:16:06 -0000 Received: (qmail 11742 invoked by uid 500); 11 Oct 2010 13:16:05 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 10546 invoked by uid 500); 11 Oct 2010 13:16:02 -0000 Mailing-List: contact dev-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 dev@jackrabbit.apache.org Received: (qmail 10531 invoked by uid 99); 11 Oct 2010 13:16:00 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Oct 2010 13:16:00 +0000 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.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Oct 2010 13:15:58 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o9BDFaL1029977 for ; Mon, 11 Oct 2010 13:15:36 GMT Message-ID: <25792982.75731286802936349.JavaMail.jira@thor> Date: Mon, 11 Oct 2010 09:15:36 -0400 (EDT) From: "Stefan Guggisberg (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Resolved: (JCR-1867) Missing conflict when adding a mixin, whose protected items have been manually added before In-Reply-To: <63043851.1227113744290.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/JCR-1867?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Stefan Guggisberg resolved JCR-1867. ------------------------------------ Resolution: Fixed Fix Version/s: 1.6.2 2.0-alpha1 non-reproducible on 2.2 trunk, most likely fixed through resolution of JCR-2170. > Missing conflict when adding a mixin, whose protected items have been manually added before > ------------------------------------------------------------------------------------------- > > Key: JCR-1867 > URL: https://issues.apache.org/jira/browse/JCR-1867 > Project: Jackrabbit Content Repository > Issue Type: Bug > Components: jackrabbit-core > Reporter: angela > Fix For: 2.0-alpha1, 1.6.2 > > > with a unstructured node it is possible to manually create protected items of the jcr namespace such > as e.g. jcr:uuid. while this obviously isn't recommended, but it currently works fine... > however i would expect that subsequently adding a mixin-type that defines those items (in the example mix:referenceable) would either > - fail with constraintviolationexception or > - at least redefine the items according to the mixin definition. > test case for illustration of the problem that no only applies to jcr:uuid but to any protected item defined by a built-in or custom node type. > public void testConflictingJcrUUID() throws RepositoryException { > // adding a custom jcr:uuid property is definitely not recommended > // but it currently works... > Node n = testRootNode.addNode(nodeName1, JcrConstants.NT_UNSTRUCTURED); > n.setProperty(JcrConstants.JCR_UUID, true); > testRootNode.save(); > assertTrue(n.hasProperty(JcrConstants.JCR_UUID)); > assertFalse(n.isNodeType(JcrConstants.MIX_REFERENCEABLE)); > Property p = n.getProperty(JcrConstants.JCR_UUID); > assertEquals(PropertyType.BOOLEAN, p.getType()); > NodeType nt = p.getDefinition().getDeclaringNodeType(); > assertEquals(JcrConstants.NT_UNSTRUCTURED, nt.getName()); > // ... test effect of adding mix:referenceable now > n.addMixin(JcrConstants.MIX_REFERENCEABLE); > n.save(); > assertTrue(n.isNodeType(JcrConstants.MIX_REFERENCEABLE)); > assertEquals(PropertyType.STRING, p.getType()); <====== false. type is still > UUID.fromString(p.getString()); <====== fails. value is still 'true' > nt = p.getDefinition().getDeclaringNodeType(); > assertEquals("mix:referenceable", nt.getName()); <====== false. declaring nt is still nt:unstructured > } > in order to avoid unexpected (and maybe hard to analyze) behavior, i would prefer if > adding the mixin (or saving the changes) would fail in the first place indicating to the API > user that existing content conflicts with the mixin to be added. > btw: > i didn't test Node#setPrimaryType(String) but after all i would expected a corresponding validation. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.