subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1539601 - in /subversion/trunk/subversion/bindings/javahl: native/CreateJ.cpp src/org/apache/subversion/javahl/ClientNotifyInformation.java
Date Thu, 07 Nov 2013 11:51:58 GMT
Author: brane
Date: Thu Nov  7 11:51:58 2013
New Revision: 1539601

URL: http://svn.apache.org/r1539601
Log:
Expose and use the 'url' member of svn_wc_notify_t in JavaHL.

[in subversion/bindings/javahl]
* src/org/apache/subversion/javahl/ClientNotifyInformation.java
  (ClientNotifyInformation.path, ClientNotifyInformation.url): New members.
  (ClientNotifyInformation.ClientNotifyInformation): Add url parameter
   and use it when initializing the superclass.
   Update version info in docstring.
   Remove the now-redundant protected constructor and add a backwards
   -compatilbe constructor.
  (ClientNotifyInformation.getNotifiedPath): New.
  ClientNotifyInformation.getUrl): New.

* native/CreateJ.cpp (CreateJ::ClientNotifyInformation):
   Update to new constructor signature.

Modified:
    subversion/trunk/subversion/bindings/javahl/native/CreateJ.cpp
    subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ClientNotifyInformation.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=1539601&r1=1539600&r2=1539601&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/CreateJ.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/CreateJ.cpp Thu Nov  7 11:51:58 2013
@@ -784,6 +784,7 @@ CreateJ::ClientNotifyInformation(const s
                                "L"JAVA_PACKAGE"/ClientNotifyInformation$LockStatus;"
                                "JLjava/lang/String;"
                                "L"JAVA_PACKAGE"/types/RevisionRange;"
+                               "Ljava/lang/String;"
                                "Ljava/lang/String;Ljava/lang/String;"
                                "Ljava/util/Map;JJJJJJI)V");
       if (JNIUtil::isJavaExceptionThrown() || midCT == 0)
@@ -841,6 +842,10 @@ CreateJ::ClientNotifyInformation(const s
         POP_AND_RETURN_NULL;
     }
 
+  jstring jUrl = JNIUtil::makeJString(wcNotify->url);
+  if (JNIUtil::isJavaExceptionThrown())
+    POP_AND_RETURN_NULL;
+
   jstring jpathPrefix = JNIUtil::makeJString(wcNotify->path_prefix);
   if (JNIUtil::isJavaExceptionThrown())
     POP_AND_RETURN_NULL;
@@ -872,7 +877,7 @@ CreateJ::ClientNotifyInformation(const s
                                  jKind, jMimeType, jLock, jErr, jErrStack,
                                  jContentState, jPropState, jLockState,
                                  (jlong) wcNotify->revision, jChangelistName,
-                                 jMergeRange, jpathPrefix, jpropName,
+                                 jMergeRange, jUrl, jpathPrefix, jpropName,
                                  jrevProps, joldRevision,
                                  jhunkOriginalStart, jhunkOriginalLength,
                                  jhunkModifiedStart, jhunkModifiedLength,

Modified: subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ClientNotifyInformation.java
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ClientNotifyInformation.java?rev=1539601&r1=1539600&r2=1539601&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ClientNotifyInformation.java
(original)
+++ subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ClientNotifyInformation.java
Thu Nov  7 11:51:58 2013
@@ -46,6 +46,14 @@ public class ClientNotifyInformation ext
     private static final long serialVersionUID = 2L;
 
     /**
+     * Path, either absolute or relative to the current working
+     * directory (i.e., not relative to an anchor). <code>path</code>
+     * is <code>null</vode> when the real target is an URL that is
+     * available in {@link #url}.
+     */
+    private String path;
+
+    /**
      * The {@link Action} which triggered this event.
      */
     private Action action;
@@ -107,6 +115,12 @@ public class ClientNotifyInformation ext
     private RevisionRange mergeRange;
 
     /**
+     * Similar to {@link #path}, but when not <code>null</code>, the
+     * notification is about a UR>.
+     */
+    private String url;
+
+    /**
      * A common absolute path prefix that can be subtracted from .path.
      */
     private String pathPrefix;
@@ -147,31 +161,35 @@ public class ClientNotifyInformation ext
      * @param changelistName The name of the changelist.
      * @param mergeRange The range of the merge just beginning to occur.
      * @param pathPrefix A common path prefix.
+     * @since 1.9
      */
     public ClientNotifyInformation(String path, Action action, NodeKind kind,
                              String mimeType, Lock lock, String errMsg,
+                             List<ClientException.ErrorMessage> errMsgStack,
                              Status contentState, Status propState,
                              LockStatus lockState, long revision,
                              String changelistName, RevisionRange mergeRange,
-                             String pathPrefix, String propName,
+                             String url, String pathPrefix, String propName,
                              Map<String, String> revProps, long oldRevision,
                              long hunkOriginalStart, long hunkOriginalLength,
                              long hunkModifiedStart, long hunkModifiedLength,
                              long hunkMatchedLine, int hunkFuzz)
     {
-        super(path == null ? "" : path);
+        super(path != null ? path : (url != null ? url : ""));
+        this.path = path;
         this.action = action;
         this.kind = kind;
         this.mimeType = mimeType;
         this.lock = lock;
         this.errMsg = errMsg;
-        this.errMsgStack = null;
+        this.errMsgStack = errMsgStack;
         this.contentState = contentState;
         this.propState = propState;
         this.lockState = lockState;
         this.revision = revision;
         this.changelistName = changelistName;
         this.mergeRange = mergeRange;
+        this.url = url;
         this.pathPrefix = pathPrefix;
         this.propName = propName;
         this.revProps = revProps;
@@ -185,14 +203,11 @@ public class ClientNotifyInformation ext
     }
 
     /**
-     * This constructor will be called only by the native code.
-     *
-     * In addition to all the other parameters, sets the detailed
-     * message stack.
+     * @deprecated Constructor compatible with teh 1.8 API; uses
+     * <code>null</code> URL and errMsgStack values.
      */
-    protected ClientNotifyInformation(String path, Action action, NodeKind kind,
+    public ClientNotifyInformation(String path, Action action, NodeKind kind,
                              String mimeType, Lock lock, String errMsg,
-                             List<ClientException.ErrorMessage> errMsgStack,
                              Status contentState, Status propState,
                              LockStatus lockState, long revision,
                              String changelistName, RevisionRange mergeRange,
@@ -202,18 +217,18 @@ public class ClientNotifyInformation ext
                              long hunkModifiedStart, long hunkModifiedLength,
                              long hunkMatchedLine, int hunkFuzz)
     {
-        this(path, action, kind, mimeType, lock, errMsg,
+        this(path, action, kind, mimeType, lock, errMsg, null,
              contentState, propState, lockState, revision,
-             changelistName, mergeRange, pathPrefix, propName,
-             revProps, oldRevision,
+             changelistName, mergeRange, null, pathPrefix,
+             propName, revProps, oldRevision,
              hunkOriginalStart, hunkOriginalLength,
              hunkModifiedStart, hunkModifiedLength,
              hunkMatchedLine, hunkFuzz);
-        this.errMsgStack = errMsgStack;
     }
 
     /**
      * @return The path of the item, which is the source of the event.
+     *         This may actually be a URL.
      */
     public String getPath()
     {
@@ -221,6 +236,15 @@ public class ClientNotifyInformation ext
     }
 
     /**
+     * @return {@link #path}, which may be <code>null</code>.
+     * @since 1.9
+     */
+    public String getNotifiedPath()
+    {
+        return this.path;
+    }
+
+    /**
      * @return The {@link Action} which triggered this event.
      */
     public Action getAction()
@@ -317,6 +341,15 @@ public class ClientNotifyInformation ext
     }
 
     /**
+     * @return {@link #url}, which may be <code>null</code>
+     * @since 1.9
+     */
+    public String getUrl()
+    {
+        return this.url;
+    }
+
+    /**
      * @return The common absolute path prefix.
      */
     public String getPathPrefix()



Mime
View raw message