jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tobias Bocanegra (JIRA)" <j...@apache.org>
Subject [jira] Updated: (JCR-1707) Node.setProperty(String, String, PropertyType.UNDEFINED) might fail unexpectedly for multiple prop. defs
Date Mon, 04 Aug 2008 20:56:44 GMT

     [ https://issues.apache.org/jira/browse/JCR-1707?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Tobias Bocanegra updated JCR-1707:
----------------------------------

    Description: 
Assume you have a node type defined with 2 property defs with the same name but different
types, eg:

[Test] > nt:base
  - foo (string) mandatory
  - foo (reference) mandatory

when setting this property with: Node.setProperty("foo", "bar", PropertyType.UNDEFINED) it
might throw a "javax.jcr.ValueFormatException: not a valid UUID format"  
because 'bar' is not valid uuid. imo, a matching property def for the given value should be
used.

otoh, it could also give unexpected results the other way around, e.g. if a uuid is passed
but the string-def is used first. so the string property def should be tried last.

the workaround is of course to specify a property type or to use setProperty(String, String)

  was:
Assume you have a node type defined with 2 property defs with the same name but different
types, eg:

[Test] > nt:base
  - foo (string) mandatory
  - foo (reference) mandatory

when setting this property with: Node.setProperty("foo", "bar") it might throw a "javax.jcr.ValueFormatException:
not a valid UUID format"  
because 'bar' is not valid uuid. imo, a matching property def for the given value should be
used.

otoh, it could also give unexpected results the other way around, e.g. if a uuid is passed
but the string-def is used first. so the string property def should be tried last.

the workaround is of course to specify a property type.

        Summary: Node.setProperty(String, String, PropertyType.UNDEFINED) might fail unexpectedly
for multiple prop. defs  (was: Node.setProperty(String, String) might fail unexpectedly for
multiple prop. defs)

> Node.setProperty(String, String, PropertyType.UNDEFINED) might fail unexpectedly for
multiple prop. defs
> --------------------------------------------------------------------------------------------------------
>
>                 Key: JCR-1707
>                 URL: https://issues.apache.org/jira/browse/JCR-1707
>             Project: Jackrabbit
>          Issue Type: Bug
>    Affects Versions: core 1.4.5
>            Reporter: Tobias Bocanegra
>
> Assume you have a node type defined with 2 property defs with the same name but different
types, eg:
> [Test] > nt:base
>   - foo (string) mandatory
>   - foo (reference) mandatory
> when setting this property with: Node.setProperty("foo", "bar", PropertyType.UNDEFINED)
it might throw a "javax.jcr.ValueFormatException: not a valid UUID format"  
> because 'bar' is not valid uuid. imo, a matching property def for the given value should
be used.
> otoh, it could also give unexpected results the other way around, e.g. if a uuid is passed
but the string-def is used first. so the string property def should be tried last.
> the workaround is of course to specify a property type or to use setProperty(String,
String)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message