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

Re: svn commit: r24791 - in trunk/subversion/bindings/javahl: native src/org/tigris/subversion/javahl src/org/tigris/subversion/javahl/tests

From: Daniel Rall <dlr_at_collab.net>
Date: 2007-04-26 18:39:18 CEST

On Thu, 26 Apr 2007, hwright@tigris.org wrote:
...
> JavaHL: Eliminate duplicate native implementations of propertyCreate(), and
> implement one version as a wrapper around the other. Also, modify the
> properties test to use propertyCreate() as well as propertySet().
...
> --- trunk/subversion/bindings/javahl/native/org_tigris_subversion_javahl_SVNClient.cpp (original)
> +++ trunk/subversion/bindings/javahl/native/org_tigris_subversion_javahl_SVNClient.cpp Thu Apr 26 09:00:39 2007
...
> -JNIEXPORT void JNICALL
> -Java_org_tigris_subversion_javahl_SVNClient_propertyCreate__Ljava_lang_String_2Ljava_lang_String_2_3BZZ
> -(JNIEnv *env, jobject jthis, jstring jpath, jstring jname, jbyteArray jvalue,
> - jboolean jrecurse, jboolean jforce)
> -{
> - JNIEntry(SVNClient, propertyCreate);
> - SVNClient *cl = SVNClient::getCppObject(jthis);
> - if (cl == NULL)
> - {
> - JNIUtil::throwError(_("bad C++ this"));
> - return;
> - }
> - JNIStringHolder path(jpath);
> - if (JNIUtil::isExceptionThrown())
> - return;
> -
> - JNIStringHolder name(jname);
> - if (JNIUtil::isExceptionThrown())
> - return;
> -
> - JNIByteArray value(jvalue);
> - if (JNIUtil::isExceptionThrown())
> - return;
> -
> - cl->propertyCreate(path, name, (const char *)value.getBytes(),
> - jrecurse ? true:false,
> - jforce ? true:false);
> -}
> -
> JNIEXPORT jobject JNICALL
> Java_org_tigris_subversion_javahl_SVNClient_revProperty
> (JNIEnv *env, jobject jthis, jstring jpath, jstring jname, jobject jrevision)
>
> Modified: trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java?pathrev=24791&r1=24790&r2=24791
> ==============================================================================
> --- trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java (original)
> +++ trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java Thu Apr 26 09:00:39 2007
> @@ -1447,9 +1447,12 @@
> * @throws ClientException
> * @since 1.2
> */
> - public native void propertyCreate(String path, String name, byte[] value,
> - boolean recurse, boolean force)
> - throws ClientException;
> + public void propertyCreate(String path, String name, byte[] value,
> + boolean recurse, boolean force)
> + throws ClientException
> + {
> + propertyCreate(path, name, new String(value), recurse, force);
> + }
...

Isn't "new String(value)" doing an implicit byte -> char conversion in
the JVM's default character set? Could this be lossy?

It might be safer to make this change the other way around...

  • application/pgp-signature attachment: stored
Received on Thu Apr 26 18:40:36 2007

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.