[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [Issue 3770] New - JavaHL method to set binary property is broken

From: Hyrum K Wright <hyrum_at_hyrumwright.org>
Date: Thu, 30 Dec 2010 14:17:08 -0500

On Wed, Dec 29, 2010 at 4:43 PM, <markphip_at_tigris.org> wrote:
> http://subversion.tigris.org/issues/show_bug.cgi?id=3770
>                 Issue #|3770
>                 Summary|JavaHL method to set binary property is broken
>               Component|subversion
>                 Version|1.6.x
>                Platform|Macintosh
>                     URL|
>              OS/Version|All
>                  Status|NEW
>       Status whiteboard|
>                Keywords|
>              Resolution|
>              Issue type|DEFECT
>                Priority|P2
>            Subcomponent|bindings_javahl
>             Assigned to|issues_at_subversion
>             Reported by|markphip
>
>
>
>
>
>
> ------- Additional comments from markphip_at_tigris.org Wed Dec 29 13:43:28 -0800 2010 -------
> JavaHL has a method to set a property using a byte array.  This method existed so that binary
> properties, such as an image thumbnail can be set on a file.  If you go back to the source for SVN 1.2,
> this went direct to a native method.  Somewhere along the way (probably in 1.5 release) as new method
> signatures were added and we sought to reuse those methods we broke this function.  Look at the
> current SVN 1.6.x implementation:
>
>
>    /**
>     * @deprecated Use {@link #propertySet(String, String, String, int,
>     *                                     String[], boolean, Map)} instead.
>     * @since 1.2
>     */
>    public void propertySet(String path, String name, byte[] value,
>                            boolean recurse, boolean force)
>            throws ClientException
>    {
>        propertySet(path, name, new String(value), recurse, force);
>    }
>
>
> The incoming byte[] is converted to a String and the common method for using a String is used.  This
> causes binary values to be corrupted.  I think we need to add a native method back to the JavaHL library
> which receives a pure byte array.

Mark,
Daniel pointed out on IRC that all the revpropTable arguments in the
JavaHL API are Map<String, String>. Should they be adjusted to
Map<String, byte[]> ?

-Hyrum
Received on 2010-12-30 20:17:50 CET

This is an archived mail posted to the Subversion Dev mailing list.