jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Guggisberg <stefan.guggisb...@gmail.com>
Subject Re: Property::setValue specification
Date Thu, 11 Aug 2011 15:53:52 GMT
On Thu, Aug 11, 2011 at 5:22 PM, David Buchmann <david.buchmann@liip.ch> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> hi,
>
> implementing the php port of jcr as closely to the java spec as the
> language differences permit, i have a question about the javadoc of
> Property.setValue(Value value)
>
> the javadoc [1] tells that "If the property type is constrained, then a
> best-effort conversion is attempted."
> however, the jcr 2.0 specification defines in 3.6.4 an exact list of
> what can be converted into which types and when to throw the
> ValueFormatException.
> the best-effort conversion suggerates that the implementation might
> convert more of the cases or "just does something" like convert string
> "hello" to integer 1.

no, that's not the intention. best-effort in this case means that a conversion
is attempted but it's not guaranteed to succeed.

> however, such behaviour would result in
> non-portable client code because what works with one implementation
> works not with an other.
>
> should the setValue method javadoc read "...then a conversion *according
> to jcr spec paragraph 3.6.4* is attempted." ?

i agree that the javadoc could be more specific WRT the supported
value conversions.

could you please file a jira issue [0]?

thanks
stefan

[0] http://java.net/jira/browse/JSR_333


>
> cheers,david
>
> [1]
> http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/Property.html#setValue%28javax.jcr.Value%29
> [2]
> http://www.day.com/specs/jcr/2.0/3_Repository_Model.html#3.6.4%20Property%20Type%20Conversion
> - --
> Liip AG // Agile Web Development // T +41 26 422 25 11
> CH-1700 Fribourg // PGP 0xA581808B // www.liip.ch
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk5D87wACgkQqBnXnqWBgIuhbgCeO+yezmf+eqM1xEG6t/8GbhBR
> kbwAnAqYx5JtA6xf/HrzspFE/iwqxirB
> =OJyi
> -----END PGP SIGNATURE-----
>

Mime
View raw message