[
https://jira.jboss.org/jira/browse/DNA-293?page=com.atlassian.jira.plugin...
]
Randall Hauch commented on DNA-293:
-----------------------------------
Changed JcrSession.populateNode(...) to never use PropertyType.UNDEFINED for the actual
property type on a property. This means that even though UNDEFINED is allows on
PropertyDefinition, it is not allowed on an actual Property instance. Therefore, I added
the actual property type as an int field to JcrAbstractProperty, and modified the
subclasses and the code where the constructors are called (mostly JcrSession and unit
tests).
The current choice is to use PropertyType.STRING, since all property values can be
converted to a String. See the issue for more details and a discussion of this logic.
JcrSession creates Property instances that use the
PropertyType.UNDEFINED, which is not allowed
-----------------------------------------------------------------------------------------------
Key: DNA-293
URL:
https://jira.jboss.org/jira/browse/DNA-293
Project: DNA
Issue Type: Bug
Components: JCR
Affects Versions: 0.3
Reporter: Randall Hauch
Assignee: Randall Hauch
Fix For: 0.4
The "undefined" property type is only allowed in property definitions.
According to the JSR-170 specification (Section, 6.2.5):
"This constant can be used within a property definition (see 6.7.6 Property
Definitions) to specify that the property in
question may be of any type. However, it cannot be the actual type of any property
instance. For example it will
never be returned by Property.getType and (in level 2 implementations) it cannot be
assigned as the type when
creating a new property."
When the property definition has a type of "undefined", then we'll need to
choose what actual type to use. There doesn't appear to be any guidance on this in
the spec (anybody?), so barring that the most logical approach is probably to look at the
first property value.
Note that this is one reason why the DNA graph API was designed with the value factories
to allow (or encourage) the client to convert the property values to the type desired by
the client. Because of this, it doesn't matter so much what type the value actually
is, but rather that it can be converted to the type needed by the user. So this should
make the above assumption (about choosing the property type based upon value) a pretty
decent one.
--
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