jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <marcel.reuteg...@gmx.net>
Subject Re: org.apache.jackrabbit.jcr2spi.NodeImpl question
Date Wed, 28 Oct 2009 08:10:08 GMT
Hi,

IIUC, this tells setProperty() on line 320 that it does not need to
convert the value to another type and that it should use the type
present on the passed value instance.

though, it seems inconsistent because all other setProperty() methods
pass the type that is also present in the value.

regards
 marcel

2009/10/26 Michael D Robinson <mdrobins@thoughtworks.com>:
> Hi,
>
> I was reviewing source code[1], and found a bit I didn't understand:
>
> 317      public Property setProperty(String name, String value) throws
> ValueFormatException, VersionException, LockException,
> ConstraintViolationException, RepositoryException {
> 318     // validation performed in subsequent method
> 319     Value v = (value == null) ? null :
> session.getValueFactory().createValue(value, PropertyType.STRING);
> 320     return setProperty(name, v, PropertyType.UNDEFINED);
> 321     }
>
> Why does this code create a value of PropertyType.STRING, and then use
> it to set a property of type PropertyType.UNDEFINED?
>
> Thanks.
>
>    -Michael Robinson
>
> [1] http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java?view=markup
>

Mime
View raw message