JcrValue.asType(int desiredPropertyType) skips a number of valid conversions and has
duplicate logic
----------------------------------------------------------------------------------------------------
Key: DNA-336
URL:
https://jira.jboss.org/jira/browse/DNA-336
Project: DNA
Issue Type: Bug
Components: JCR
Affects Versions: 0.3
Reporter: Randall Hauch
Assignee: Randall Hauch
Fix For: 0.4
Currently the JcrValue implementation has a method "asType(int propertyType)"
that creates a new JcrValue object with the original values converted to the specified
type. There are a couple of cases that are missed:
1) The code does not do any conversion to LONG of DOUBLE. However, according to the JCR
1.0 specification, it is possible to convert these if the current type is a STRING,
BINARY, DATE, DOUBLE, or LONG.
2) The code does not do any conversion to REFERENCE. However, according to the JCR 1.0
specification, it is possible to convert these if the current type is a STRING, NAME, or
BINARY.
3) The conversion to a number of types exclude going to BINARY
4) The conversion to NAME and PATH both have somewhat complex logic to determine if a
conversion is possible, even the current value factories do the same checks. The code
should just let the value factories do the checks.
--
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