You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Sebastian Prehn <se...@planetswebdesign.de> on 2008/02/18 21:37:03 UTC

DateValue.getDate not a copy

Hi
I noticed that getDate() in org.apache.jackrabbit.value.DateValue is returned 
by reference. According to the specification it should be a copy. (see. 
6.2.7) Do I miss something or is this a bug?


private Calendar date;

public Calendar getDate()
            throws ValueFormatException, IllegalStateException,
            RepositoryException {
        setValueConsumed();

        if (date != null) {
            return date; // <-- HERE
        } else {
            throw new ValueFormatException("empty value");
        }
    }


-- 
PLANETS-Webdesign - Web Applications
Sebastian Prehn
Balbierstr.8 67663 Kaiserslautern
www.planetswebdesign.de
PGP keyID: 0x3507AF63

Re: DateValue.getDate not a copy

Posted by Marcel Reutegger <ma...@gmx.net>.
Hi Sebastian,

I'd say this is a bug. can you please file a bug report?

http://issues.apache.org/jira/browse/JCR

thank you

regards
  marcel

Sebastian Prehn wrote:
> Hi
> I noticed that getDate() in org.apache.jackrabbit.value.DateValue is returned 
> by reference. According to the specification it should be a copy. (see. 
> 6.2.7) Do I miss something or is this a bug?
> 
> 
> private Calendar date;
> 
> public Calendar getDate()
>             throws ValueFormatException, IllegalStateException,
>             RepositoryException {
>         setValueConsumed();
> 
>         if (date != null) {
>             return date; // <-- HERE
>         } else {
>             throw new ValueFormatException("empty value");
>         }
>     }
> 
>