subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hwri...@apache.org
Subject svn commit: r917702 - in /subversion/trunk/subversion/bindings/javahl: native/ src/org/apache/subversion/javahl/ src/org/tigris/subversion/javahl/
Date Mon, 01 Mar 2010 20:37:14 GMT
Author: hwright
Date: Mon Mar  1 20:37:13 2010
New Revision: 917702

URL: http://svn.apache.org/viewvc?rev=917702&view=rev
Log:
JavaHL: Instead of constructing and returning a PropertyData object when
requesting a revision property, just return a byte[].  The caller already
has the information contained in the PropertyData object, and s/he can readily
create a String from a byte[].

[ subversion/bindings/javahl/ ]
* native/SVNClient.h,
  native/SVNClient.cpp
  (revProperty): Return a jbyteArray.

* native/org_apache_subversion_javahl_SVNClient.cpp
  (Java_org_apache_subversion_javahl_SVNClient_revProperty):
    Return a byte array.

* src/org/tigris/subversion/javahl/SVNClient.java
  (revProperty): Rewrap the returned value as a PropertyData object.

* src/org/apache/subversion/javahl/SVNClient.java
  (revProperty): Return a byte[].

* src/org/apache/subversion/javahl/ISVNClient.java
  (revProperty): Same.

Modified:
    subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp
    subversion/trunk/subversion/bindings/javahl/native/SVNClient.h
    subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp
    subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java
    subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java
    subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java

Modified: subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp?rev=917702&r1=917701&r2=917702&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp Mon Mar  1 20:37:13 2010
@@ -1463,8 +1463,8 @@
     return read_stream;
 }
 
-jobject SVNClient::revProperty(jobject jthis, const char *path,
-                               const char *name, Revision &rev)
+jbyteArray SVNClient::revProperty(jobject jthis, const char *path,
+                                  const char *name, Revision &rev)
 {
     SVN::Pool requestPool;
     SVN_JNI_NULL_PTR_EX(path, "path", NULL);
@@ -1498,7 +1498,8 @@
     if (propval == NULL)
         return NULL;
 
-    return CreateJ::Property(jthis, path, name, propval);
+    return JNIUtil::makeJByteArray((const signed char *)propval->data,
+                                   propval->len);
 }
 void SVNClient::relocate(const char *from, const char *to, const char *path,
                          bool recurse)

Modified: subversion/trunk/subversion/bindings/javahl/native/SVNClient.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/SVNClient.h?rev=917702&r1=917701&r2=917702&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/SVNClient.h (original)
+++ subversion/trunk/subversion/bindings/javahl/native/SVNClient.h Mon Mar  1 20:37:13 2010
@@ -175,8 +175,8 @@
   void list(const char *url, Revision &revision, Revision &pegRevision,
             svn_depth_t depth, int direntFields, bool fetchLocks,
             ListCallback *callback);
-  jobject revProperty(jobject jthis, const char *path, const char *name,
-                      Revision &rev);
+  jbyteArray revProperty(jobject jthis, const char *path, const char *name,
+                         Revision &rev);
   void setRevProperty(jobject jthis, const char *path, const char *name,
                       Revision &rev, const char *value,
                       const char *original_value, bool force);

Modified: subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp?rev=917702&r1=917701&r2=917702&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp
(original)
+++ subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp
Mon Mar  1 20:37:13 2010
@@ -1020,7 +1020,7 @@
                   jforce ? true:false, revprops);
 }
 
-JNIEXPORT jobject JNICALL
+JNIEXPORT jbyteArray JNICALL
 Java_org_apache_subversion_javahl_SVNClient_revProperty
 (JNIEnv *env, jobject jthis, jstring jpath, jstring jname, jobject jrevision)
 {

Modified: subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java?rev=917702&r1=917701&r2=917702&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java
(original)
+++ subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java
Mon Mar  1 20:37:13 2010
@@ -720,7 +720,7 @@
      * @throws ClientException
      * @since 1.0
      */
-    PropertyData revProperty(String path, String name, Revision rev)
+    byte[] revProperty(String path, String name, Revision rev)
             throws ClientException;
 
     /**

Modified: subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java?rev=917702&r1=917701&r2=917702&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java
(original)
+++ subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java
Mon Mar  1 20:37:13 2010
@@ -647,8 +647,7 @@
     /**
      * @since 1.0
      */
-    public native PropertyData revProperty(String path, String name,
-                                           Revision rev)
+    public native byte[] revProperty(String path, String name, Revision rev)
             throws ClientException;
 
     /**

Modified: subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java?rev=917702&r1=917701&r2=917702&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java
(original)
+++ subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java
Mon Mar  1 20:37:13 2010
@@ -1902,8 +1902,9 @@
     {
         try
         {
-            return new PropertyData(aSVNClient.revProperty(path, name,
-                                         rev == null ? null : rev.toApache()));
+            return new PropertyData(path, name,
+                            new String(aSVNClient.revProperty(path, name,
+                                       rev == null ? null : rev.toApache())));
         }
         catch (org.apache.subversion.javahl.ClientException ex)
         {



Mime
View raw message