Author: brane
Date: Thu Jan 29 20:11:39 2015
New Revision: 1655842

URL: http://svn.apache.org/r1655842
Log:
Update JavaHL's ConflictDescriptor to the 1.9 API.

[in subversion/bindings/javahl]
* src/org/apache/subversion/javahl/ConflictDescriptor.java
  (ConflictDescriptor.propRejectAbspath,
   ConflictDescriptor.propValueBase,
   ConflictDescriptor.propValueWorking,
   ConflictDescriptor.propValueIncomingOld,
   ConflictDescriptor.propValueIncomingNew): New private fields.
  (ConflictDescriptor.ConflictDescriptor): New private constructor
   initializes these new fields. The old constructor is deprecated
   and forwards construction to the new one.
  (ConflictDescriptor.getPropRejectAbspath,
   ConflictDescriptor.getPropValueBase,
   ConflictDescriptor.getPropValueWorking,
   ConflictDescriptor.getPropValueIncomingOld,
   ConflictDescriptor.getPropValueIncomingNew): New accessor methods.

* javahl/native/CreateJ.cpp
  (CreateJ::ConflictDescriptor): Update implementation to call the
   new Java ConflictDescriptor constructor.

Modified:
    subversion/trunk/subversion/bindings/javahl/native/CreateJ.cpp
    
subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ConflictDescriptor.java

Modified: subversion/trunk/subversion/bindings/javahl/native/CreateJ.cpp
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/CreateJ.cpp?rev=1655842&r1=1655841&r2=1655842&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/CreateJ.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/CreateJ.cpp Thu Jan 29 
20:11:39 2015
@@ -71,7 +71,8 @@ CreateJ::ConflictDescriptor(const svn_wc
                               "Ljava/lang/String;Ljava/lang/String;"
                               "Ljava/lang/String;Ljava/lang/String;"
                               "L"JAVA_PACKAGE"/types/ConflictVersion;"
-                              "L"JAVA_PACKAGE"/types/ConflictVersion;)V");
+                              "L"JAVA_PACKAGE"/types/ConflictVersion;"
+                              "Ljava/lang/String;[B[B[B[B)V");
       if (JNIUtil::isJavaExceptionThrown() || ctor == 0)
         POP_AND_RETURN_NULL;
     }
@@ -118,6 +119,33 @@ CreateJ::ConflictDescriptor(const svn_wc
   jobject joperation = EnumMapper::mapOperation(desc->operation);
   if (JNIUtil::isJavaExceptionThrown())
     POP_AND_RETURN_NULL;
+  jstring jpropRejectAbspath = JNIUtil::makeJString(desc->prop_reject_abspath);
+  if (JNIUtil::isJavaExceptionThrown())
+    POP_AND_RETURN_NULL;
+  jbyteArray jpropValueBase = (
+      !desc->prop_value_base ? NULL
+      :JNIUtil::makeJByteArray(desc->prop_value_base->data,
+                               int(desc->prop_value_base->len)));
+  if (JNIUtil::isExceptionThrown())
+    POP_AND_RETURN_NULL;
+  jbyteArray jpropValueWorking = (
+      !desc->prop_value_working ? NULL
+      :JNIUtil::makeJByteArray(desc->prop_value_working->data,
+                               int(desc->prop_value_working->len)));
+  if (JNIUtil::isExceptionThrown())
+    POP_AND_RETURN_NULL;
+  jbyteArray jpropValueIncomingOld = (
+      !desc->prop_value_incoming_old ? NULL
+      :JNIUtil::makeJByteArray(desc->prop_value_incoming_old->data,
+                               int(desc->prop_value_incoming_old->len)));
+  if (JNIUtil::isExceptionThrown())
+    POP_AND_RETURN_NULL;
+  jbyteArray jpropValueIncomingNew = (
+      !desc->prop_value_incoming_new ? NULL
+      :JNIUtil::makeJByteArray(desc->prop_value_incoming_new->data,
+                               int(desc->prop_value_incoming_new->len)));
+  if (JNIUtil::isExceptionThrown())
+    POP_AND_RETURN_NULL;
 
   // Instantiate the conflict descriptor.
   jobject jdesc = env->NewObject(clazz, ctor, jpath, jconflictKind,
@@ -125,7 +153,10 @@ CreateJ::ConflictDescriptor(const svn_wc
                                  (jboolean) desc->is_binary, jmimeType,
                                  jconflictAction, jconflictReason, joperation,
                                  jbasePath, jreposPath, juserPath,
-                                 jmergedPath, jsrcLeft, jsrcRight);
+                                 jmergedPath, jsrcLeft, jsrcRight,
+                                 jpropRejectAbspath, jpropValueBase,
+                                 jpropValueWorking, jpropValueIncomingOld,
+                                 jpropValueIncomingNew);
   if (JNIUtil::isJavaExceptionThrown())
     POP_AND_RETURN_NULL;
 

Modified: 
subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ConflictDescriptor.java
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ConflictDescriptor.java?rev=1655842&r1=1655841&r2=1655842&view=diff
==============================================================================
--- 
subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ConflictDescriptor.java
 (original)
+++ 
subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ConflictDescriptor.java
 Thu Jan 29 20:11:39 2015
@@ -71,13 +71,26 @@ public class ConflictDescriptor
      */
     private ConflictVersion srcRightVersion;
 
-    /** This constructor should only be called from JNI code. */
-    public ConflictDescriptor(String path, Kind conflictKind, NodeKind 
nodeKind,
+    // Information about property conflicts. New in 1.9
+    private String propRejectAbspath;
+    private byte[] propValueBase;
+    private byte[] propValueWorking;
+    private byte[] propValueIncomingOld;
+    private byte[] propValueIncomingNew;
+
+
+    // Private constructor, only called from the JNI code.
+    private ConflictDescriptor(String path, Kind conflictKind, NodeKind 
nodeKind,
                        String propertyName, boolean isBinary, String mimeType,
                        Action action, Reason reason, Operation operation,
                        String basePath, String theirPath,
                        String myPath, String mergedPath,
-                       ConflictVersion srcLeft, ConflictVersion srcRight)
+                       ConflictVersion srcLeft, ConflictVersion srcRight,
+                       String propRejectAbspath, byte[] propValueBase,
+                       byte[] propValueWorking,
+                       byte[] propValueIncomingOld,
+                       byte[] propValueIncomingNew)
+
     {
         this.path = path;
         this.conflictKind = conflictKind;
@@ -94,6 +107,28 @@ public class ConflictDescriptor
         this.operation = operation;
         this.srcLeftVersion = srcLeft;
         this.srcRightVersion = srcRight;
+        this.propRejectAbspath = propRejectAbspath;
+        this.propValueBase = propValueBase;
+        this.propValueWorking = propValueWorking;
+        this.propValueIncomingOld = propValueIncomingOld;
+        this.propValueIncomingNew = propValueIncomingNew;
+    }
+
+    /**
+     * This constructor should only be called from JNI code.
+     * @deprecated
+     */
+    @Deprecated
+    public ConflictDescriptor(String path, Kind conflictKind, NodeKind 
nodeKind,
+                       String propertyName, boolean isBinary, String mimeType,
+                       Action action, Reason reason, Operation operation,
+                       String basePath, String theirPath,
+                       String myPath, String mergedPath,
+                       ConflictVersion srcLeft, ConflictVersion srcRight)
+    {
+        this(path, conflictKind, nodeKind, propertyName, isBinary, mimeType,
+             action, reason, operation, basePath, theirPath, myPath, 
mergedPath,
+             srcLeft, srcRight, null, null, null, null, null);
     }
 
     public String getPath()
@@ -171,6 +206,32 @@ public class ConflictDescriptor
         return srcRightVersion;
     }
 
+    public String getPropRejectAbspath()
+    {
+        return propRejectAbspath;
+    }
+
+    public byte[] getPropValueBase()
+    {
+        return propValueBase;
+    }
+
+    public byte[] getPropValueWorking()
+    {
+        return propValueWorking;
+    }
+
+    public byte[] getPropValueIncomingOld()
+    {
+        return propValueIncomingOld;
+    }
+
+    public byte[] getPropValueIncomingNew()
+    {
+        return propValueIncomingNew;
+    }
+
+
     /**
      * Rich man's enum for <code>svn_wc_conflict_kind_t</code>.
      */


Reply via email to