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

[PATCH] JavaHL propertyGet handling in org.tigris.subversion package

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Tue, 20 Nov 2012 12:01:14 +0000

Patches to the Subversion code should go to dev_at_s.a.o.

A log message that would help. Look at old log messages for the code
and see the guidelines:
http://subversion.apache.org/docs/community-guide/conventions.html#log-messages

A regression test would also help.

Conor MacNeill <conor_at_codefeed.com> writes:

> Hi,
>
> I've been having a problem with the 1.7 JavaHL implementation in the
> org.tigris.subversion package. As I understand the code, this has been
> written as a wrapper around the new org.apache.subversion package. The
> propertyGet method is calling new String() around the byte[] value returned
> from the new interface's equivalent method. The problem is that when this
> returns null, the old interface method throws a NullPointerException rather
> than returning null.
>
> This is somewhat related to the discussion in
>
> http://subversion.tigris.org/issues/show_bug.cgi?id=3770
>
> although it's of a slightly different character.
>
> I suggest the following change:
>
> Index: SVNClient.java
> ===================================================================
> --- SVNClient.java (revision 1411518)
> +++ SVNClient.java (working copy)
> @@ -2110,10 +2110,10 @@
> {
> try
> {
> - return new PropertyData(path, name,
> - new String(aSVNClient.propertyGet(path, name,
> - revision == null ? null : revision.toApache(),
> - pegRevision == null ? null :
> pegRevision.toApache())));
> + byte[] propertyBytes = aSVNClient.propertyGet(path, name,
> + revision == null ? null : revision.toApache(),
> + pegRevision == null ? null : pegRevision.toApache());
> + return propertyBytes == null ? null : new PropertyData(path,
> name, new String(propertyBytes));
> }
> catch (org.apache.subversion.javahl.ClientException ex)
> {
>
> What do you think?
>
> Cheers
> Conor

-- 
Certified & Supported Apache Subversion Downloads:
http://www.wandisco.com/subversion/download
Received on 2012-11-20 13:02:23 CET

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.