[
https://jira.jboss.org/jira/browse/DNA-335?page=com.atlassian.jira.plugin...
]
Brian Carothers updated DNA-335:
--------------------------------
Attachment: DNA-335_overriding_definitions.patch
Added patch that changes the behavior to be more consistent with the implications of
section 4.7.7 in the JCR 2.0 spec. Subtypes can override definitions of their supertypes
(or their super-supertypes, etc.). Included some very rudimentary test cases as a sanity
check. A more complete test suite is forthcoming.
This patch retains the support for multiple inheritance but adds the assumption that any
future type registration support will limit overriding to cases where the overriding
property or child node definition is "more narrow" than the definition being
overridden. In the case of properties, this implies that the required type of the
property in the subtype's property definition can ALWAYS be cast to the required type
of the property in the supertype's definition.
DNA's NodeTypeManager implementation does not allow multiple
definitions with the same name
-------------------------------------------------------------------------------------------
Key: DNA-335
URL:
https://jira.jboss.org/jira/browse/DNA-335
Project: DNA
Issue Type: Bug
Reporter: Randall Hauch
Attachments: dna-335-definitionsWithSameName.patch,
DNA-335_clean_type_source.patch, DNA-335_overriding_definitions.patch
The JCR Specification (version 1.0.1) does not preclude that there may be multiple
property definitions with the same name, or that there may be multiple child definitions
with the same name. JCR 1.0 (version 1.0.1) DOES say that there may be multiple residual
definitions with the same name. However, the draft version of the JSR-283 specification
does have a new section 4.7.15 that specifically addresses and allows multiple definitions
with the same name, as long as they are distinguishable from the other definitions with
the same name (for property definitions, this means the type must be different; for child
node definitions, this means the required primary types attribute).
There are a number of places where the logic is expecting a single property definition
(or child definition) given a node type and a definition name. This is obviously flawed.
Also, our logic to select the "best" property definition or "best"
child node definition doesn't seem to be correct, in that it tends to favor
less-restricted definitions that are lower in the type hierarchy rather than very good
matching definitions higher in the type hierarchy.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira