subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1687045 [4/31] - in /subversion/branches/svn-mergeinfo-normalizer: ./ build/ build/ac-macros/ build/generator/ build/generator/templates/ doc/ subversion/bindings/javahl/ subversion/bindings/javahl/native/ subversion/bindings/javahl/native...
Date Tue, 23 Jun 2015 12:55:47 GMT
Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/JNIUtil.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/JNIUtil.h?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/JNIUtil.h (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/JNIUtil.h Tue Jun 23 12:55:43 2015
@@ -38,13 +38,28 @@ class SVNBase;
 #include <apr_time.h>
 #include <string>
 #include <vector>
+
 struct svn_error_t;
+struct svn_string_t;
 
 #include "svn_error.h"
 
-#define JAVA_PACKAGE "org/apache/subversion/javahl"
 
-struct svn_string_t;
+/**
+ * The name of the package in which the JavaHL classes are defined.
+ */
+#define JAVAHL_PACKAGE "org/apache/subversion/javahl"
+
+/**
+ * Construct a JavaHL class name for JNIEnv::FindClass.
+ */
+#define JAVAHL_CLASS(name) JAVAHL_PACKAGE name
+
+/**
+ * Construct a JavaHL class parameter name for JNIEnv::GetMethodID & co.
+ */
+#define JAVAHL_ARG(name) "L" JAVAHL_PACKAGE name
+
 
 /**
  * Class to hold a number of JNI related utility methods.  No Objects
@@ -86,6 +101,9 @@ class JNIUtil
       return getEnv()->ExceptionCheck();
     }
 
+  static svn_error_t *wrapJavaException();
+  static jthrowable unwrapJavaException(const svn_error_t *err);
+
   static void handleAPRError(int error, const char *op);
 
   /**
@@ -143,7 +161,7 @@ class JNIUtil
    */
   static void throwError(const char *message)
     {
-      raiseThrowable(JAVA_PACKAGE"/JNIError", message);
+      raiseThrowable(JAVAHL_CLASS("/JNIError"), message);
     }
 
   static apr_pool_t *getPool();
@@ -265,6 +283,16 @@ class JNIUtil
     }                                   \
   while (0)
 
+#define POP_AND_RETURN_EXCEPTION_AS_SVNERROR()                            \
+  do                                                                      \
+    {                                                                     \
+      svn_error_t *svn__err_for_exception = JNIUtil::wrapJavaException(); \
+                                                                          \
+      env->PopLocalFrame(NULL);                                           \
+      return svn__err_for_exception;                                      \
+    }                                                                     \
+  while (0)
+
 
 /**
  * A useful macro.

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/ListCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/ListCallback.cpp?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/ListCallback.cpp (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/ListCallback.cpp Tue Jun 23 12:55:43 2015
@@ -87,13 +87,13 @@ ListCallback::doList(const char *path,
   static jmethodID mid = 0;
   if (mid == 0)
     {
-      jclass clazz = env->FindClass(JAVA_PACKAGE"/callback/ListCallback");
+      jclass clazz = env->FindClass(JAVAHL_CLASS("/callback/ListCallback"));
       if (JNIUtil::isJavaExceptionThrown())
         POP_AND_RETURN(SVN_NO_ERROR);
 
       mid = env->GetMethodID(clazz, "doEntry",
-                             "(L"JAVA_PACKAGE"/types/DirEntry;"
-                             "L"JAVA_PACKAGE"/types/Lock;)V");
+                             "(" JAVAHL_ARG("/types/DirEntry;")
+                             JAVAHL_ARG("/types/Lock;") ")V");
       if (JNIUtil::isJavaExceptionThrown() || mid == 0)
         POP_AND_RETURN(SVN_NO_ERROR);
     }
@@ -113,10 +113,8 @@ ListCallback::doList(const char *path,
 
   // call the Java method
   env->CallVoidMethod(m_callback, mid, jdirentry, jlock);
-  // No need to check for exception here, because we'll just return anyway
 
-  env->PopLocalFrame(NULL);
-  return SVN_NO_ERROR;
+  POP_AND_RETURN_EXCEPTION_AS_SVNERROR();
 }
 
 /**

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/LockTokenTable.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/LockTokenTable.cpp?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/LockTokenTable.cpp (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/LockTokenTable.cpp Tue Jun 23 12:55:43 2015
@@ -64,7 +64,7 @@ LockTokenTable::LockTokenTable(jobject j
     {
       JNIEnv *env = JNIUtil::getEnv();
 
-      jclass lock_cls = env->FindClass(JAVA_PACKAGE"/types/Lock");
+      jclass lock_cls = env->FindClass(JAVAHL_CLASS("/types/Lock"));
       if (JNIUtil::isExceptionThrown())
         return;
 

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/LogMessageCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/LogMessageCallback.cpp?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/LogMessageCallback.cpp (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/LogMessageCallback.cpp Tue Jun 23 12:55:43 2015
@@ -81,7 +81,7 @@ LogMessageCallback::singleMessage(svn_lo
   static jmethodID sm_mid = 0;
   if (sm_mid == 0)
     {
-      jclass clazz = env->FindClass(JAVA_PACKAGE"/callback/LogMessageCallback");
+      jclass clazz = env->FindClass(JAVAHL_CLASS("/callback/LogMessageCallback"));
       if (JNIUtil::isJavaExceptionThrown())
         POP_AND_RETURN(SVN_NO_ERROR);
 
@@ -125,8 +125,6 @@ LogMessageCallback::singleMessage(svn_lo
                       (jlong)log_entry->revision,
                       jrevprops,
                       (jboolean)log_entry->has_children);
-  // No need to check for an exception here, because we return anyway.
 
-  env->PopLocalFrame(NULL);
-  return SVN_NO_ERROR;
+  POP_AND_RETURN_EXCEPTION_AS_SVNERROR();
 }

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/MessageReceiver.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/MessageReceiver.cpp?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/MessageReceiver.cpp (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/MessageReceiver.cpp Tue Jun 23 12:55:43 2015
@@ -58,7 +58,7 @@ void MessageReceiver::receiveMessage(con
   static jmethodID mid = 0;
   if (mid == 0)
     {
-      jclass clazz = env->FindClass(JAVA_PACKAGE"/ISVNAdmin$MessageReceiver");
+      jclass clazz = env->FindClass(JAVAHL_CLASS("/ISVNAdmin$MessageReceiver"));
       if (JNIUtil::isJavaExceptionThrown())
         return;
 

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/NativeStream.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/NativeStream.cpp?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/NativeStream.cpp (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/NativeStream.cpp Tue Jun 23 12:55:43 2015
@@ -33,7 +33,7 @@ namespace JavaHL {
 // Class JavaHL::NativeInputStream
 
 const char* const NativeInputStream::m_class_name =
-    JAVA_PACKAGE "/types/NativeInputStream";
+    JAVAHL_CLASS("/types/NativeInputStream");
 
 NativeInputStream::~NativeInputStream() {}
 
@@ -45,16 +45,23 @@ void NativeInputStream::set_stream(svn_s
 }
 
 NativeInputStream*
-NativeInputStream::get_self(::Java::Env env, jobject jthis)
+NativeInputStream::get_self_unsafe(::Java::Env env, jobject jthis)
 {
   jfieldID fid_cppaddr = NULL;
   const jlong cppaddr =
     findCppAddrForJObject(jthis, &fid_cppaddr, m_class_name);
-  if (!cppaddr)
-    ::Java::NullPointerException(env).raise(_("this [C++]"));
   return reinterpret_cast<NativeInputStream*>(cppaddr);
 }
 
+NativeInputStream*
+NativeInputStream::get_self(::Java::Env env, jobject jthis)
+{
+  NativeInputStream* self = get_self_unsafe(env, jthis);
+  if (!self)
+    ::Java::NullPointerException(env).raise(_("this [C++]"));
+  return self;
+}
+
 void NativeInputStream::close(::Java::Env env, jobject jthis)
 {
   SVN_JAVAHL_CHECK(env, svn_stream_close(m_stream));
@@ -137,7 +144,7 @@ void NativeInputStream::dispose(jobject
 // Class JavaHL::NativeOutputStream
 
 const char* const NativeOutputStream::m_class_name =
-  JAVA_PACKAGE "/types/NativeOutputStream";
+  JAVAHL_CLASS("/types/NativeOutputStream");
 
 NativeOutputStream::~NativeOutputStream() {}
 
@@ -149,16 +156,23 @@ void NativeOutputStream::set_stream(svn_
 }
 
 NativeOutputStream*
-NativeOutputStream::get_self(::Java::Env env, jobject jthis)
+NativeOutputStream::get_self_unsafe(::Java::Env env, jobject jthis)
 {
   jfieldID fid_cppaddr = NULL;
   const jlong cppaddr =
     findCppAddrForJObject(jthis, &fid_cppaddr, m_class_name);
-  if (!cppaddr)
-    ::Java::NullPointerException(env).raise(_("this [C++]"));
   return reinterpret_cast<NativeOutputStream*>(cppaddr);
 }
 
+NativeOutputStream*
+NativeOutputStream::get_self(::Java::Env env, jobject jthis)
+{
+  NativeOutputStream* self = get_self_unsafe(env, jthis);
+  if (!self)
+    ::Java::NullPointerException(env).raise(_("this [C++]"));
+  return self;
+}
+
 void NativeOutputStream::close(::Java::Env env, jobject jthis)
 {
   SVN_JAVAHL_CHECK(env, svn_stream_close(m_stream));
@@ -294,6 +308,20 @@ Java_org_apache_subversion_javahl_types_
   return 0;
 }
 
+JNIEXPORT void JNICALL
+Java_org_apache_subversion_javahl_types_NativeInputStream_finalize(
+    JNIEnv* jenv, jobject jthis)
+{
+  SVN_JAVAHL_JNI_TRY(NativeInputStream, finalize)
+    {
+      JavaHL::NativeInputStream* native =
+        JavaHL::NativeInputStream::get_self_unsafe(Java::Env(jenv), jthis);
+      if (native != NULL)
+          native->finalize();
+    }
+  SVN_JAVAHL_JNI_CATCH;
+}
+
 
 // Class JavaHL::NativeOutputStream native method implementation
 #include "../include/org_apache_subversion_javahl_types_NativeOutputStream.h"
@@ -337,3 +365,17 @@ Java_org_apache_subversion_javahl_types_
     }
   SVN_JAVAHL_JNI_CATCH_TO_EXCEPTION(Java::IOException);
 }
+
+JNIEXPORT void JNICALL
+Java_org_apache_subversion_javahl_types_NativeOutputStream_finalize(
+    JNIEnv* jenv, jobject jthis)
+{
+  SVN_JAVAHL_JNI_TRY(NativeOutputStream, finalize)
+    {
+      JavaHL::NativeOutputStream* native =
+        JavaHL::NativeOutputStream::get_self_unsafe(Java::Env(jenv), jthis);
+      if (native != NULL)
+          native->finalize();
+    }
+  SVN_JAVAHL_JNI_CATCH;
+}

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/NativeStream.hpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/NativeStream.hpp?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/NativeStream.hpp (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/NativeStream.hpp Tue Jun 23 12:55:43 2015
@@ -81,6 +81,8 @@ public:
    */
   static NativeInputStream* get_self(::Java::Env env, jobject jthis);
 
+  static NativeInputStream* get_self_unsafe(::Java::Env env, jobject jthis);
+
 public:
   /**
    * Implements @c InputStream.close().
@@ -176,6 +178,8 @@ public:
    */
   static NativeOutputStream* get_self(::Java::Env env, jobject jthis);
 
+  static NativeOutputStream* get_self_unsafe(::Java::Env env, jobject jthis);
+
 public:
   /**
    * Implements @c OutputStream.close().

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/OperationContext.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/OperationContext.cpp?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/OperationContext.cpp (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/OperationContext.cpp Tue Jun 23 12:55:43 2015
@@ -358,6 +358,9 @@ OperationContext::checkCancel(void *canc
   OperationContext *that = static_cast<OperationContext *>(cancelBaton);
   if (that->isCancelledOperation())
     return svn_error_create(SVN_ERR_CANCELLED, NULL, _("Operation cancelled"));
+  else if (JNIUtil::isJavaExceptionThrown())
+    return svn_error_create(SVN_ERR_CANCELLED, JNIUtil::wrapJavaException(),
+                            _("Operation cancelled"));
   else
     return SVN_NO_ERROR;
 }
@@ -385,13 +388,13 @@ OperationContext::progress(apr_off_t pro
         POP_AND_RETURN_NOTHING();
 
       mid = env->GetMethodID(clazz, "onProgress",
-          "(L"JAVA_PACKAGE"/ProgressEvent;)V");
+                             "(" JAVAHL_ARG("/ProgressEvent;") ")V");
       if (JNIUtil::isJavaExceptionThrown() || mid == 0)
         POP_AND_RETURN_NOTHING();
     }
 
   static jmethodID midCT = 0;
-  jclass clazz = env->FindClass(JAVA_PACKAGE"/ProgressEvent");
+  jclass clazz = env->FindClass(JAVAHL_CLASS("/ProgressEvent"));
   if (JNIUtil::isJavaExceptionThrown())
     POP_AND_RETURN_NOTHING();
 
@@ -440,16 +443,16 @@ OperationContext::notifyConfigLoad()
   static jmethodID onload_mid = 0;
   if (0 == onload_mid)
     {
-      jclass cls = env->FindClass(JAVA_PACKAGE"/callback/ConfigEvent");
+      jclass cls = env->FindClass(JAVAHL_CLASS("/callback/ConfigEvent"));
       if (JNIUtil::isJavaExceptionThrown())
         return;
       onload_mid = env->GetMethodID(cls, "onLoad",
-                                    "(L"JAVA_PACKAGE"/ISVNConfig;)V");
+                                    "(" JAVAHL_ARG("/ISVNConfig;") ")V");
       if (JNIUtil::isJavaExceptionThrown())
         return;
     }
 
-  jclass cfg_cls = env->FindClass(JAVA_PACKAGE"/util/ConfigImpl");
+  jclass cfg_cls = env->FindClass(JAVAHL_CLASS("/util/ConfigImpl"));
   if (JNIUtil::isJavaExceptionThrown())
     return;
 
@@ -525,11 +528,11 @@ jobject create_Channel(const char *class
 
 jobject create_RequestChannel(JNIEnv *env, apr_file_t *fd)
 {
-  return create_Channel(JAVA_PACKAGE"/util/RequestChannel", env, fd);
+  return create_Channel(JAVAHL_CLASS("/util/RequestChannel"), env, fd);
 }
 jobject create_ResponseChannel(JNIEnv *env, apr_file_t *fd)
 {
-  return create_Channel(JAVA_PACKAGE"/util/ResponseChannel", env, fd);
+  return create_Channel(JAVAHL_CLASS("/util/ResponseChannel"), env, fd);
 }
 } // anonymous namespace
 
@@ -545,7 +548,7 @@ OperationContext::checkTunnel(void *tunn
   static jmethodID mid = 0;
   if (0 == mid)
     {
-      jclass cls = env->FindClass(JAVA_PACKAGE"/callback/TunnelAgent");
+      jclass cls = env->FindClass(JAVAHL_CLASS("/callback/TunnelAgent"));
       if (JNIUtil::isJavaExceptionThrown())
         return false;
       mid = env->GetMethodID(cls, "checkTunnel",
@@ -605,7 +608,7 @@ OperationContext::openTunnel(svn_stream_
   static jmethodID mid = 0;
   if (0 == mid)
     {
-      jclass cls = env->FindClass(JAVA_PACKAGE"/callback/TunnelAgent");
+      jclass cls = env->FindClass(JAVAHL_CLASS("/callback/TunnelAgent"));
       SVN_JNI_CATCH(, SVN_ERR_BASE);
       SVN_JNI_CATCH(
           mid = env->GetMethodID(
@@ -615,7 +618,7 @@ OperationContext::openTunnel(svn_stream_
               "Ljava/lang/String;"
               "Ljava/lang/String;"
               "Ljava/lang/String;I)"
-              "L"JAVA_PACKAGE"/callback/TunnelAgent$CloseTunnelCallback;"),
+              JAVAHL_ARG("/callback/TunnelAgent$CloseTunnelCallback;")),
           SVN_ERR_BASE);
     }
 
@@ -647,7 +650,7 @@ OperationContext::closeTunnel(void *tunn
       jclass cls;
       SVN_JNI_CATCH_VOID(
           cls= env->FindClass(
-              JAVA_PACKAGE"/callback/TunnelAgent$CloseTunnelCallback"));
+              JAVAHL_CLASS("/callback/TunnelAgent$CloseTunnelCallback")));
       SVN_JNI_CATCH_VOID(mid = env->GetMethodID(cls, "closeTunnel", "()V"));
     }
   SVN_JNI_CATCH_VOID(env->CallVoidMethod(jclosecb, mid));

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/PatchCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/PatchCallback.cpp?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/PatchCallback.cpp (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/PatchCallback.cpp Tue Jun 23 12:55:43 2015
@@ -80,7 +80,7 @@ PatchCallback::singlePatch(svn_boolean_t
   static jmethodID mid = 0;
   if (mid == 0)
     {
-      jclass clazz = env->FindClass(JAVA_PACKAGE"/callback/PatchCallback");
+      jclass clazz = env->FindClass(JAVAHL_CLASS("/callback/PatchCallback"));
       if (JNIUtil::isJavaExceptionThrown())
         POP_AND_RETURN(SVN_NO_ERROR);
 
@@ -106,7 +106,7 @@ PatchCallback::singlePatch(svn_boolean_t
   jboolean jfiltered = env->CallBooleanMethod(m_callback, mid, jcanonPath,
                                               jpatchAbsPath, jrejectAbsPath);
   if (JNIUtil::isJavaExceptionThrown())
-    POP_AND_RETURN(SVN_NO_ERROR);
+    POP_AND_RETURN_EXCEPTION_AS_SVNERROR();
 
   *filtered = (jfiltered ? TRUE : FALSE);
 

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/PropertyTable.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/PropertyTable.cpp?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/PropertyTable.cpp (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/PropertyTable.cpp Tue Jun 23 12:55:43 2015
@@ -58,7 +58,7 @@ apr_hash_t *PropertyTable::hash(const SV
           const char *msg = apr_psprintf(pool.getPool(),
                                          "Invalid property name: '%s'",
                                          propname);
-          JNIUtil::throwNativeException(JAVA_PACKAGE "/ClientException", msg,
+          JNIUtil::throwNativeException(JAVAHL_CLASS("/ClientException"), msg,
                                         NULL, SVN_ERR_CLIENT_PROPERTY_NAME);
           return NULL;
         }

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/ProplistCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/ProplistCallback.cpp?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/ProplistCallback.cpp (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/ProplistCallback.cpp Tue Jun 23 12:55:43 2015
@@ -89,7 +89,7 @@ svn_error_t *ProplistCallback::singlePat
   static volatile jmethodID mid = 0;
   if (mid == 0)
     {
-      jclass clazz = env->FindClass(JAVA_PACKAGE"/callback/ProplistCallback");
+      jclass clazz = env->FindClass(JAVAHL_CLASS("/callback/ProplistCallback"));
       if (JNIUtil::isJavaExceptionThrown())
         return SVN_NO_ERROR;
 
@@ -112,9 +112,7 @@ svn_error_t *ProplistCallback::singlePat
   env->CallVoidMethod(m_callback, mid, jpath, jmap);
   // We return whether an exception was thrown or not.
 
-  env->PopLocalFrame(NULL);
-
-  return SVN_NO_ERROR;
+  POP_AND_RETURN_EXCEPTION_AS_SVNERROR();
 }
 
 
@@ -144,7 +142,7 @@ svn_error_t *ProplistCallback::singlePat
   static jmethodID mid = 0;
   if (mid == 0)
     {
-      jclass clazz = env->FindClass(JAVA_PACKAGE"/callback/InheritedProplistCallback");
+      jclass clazz = env->FindClass(JAVAHL_CLASS("/callback/InheritedProplistCallback"));
       if (JNIUtil::isJavaExceptionThrown())
         return SVN_NO_ERROR;
 

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/RemoteSession.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/RemoteSession.cpp?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/RemoteSession.cpp (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/RemoteSession.cpp Tue Jun 23 12:55:43 2015
@@ -52,7 +52,7 @@
 #include <apr_strings.h>
 #include "svn_private_config.h"
 
-#define JAVA_CLASS_REMOTE_SESSION JAVA_PACKAGE "/remote/RemoteSession"
+#define JAVA_CLASS_REMOTE_SESSION JAVAHL_CLASS("/remote/RemoteSession")
 
 RemoteSession *
 RemoteSession::getCppObject(jobject jthis)
@@ -214,6 +214,8 @@ RemoteSession::RemoteSession(int retryAt
           cycle_detected = true;
           break;
         }
+      /* ### Shouldn't url be updated for the next attempt?
+         ### There is no real cycle if we just do the same thing twice? */
     }
 
   if (cycle_detected)
@@ -226,7 +228,7 @@ RemoteSession::RemoteSession(int retryAt
                        corrected_url));
 
       jclass excls = env->FindClass(
-          JAVA_PACKAGE "/SubversionException");
+          JAVAHL_CLASS("/SubversionException"));
       if (JNIUtil::isJavaExceptionThrown())
         return;
 
@@ -256,7 +258,7 @@ RemoteSession::RemoteSession(int retryAt
         return;
 
       jclass excls = env->FindClass(
-          JAVA_PACKAGE "/remote/RetryOpenSession");
+          JAVAHL_CLASS("/remote/RetryOpenSession"));
       if (JNIUtil::isJavaExceptionThrown())
         return;
 
@@ -542,7 +544,7 @@ void fill_dirents(const char* base_url,
   static jfieldID path_fid = 0;
   if (path_fid == 0)
     {
-      jclass clazz = env->FindClass(JAVA_PACKAGE "/types/DirEntry");
+      jclass clazz = env->FindClass(JAVAHL_CLASS("/types/DirEntry"));
       if (JNIUtil::isJavaExceptionThrown())
         POP_AND_RETURN_NOTHING();
 
@@ -833,7 +835,7 @@ RemoteSession::status(jobject jthis, jst
   proxy_callbacks.m_extra_baton.baton = &rp->m_target_revision;
 
   apr_pool_t* report_pool = rp->get_report_pool();
-  std::auto_ptr<EditorProxy> editor(
+  EditorProxy::UniquePtr editor(
       new EditorProxy(jstatus_editor, report_pool,
                       repos_root_url, base_relpath,
                       m_context->checkCancel, m_context,
@@ -851,7 +853,7 @@ RemoteSession::status(jobject jthis, jst
                                 editor->delta_editor(),
                                 editor->delta_baton(),
                                 report_pool),);
-  rp->set_reporter_data(raw_reporter, report_baton, editor.release());
+  rp->set_reporter_data(raw_reporter, report_baton, editor);
 }
 
 // TODO: diff
@@ -877,8 +879,10 @@ RemoteSession::getLog(jobject jpaths,
                                                        true, subPool);
   if (JNIUtil::isJavaExceptionThrown())
     return;
-  const apr_array_header_t* revprops = build_string_array(revpropiter,
-                                                          false, subPool);
+  const apr_array_header_t* revprops = (jrevprops != NULL)
+                                        ? build_string_array(revpropiter,
+                                                             false, subPool)
+                                        : NULL;
   if (JNIUtil::isJavaExceptionThrown())
     return;
 
@@ -1087,7 +1091,7 @@ public:
         return;
 
       m_call_mid = env->GetMethodID(
-          cls, "doSegment", "(L"JAVA_PACKAGE"/ISVNRemote$LocationSegment;)V");
+          cls, "doSegment", "(" JAVAHL_ARG("/ISVNRemote$LocationSegment;") ")V");
       if (JNIUtil::isJavaExceptionThrown())
         return;
     }
@@ -1096,7 +1100,7 @@ private:
   void call(svn_location_segment_t* segment)
     {
       JNIEnv* env = JNIUtil::getEnv();
-      jclass cls = env->FindClass(JAVA_PACKAGE"/ISVNRemote$LocationSegment");
+      jclass cls = env->FindClass(JAVAHL_CLASS("/ISVNRemote$LocationSegment"));
       if (JNIUtil::isJavaExceptionThrown())
         return;
 
@@ -1191,7 +1195,7 @@ public:
         return;
 
       m_call_mid = env->GetMethodID(
-          cls, "doRevision", "(L"JAVA_PACKAGE"/ISVNRemote$FileRevision;)V");
+          cls, "doRevision", "(" JAVAHL_ARG("/ISVNRemote$FileRevision;") ")V");
       if (JNIUtil::isJavaExceptionThrown())
         return;
     }
@@ -1205,7 +1209,7 @@ private:
            apr_pool_t* scratch_pool)
     {
       JNIEnv* env = JNIUtil::getEnv();
-      jclass cls = env->FindClass(JAVA_PACKAGE"/ISVNRemote$FileRevision");
+      jclass cls = env->FindClass(JAVAHL_CLASS("/ISVNRemote$FileRevision"));
       if (JNIUtil::isJavaExceptionThrown())
         return;
 

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/RemoteSession.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/RemoteSession.h?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/RemoteSession.h (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/RemoteSession.h Tue Jun 23 12:55:43 2015
@@ -56,7 +56,7 @@ class RemoteSession : public SVNBase
                         const char* username, const char* password,
                         Prompter::UniquePtr prompter, jobject jprogress,
                         jobject jcfgcb, jobject jtunnelcb);
-    ~RemoteSession();
+    virtual ~RemoteSession();
 
     void cancelOperation() const { m_context->cancelOperation(); }
 
@@ -102,7 +102,6 @@ class RemoteSession : public SVNBase
                           jlong jstart_revision, jlong jend_revision,
                           jboolean jinclude_merged_revisions,
                           jobject jcallback);
-    // TODO: getFileRevisions
     // TODO: lock
     // TODO: unlock
     // TODO: getLock

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/RemoteSessionContext.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/RemoteSessionContext.cpp?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/RemoteSessionContext.cpp (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/RemoteSessionContext.cpp Tue Jun 23 12:55:43 2015
@@ -90,7 +90,7 @@ void RemoteSessionContext::activate(jobj
    */
   static jfieldID ctxFieldID = 0;
   attachJavaObject(jremoteSession,
-      "L"JAVA_PACKAGE"/remote/RemoteSession$RemoteSessionContext;",
+      JAVAHL_ARG("/remote/RemoteSession$RemoteSessionContext;"),
       "sessionContext", &ctxFieldID);
 
   /*
@@ -104,7 +104,7 @@ void RemoteSessionContext::activate(jobj
 
   jmethodID mid = env->GetMethodID(
       clazz, "setProgressCallback",
-      "(L"JAVA_PACKAGE"/callback/ProgressCallback;)V");
+      "(" JAVAHL_ARG("/callback/ProgressCallback;") ")V");
   if (JNIUtil::isJavaExceptionThrown() || mid == 0)
     return;
 

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/ReposFreezeAction.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/ReposFreezeAction.cpp?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/ReposFreezeAction.cpp (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/ReposFreezeAction.cpp Tue Jun 23 12:55:43 2015
@@ -20,7 +20,7 @@
  * ====================================================================
  * @endcopyright
  *
- * @file ReposFreezeAction.h
+ * @file ReposFreezeAction.cpp
  * @brief Native mirror of the ReposFreezeAction callback interface
  */
 
@@ -39,7 +39,7 @@ svn_error_t* ReposFreezeAction::invoke()
   static volatile jmethodID mid = 0;
   if (!mid)
     {
-      jclass cls = env->FindClass(JAVA_PACKAGE"/callback/ReposFreezeAction");
+      jclass cls = env->FindClass(JAVAHL_CLASS("/callback/ReposFreezeAction"));
       if (!JNIUtil::isJavaExceptionThrown())
         mid = env->GetMethodID(cls, "invoke", "()V");
     }

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/ReposNotifyCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/ReposNotifyCallback.cpp?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/ReposNotifyCallback.cpp (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/ReposNotifyCallback.cpp Tue Jun 23 12:55:43 2015
@@ -69,12 +69,12 @@ ReposNotifyCallback::onNotify(const svn_
   static jmethodID mid = 0;
   if (mid == 0)
     {
-      jclass clazz = env->FindClass(JAVA_PACKAGE"/callback/ReposNotifyCallback");
+      jclass clazz = env->FindClass(JAVAHL_CLASS("/callback/ReposNotifyCallback"));
       if (JNIUtil::isJavaExceptionThrown())
         return;
 
       mid = env->GetMethodID(clazz, "onNotify",
-                             "(L"JAVA_PACKAGE"/ReposNotifyInformation;)V");
+                             "(" JAVAHL_ARG("/ReposNotifyInformation;") ")V");
       if (JNIUtil::isJavaExceptionThrown() || mid == 0)
         return;
 

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/Revision.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/Revision.cpp?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/Revision.cpp (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/Revision.cpp Tue Jun 23 12:55:43 2015
@@ -57,12 +57,12 @@ Revision::Revision(jobject jthis, bool h
       static jfieldID fid = 0;
       if (fid == 0)
         {
-          jclass clazz = env->FindClass(JAVA_PACKAGE"/types/Revision");
+          jclass clazz = env->FindClass(JAVAHL_CLASS("/types/Revision"));
           if (JNIUtil::isJavaExceptionThrown())
             POP_AND_RETURN_NOTHING();
 
           fid = env->GetFieldID(clazz, "revKind",
-                                "L"JAVA_PACKAGE"/types/Revision$Kind;");
+                                JAVAHL_ARG("/types/Revision$Kind;"));
           if (JNIUtil::isJavaExceptionThrown())
             POP_AND_RETURN_NOTHING();
         }
@@ -81,7 +81,7 @@ Revision::Revision(jobject jthis, bool h
             if (fidNum == 0)
               {
                 jclass clazz =
-                  env->FindClass(JAVA_PACKAGE"/types/Revision$Number");
+                  env->FindClass(JAVAHL_CLASS("/types/Revision$Number"));
                 if (JNIUtil::isJavaExceptionThrown())
                   POP_AND_RETURN_NOTHING();
 
@@ -99,7 +99,7 @@ Revision::Revision(jobject jthis, bool h
             if (fidDate == 0)
               {
                 jclass clazz =
-                  env->FindClass(JAVA_PACKAGE"/types/Revision$DateSpec");
+                  env->FindClass(JAVAHL_CLASS("/types/Revision$DateSpec"));
                 if (JNIUtil::isJavaExceptionThrown())
                   POP_AND_RETURN_NOTHING();
 
@@ -158,7 +158,7 @@ jobject
 Revision::makeJRevision(svn_revnum_t rev)
 {
   JNIEnv *env = JNIUtil::getEnv();
-  jclass clazz = env->FindClass(JAVA_PACKAGE "/types/Revision");
+  jclass clazz = env->FindClass(JAVAHL_CLASS("/types/Revision"));
   if (JNIUtil::isJavaExceptionThrown())
     return NULL;
 
@@ -166,7 +166,7 @@ Revision::makeJRevision(svn_revnum_t rev
   if (getInstance == 0)
     {
       getInstance = env->GetStaticMethodID(clazz, "getInstance",
-                                           "(J)L" JAVA_PACKAGE "/types/Revision;");
+                                           "(J)" JAVAHL_ARG("/types/Revision;"));
       if (JNIUtil::isExceptionThrown())
         return NULL;
     }

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/RevisionRange.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/RevisionRange.cpp?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/RevisionRange.cpp (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/RevisionRange.cpp Tue Jun 23 12:55:43 2015
@@ -52,7 +52,7 @@ void get_range_info(jobject jrange,
 {
   JNIEnv *env = JNIUtil::getEnv();
 
-  jclass clazz = env->FindClass(JAVA_PACKAGE"/types/RevisionRange");
+  jclass clazz = env->FindClass(JAVAHL_CLASS("/types/RevisionRange"));
   if (JNIUtil::isExceptionThrown())
     return;
 
@@ -63,7 +63,7 @@ void get_range_info(jobject jrange,
       if (fmid == 0)
         {
           fmid = env->GetMethodID(clazz, "getFromRevision",
-                                  "()L"JAVA_PACKAGE"/types/Revision;");
+                                  "()" JAVAHL_ARG("/types/Revision;"));
           if (JNIUtil::isJavaExceptionThrown())
             return;
         }
@@ -87,7 +87,7 @@ void get_range_info(jobject jrange,
       if (tmid == 0)
         {
           tmid = env->GetMethodID(clazz, "getToRevision",
-                                  "()L"JAVA_PACKAGE"/types/Revision;");
+                                  "()" JAVAHL_ARG("/types/Revision;"));
           if (JNIUtil::isJavaExceptionThrown())
             return;
         }
@@ -163,7 +163,7 @@ RevisionRange::makeJRevisionRange(svn_me
 {
     JNIEnv *env = JNIUtil::getEnv();
 
-    jclass rangeClazz = env->FindClass(JAVA_PACKAGE "/types/RevisionRange");
+    jclass rangeClazz = env->FindClass(JAVAHL_CLASS("/types/RevisionRange"));
     if (JNIUtil::isJavaExceptionThrown())
         return NULL;
     static jmethodID rangeCtor = 0;

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/RevisionRangeList.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/RevisionRangeList.cpp?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/RevisionRangeList.cpp (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/RevisionRangeList.cpp Tue Jun 23 12:55:43 2015
@@ -60,7 +60,7 @@ RevisionRangeList RevisionRangeList::cre
       jmethodID mid = 0;
       if (mid == 0)
         {
-          jclass cls = env->FindClass(JAVA_PACKAGE"/types/RevisionRangeList");
+          jclass cls = env->FindClass(JAVAHL_CLASS("/types/RevisionRangeList"));
           if (JNIUtil::isJavaExceptionThrown())
             return RevisionRangeList(NULL, pool);
 

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/SVNClient.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/SVNClient.cpp?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/SVNClient.cpp (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/SVNClient.cpp Tue Jun 23 12:55:43 2015
@@ -96,21 +96,21 @@ SVNClient *SVNClient::getCppObject(jobje
 {
     static jfieldID fid = 0;
     jlong cppAddr = SVNBase::findCppAddrForJObject(jthis, &fid,
-                                                   JAVA_PACKAGE"/SVNClient");
+                                                   JAVAHL_CLASS("/SVNClient"));
     return (cppAddr == 0 ? NULL : reinterpret_cast<SVNClient *>(cppAddr));
 }
 
 void SVNClient::dispose(jobject jthis)
 {
     static jfieldID fid = 0;
-    SVNBase::dispose(jthis, &fid, JAVA_PACKAGE"/SVNClient");
+    SVNBase::dispose(jthis, &fid, JAVAHL_CLASS("/SVNClient"));
 }
 
 jobject SVNClient::getVersionExtended(bool verbose)
 {
     JNIEnv *const env = JNIUtil::getEnv();
 
-    jclass clazz = env->FindClass(JAVA_PACKAGE"/types/VersionExtended");
+    jclass clazz = env->FindClass(JAVAHL_CLASS("/types/VersionExtended"));
     if (JNIUtil::isJavaExceptionThrown())
         return NULL;
 

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/SVNRepos.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/SVNRepos.cpp?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/SVNRepos.cpp (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/SVNRepos.cpp Tue Jun 23 12:55:43 2015
@@ -50,14 +50,14 @@ SVNRepos *SVNRepos::getCppObject(jobject
 {
   static jfieldID fid = 0;
   jlong cppAddr = SVNBase::findCppAddrForJObject(jthis, &fid,
-                                                 JAVA_PACKAGE"/SVNRepos");
+                                                 JAVAHL_CLASS("/SVNRepos"));
   return (cppAddr == 0 ? NULL : reinterpret_cast<SVNRepos *>(cppAddr));
 }
 
 void SVNRepos::dispose(jobject jthis)
 {
   static jfieldID fid = 0;
-  SVNBase::dispose(jthis, &fid, JAVA_PACKAGE"/SVNRepos");
+  SVNBase::dispose(jthis, &fid, JAVAHL_CLASS("/SVNRepos"));
 }
 
 void SVNRepos::cancelOperation()
@@ -716,7 +716,7 @@ jobject SVNRepos::lslocks(File &path, sv
               NULL);
 
   JNIEnv *env = JNIUtil::getEnv();
-  jclass clazz = env->FindClass(JAVA_PACKAGE"/types/Lock");
+  jclass clazz = env->FindClass(JAVAHL_CLASS("/types/Lock"));
   if (JNIUtil::isJavaExceptionThrown())
     return NULL;
 

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/StateReporter.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/StateReporter.cpp?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/StateReporter.cpp (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/StateReporter.cpp Tue Jun 23 12:55:43 2015
@@ -43,16 +43,14 @@ StateReporter::StateReporter()
 {}
 
 StateReporter::~StateReporter()
-{
-  delete m_editor;
-}
+{}
 
 StateReporter*
 StateReporter::getCppObject(jobject jthis)
 {
   static jfieldID fid = 0;
   jlong cppAddr = SVNBase::findCppAddrForJObject(jthis, &fid,
-      JAVA_PACKAGE"/remote/StateReporter");
+      JAVAHL_CLASS("/remote/StateReporter"));
   return (cppAddr == 0 ? NULL : reinterpret_cast<StateReporter*>(cppAddr));
 }
 
@@ -65,7 +63,7 @@ StateReporter::dispose(jobject jthis)
     abortReport();
 
   static jfieldID fid = 0;
-  SVNBase::dispose(jthis, &fid, JAVA_PACKAGE"/remote/StateReporter");
+  SVNBase::dispose(jthis, &fid, JAVAHL_CLASS("/remote/StateReporter"));
 }
 
 namespace {
@@ -179,8 +177,8 @@ StateReporter::abortReport()
 
 void
 StateReporter::set_reporter_data(const svn_ra_reporter3_t* raw_reporter,
-                                   void* report_baton,
-                                   EditorProxy* editor)
+                                 void* report_baton,
+                                 EditorProxy::UniquePtr editor)
 {
   //DEBUG:fprintf(stderr, "  (n) StateReporter::set_reporter_data()\n");
 

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/StateReporter.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/StateReporter.h?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/StateReporter.h (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/StateReporter.h Tue Jun 23 12:55:43 2015
@@ -20,7 +20,7 @@
  * ====================================================================
  * @endcopyright
  *
- * @file UpdateReporter.h
+ * @file StateReporter.h
  * @brief Interface of the class UpdateReporter
  */
 
@@ -61,13 +61,13 @@ private:
   bool m_valid;
   const svn_ra_reporter3_t* m_raw_reporter;
   void* m_report_baton;
-  EditorProxy* m_editor;
+  EditorProxy::UniquePtr m_editor;
 
   friend class RemoteSession;
   apr_pool_t* get_report_pool() const { return pool.getPool(); }
   void set_reporter_data(const svn_ra_reporter3_t* raw_reporter,
                          void* report_baton,
-                         EditorProxy* editor);
+                         EditorProxy::UniquePtr editor);
   svn_revnum_t m_target_revision;
 };
 

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/StatusCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/StatusCallback.cpp?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/StatusCallback.cpp (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/StatusCallback.cpp Tue Jun 23 12:55:43 2015
@@ -81,13 +81,13 @@ StatusCallback::doStatus(const char *loc
   // it can be cached.
   if (mid == 0)
     {
-      jclass clazz = env->FindClass(JAVA_PACKAGE"/callback/StatusCallback");
+      jclass clazz = env->FindClass(JAVAHL_CLASS("/callback/StatusCallback"));
       if (JNIUtil::isJavaExceptionThrown())
         POP_AND_RETURN(SVN_NO_ERROR);
 
       mid = env->GetMethodID(clazz, "doStatus",
                              "(Ljava/lang/String;"
-                             "L"JAVA_PACKAGE"/types/Status;)V");
+                             JAVAHL_ARG("/types/Status;") ")V");
       if (JNIUtil::isJavaExceptionThrown() || mid == 0)
         POP_AND_RETURN(SVN_NO_ERROR);
     }
@@ -101,11 +101,8 @@ StatusCallback::doStatus(const char *loc
     POP_AND_RETURN(SVN_NO_ERROR);
 
   env->CallVoidMethod(m_callback, mid, jPath, jStatus);
-  // We return here regardless of whether an exception is thrown or not,
-  // so we do not need to explicitly check for one.
 
-  env->PopLocalFrame(NULL);
-  return SVN_NO_ERROR;
+  POP_AND_RETURN_EXCEPTION_AS_SVNERROR();
 }
 
 void

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/SubversionException.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/SubversionException.cpp?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/SubversionException.cpp (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/SubversionException.cpp Tue Jun 23 12:55:43 2015
@@ -27,6 +27,6 @@
 namespace JavaHL {
 
 const char* const SubversionException::m_class_name =
-  JAVA_PACKAGE"/SubversionException";
+  JAVAHL_CLASS("/SubversionException");
 
 } // namespace JavaHL

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/VersionExtended.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/VersionExtended.cpp?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/VersionExtended.cpp (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/VersionExtended.cpp Tue Jun 23 12:55:43 2015
@@ -27,7 +27,7 @@
 #include "JNIUtil.h"
 #include "VersionExtended.h"
 
-const VersionExtended *
+VersionExtended *
 VersionExtended::getCppObject(jobject jthis)
 {
   if (!jthis)
@@ -35,7 +35,7 @@ VersionExtended::getCppObject(jobject jt
 
   static jfieldID fid = 0;
   jlong cppAddr = SVNBase::findCppAddrForJObject(
-      jthis, &fid, JAVA_PACKAGE"/types/VersionExtended");
+      jthis, &fid, JAVAHL_CLASS("/types/VersionExtended"));
   return (cppAddr == 0 ? NULL : reinterpret_cast<VersionExtended *>(cppAddr));
 }
 
@@ -46,7 +46,7 @@ static jobject getWrapperAddress(jobject
   if (!*fid)
     {
       *fid = env->GetFieldID(env->GetObjectClass(jthat), "wrapper",
-                             "L"JAVA_PACKAGE"/types/VersionExtended;");
+                             JAVAHL_ARG("/types/VersionExtended;"));
       if (JNIUtil::isJavaExceptionThrown())
         {
           *fid = 0;
@@ -94,5 +94,5 @@ VersionExtended::~VersionExtended() {}
 void VersionExtended::dispose(jobject jthis)
 {
   static jfieldID fid = 0;
-  SVNBase::dispose(jthis, &fid, JAVA_PACKAGE"/types/VersionExtended");
+  SVNBase::dispose(jthis, &fid, JAVAHL_CLASS("/types/VersionExtended"));
 }

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/VersionExtended.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/VersionExtended.h?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/VersionExtended.h (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/VersionExtended.h Tue Jun 23 12:55:43 2015
@@ -33,7 +33,7 @@
 class VersionExtended : public SVNBase
 {
 public:
-  static const VersionExtended *getCppObject(jobject jthis);
+  static VersionExtended *getCppObject(jobject jthis);
   static const VersionExtended *getCppObjectFromLinkedLib(jobject jthat);
   static const VersionExtended *getCppObjectFromLoadedLib(jobject jthat);
   static const VersionExtended *getCppObjectFromLinkedLibIterator(jobject jthat);

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/jniwrapper/jni_base.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/jniwrapper/jni_base.cpp?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/jniwrapper/jni_base.cpp (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/jniwrapper/jni_base.cpp Tue Jun 23 12:55:43 2015
@@ -179,30 +179,6 @@ void Env::throw_java_out_of_memory(const
 const jint LocalFrame::DEFAULT_CAPACITY = 16;
 
 
-// class Java::GlobalObject
-
-GlobalObject& GlobalObject::operator=(jobject that)
-{
-  this->~GlobalObject();
-  return *new(this) GlobalObject(Env(), that);
-}
-
-GlobalObject::~GlobalObject()
-{
-  if (m_obj)
-    Env().DeleteGlobalRef(m_obj);
-}
-
-
-// class Java::GlobalClass
-
-GlobalClass& GlobalClass::operator=(jclass that)
-{
-  this->~GlobalClass();
-  return *new(this) GlobalClass(Env(), that);
-}
-
-
 // Class Java::Object
 
 const char* const Object::m_class_name = "java/lang/Object";
@@ -375,7 +351,8 @@ const char* unknown_cxx_exception_messag
 
 svn_error_t* caught_java_exception_error(apr_status_t status) throw()
 {
-  return svn_error_create(status, NULL, _("Java exception"));
+  return svn_error_create(status, JNIUtil::wrapJavaException(),
+                          _("Java exception"));
 }
 
 } // namespace Java

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/jniwrapper/jni_globalref.hpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/jniwrapper/jni_globalref.hpp?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/jniwrapper/jni_globalref.hpp (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/jniwrapper/jni_globalref.hpp Tue Jun 23 12:55:43 2015
@@ -24,6 +24,8 @@
 #ifndef SVN_JAVAHL_JNIWRAPPER_GLOBALREF_HPP
 #define SVN_JAVAHL_JNIWRAPPER_GLOBALREF_HPP
 
+#include <memory>
+
 #include <jni.h>
 
 #include "jni_env.hpp"
@@ -43,11 +45,19 @@ public:
     : m_obj(obj ? env.NewGlobalRef(obj) : NULL)
     {}
 
-  ~GlobalObject();
+  ~GlobalObject() throw()
+    {
+      if (m_obj)
+        Env().DeleteGlobalRef(m_obj);
+    }
 
-  GlobalObject& operator=(jobject that);
+  GlobalObject& operator=(jobject that)
+    {
+      this->~GlobalObject();
+      return *new(this) GlobalObject(Env(), that);
+    }
 
-  jobject get() const
+  jobject get() const throw()
     {
       return m_obj;
     }
@@ -73,9 +83,13 @@ public:
     : GlobalObject(env, cls)
     {}
 
-  GlobalClass& operator=(jclass that);
+  GlobalClass& operator=(jclass that)
+    {
+      GlobalObject::operator=(that);
+      return *this;
+    }
 
-  jclass get() const
+  jclass get() const throw()
     {
       return jclass(GlobalObject::get());
     }

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/org_apache_subversion_javahl_types_VersionExtended.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/org_apache_subversion_javahl_types_VersionExtended.cpp?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/org_apache_subversion_javahl_types_VersionExtended.cpp (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/org_apache_subversion_javahl_types_VersionExtended.cpp Tue Jun 23 12:55:43 2015
@@ -33,8 +33,24 @@
 #include "JNIStackElement.h"
 #include <string>
 
+#include "svn_private_config.h"
+
 // VersionExtended native methods
 
+JNIEXPORT void JNICALL
+Java_org_apache_subversion_javahl_types_VersionExtended_dispose(
+    JNIEnv *env, jobject jthis)
+{
+  JNIEntry(VersionExtended, dispose);
+  VersionExtended *const vx = VersionExtended::getCppObject(jthis);
+  if (vx == NULL)
+    {
+      JNIUtil::throwError(_("bad C++ this"));
+      return;
+    }
+  vx->dispose(jthis);
+}
+
 JNIEXPORT jstring JNICALL
 Java_org_apache_subversion_javahl_types_VersionExtended_getBuildDate(
     JNIEnv *env, jobject jthis)

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_ConfigImpl_Category.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_ConfigImpl_Category.cpp?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_ConfigImpl_Category.cpp (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_ConfigImpl_Category.cpp Tue Jun 23 12:55:43 2015
@@ -270,12 +270,12 @@ Java_org_apache_subversion_javahl_util_C
       {
         enumerator_t* enmr = static_cast<enumerator_t*>(baton);
         JNIEnv* const e = enmr->m_env;
-        const jobject jh = enmr->m_jhandler;;
+        const jobject jh = enmr->m_jhandler;
 
         static jmethodID mid = 0;
         if (0 == mid)
           {
-            jclass cls = e->FindClass(JAVA_PACKAGE"/ISVNConfig$Enumerator");
+            jclass cls = e->FindClass(JAVAHL_CLASS("/ISVNConfig$Enumerator"));
             if (JNIUtil::isJavaExceptionThrown())
               return false;
             mid = e->GetMethodID(cls, "option",

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_SubstLib.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_SubstLib.cpp?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_SubstLib.cpp (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_SubstLib.cpp Tue Jun 23 12:55:43 2015
@@ -61,7 +61,7 @@ build_keywords_common(Java::Env env, con
   svn_string_t* keywords_string = keywords_contents.get_string(pool);
   const char* revision = (jrevision < 0 ? NULL
                           : apr_psprintf(pool.getPool(),
-                                         "%"APR_UINT64_T_FMT,
+                                         "%" APR_UINT64_T_FMT,
                                          apr_uint64_t(jrevision)));
   const Java::String::Contents url_contents(url);
   const Java::String::Contents root_url_contents(repos_root_url);

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java Tue Jun 23 12:55:43 2015
@@ -502,9 +502,9 @@ public interface ISVNClient
      * Recursively cleans up a local directory, finishing any
      * incomplete operations, removing lockfiles, etc.
      * <p>
-     * Behaves like the 1.9 version with <code>breakLocks</code> and
-     * <code>includeExternals</code> set to <code>false<code>, and the
-     * other flags to <code>true</code>.
+     * Behaves like the 1.9 version with <code>includeExternals</code>
+     * set to <code>false<code>, and the other flags to
+     * <code>true</code>.
      * @param path a local directory.
      * @throws ClientException
      */

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNEditor.java
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNEditor.java?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNEditor.java (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNEditor.java Tue Jun 23 12:55:43 2015
@@ -94,7 +94,9 @@ public interface ISVNEditor
      * <code>replacesRevision</code> set accordingly <em>must</em> be used.
      * <p>
      * <b>Note:</b> The <code>contents</code> stream's lifetime must not
-     *      extend beyond the scope of this function.
+     *      extend beyond the scope of this function. An
+     *      implementation <b>must</b> close the stream after
+     *      consuming its contents.
      *
      * @throws ClientException
      */
@@ -193,7 +195,9 @@ public interface ISVNEditor
      * #addFile().
      * <p>
      * <b>Note:</b> The <code>contents</code> stream's lifetime must not
-     *      extend beyond the scope of this function.
+     *      extend beyond the scope of this function. An
+     *      implementation <b>must</b> close the stream after
+     *      consuming its contents.
      *
      * @throws ClientException
      */

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java Tue Jun 23 12:55:43 2015
@@ -294,7 +294,7 @@ public class SVNClient implements ISVNCl
 
     public void cleanup(String path) throws ClientException
     {
-        cleanup(path, false, true, true, true, false);
+        cleanup(path, true, true, true, true, false);
     }
 
     public native void resolve(String path, Depth depth,

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/StatusEditor.java
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/StatusEditor.java?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/StatusEditor.java (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/StatusEditor.java Tue Jun 23 12:55:43 2015
@@ -33,6 +33,7 @@ import java.util.GregorianCalendar;
 import java.util.Locale;
 import java.util.SimpleTimeZone;
 import java.io.InputStream;
+import java.io.IOException;
 import java.nio.charset.Charset;
 
 /**
@@ -78,6 +79,14 @@ class StatusEditor implements ISVNEditor
                         long replacesRevision)
     {
         //DEBUG:System.err.println("  [J] StatusEditor.addFile");
+        if (contents != null) {
+            try {
+                contents.close();
+            } catch (IOException ex) {
+                throw new RuntimeException(ex);
+            }
+        }
+
         checkState();
         receiver.addedFile(relativePath);
     }
@@ -120,6 +129,14 @@ class StatusEditor implements ISVNEditor
                           Map<String, byte[]> properties)
     {
         //DEBUG:System.err.println("  [J] StatusEditor.alterFile");
+        if (contents != null) {
+            try {
+                contents.close();
+            } catch (IOException ex) {
+                throw new RuntimeException(ex);
+            }
+        }
+
         checkState();
         receiver.modifiedFile(relativePath,
                               (checksum != null && contents != null),

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/VersionExtended.java
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/VersionExtended.java?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/VersionExtended.java (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/VersionExtended.java Tue Jun 23 12:55:43 2015
@@ -41,6 +41,21 @@ public class VersionExtended
     }
 
     /**
+     * Release the native peer. This method must be called to release
+     * the native resources held by this object.
+     * <p>
+     * Once this method is called, all object references obtained from
+     * the iterators returned by {@link #getLinkedLibs()} and
+     * {@link #getLoadedLibs()} become invalid and should no longer be used.
+     */
+    public native void dispose();
+
+    /**
+     * release the native peer (should use dispose instead)
+     */
+    public native void finalize();
+
+    /**
      * @return The date when the libsvn_subr library was compiled, in
      * the format defined by the C standard macro #__DATE__.
      */

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java Tue Jun 23 12:55:43 2015
@@ -139,9 +139,10 @@ public class BasicTests extends SVNTests
      */
     public void testVersionExtendedQuiet() throws Throwable
     {
+        VersionExtended vx = null;
         try
         {
-            VersionExtended vx = client.getVersionExtended(false);
+            vx = client.getVersionExtended(false);
             String result = vx.getBuildDate();
             if (result == null || result.trim().length() == 0)
                 throw new Exception("Build date empty");
@@ -160,6 +161,11 @@ public class BasicTests extends SVNTests
             fail("VersionExtended should always be available unless the " +
                  "native libraries failed to initialize: " + e);
         }
+        finally
+        {
+            if (vx != null)
+                vx.dispose();
+        }
     }
 
     /**
@@ -168,9 +174,10 @@ public class BasicTests extends SVNTests
      */
     public void testVersionExtendedVerbose() throws Throwable
     {
+        VersionExtended vx = null;
         try
         {
-            VersionExtended vx = client.getVersionExtended(true);
+            vx = client.getVersionExtended(true);
             String result = vx.getRuntimeHost();
             if (result == null || result.trim().length() == 0)
                 throw new Exception("Runtime host empty");
@@ -216,6 +223,11 @@ public class BasicTests extends SVNTests
             fail("VersionExtended should always be available unless the " +
                  "native libraries failed to initialize: " + e);
         }
+        finally
+        {
+            if (vx != null)
+                vx.dispose();
+        }
     }
 
     /**
@@ -1091,6 +1103,7 @@ public class BasicTests extends SVNTests
     private void setupPinExternalsTest(OneTest thisTest) throws Throwable
     {
         byte[] extref = ("^/A/D/H ADHext\n" +
+                         "^/A/D/H ADHext2\n" +
                          "^/A/D/H@1 peggedADHext\n" +
                          "-r1 ^/A/D/H revvedADHext\n").getBytes();
         Set<String> paths = new HashSet<String>();
@@ -1130,6 +1143,7 @@ public class BasicTests extends SVNTests
 
         // Verification
         String expected = ("^/A/D/H@2 ADHext\n" +
+                           "^/A/D/H@2 ADHext2\n" +
                            "^/A/D/H@1 peggedADHext\n" +
                            "-r1 ^/A/D/H@2 revvedADHext\n");
         String actual =
@@ -1158,6 +1172,7 @@ public class BasicTests extends SVNTests
 
         // Verification
         String expected = ("^/A/D/H@2 ADHext\n" +
+                           "^/A/D/H@2 ADHext2\n" +
                            "^/A/D/H@1 peggedADHext\n" +
                            "-r1 ^/A/D/H@2 revvedADHext\n");
         String actual =
@@ -1186,6 +1201,7 @@ public class BasicTests extends SVNTests
 
         // Verification
         String expected = ("^/A/D/H@2 ADHext\n" +
+                           "^/A/D/H@2 ADHext2\n" +
                            "^/A/D/H@1 peggedADHext\n" +
                            "-r1 ^/A/D/H@2 revvedADHext\n");
         String actual =
@@ -1214,6 +1230,7 @@ public class BasicTests extends SVNTests
 
         // Verification
         String expected = ("^/A/D/H@2 ADHext\n" +
+                           "^/A/D/H@2 ADHext2\n" +
                            "^/A/D/H@1 peggedADHext\n" +
                            "-r1 ^/A/D/H@2 revvedADHext\n");
         String actual =
@@ -1249,6 +1266,44 @@ public class BasicTests extends SVNTests
 
         // Verification
         String expected = ("^/A/D/H@2 ADHext\n" +
+                           "^/A/D/H ADHext2\n" +
+                           "^/A/D/H@1 peggedADHext\n" +
+                           "-r1 ^/A/D/H revvedADHext\n");
+        String actual =
+            new String(client.propertyGet(target, "svn:externals", null, null));
+
+        assertEquals(expected, actual);
+    }
+
+    /**
+     * Test REPO-to-REPO copy with explicit pinned externals that
+     * don't correspond to actual externals
+     * @throws Throwable
+     */
+    public void testCopyPinExternals_repo2repo_corkscrew() throws Throwable
+    {
+        // build the test setup
+        OneTest thisTest = new OneTest();
+        setupPinExternalsTest(thisTest);
+
+        String sourceUrl = thisTest.getUrl() + "/A/B";
+        Map<String, List<ExternalItem>> externalsToPin =
+            new HashMap<String, List<ExternalItem>>();
+        List<ExternalItem> items = new ArrayList<ExternalItem>(1);
+        items.add(new ExternalItem("ADHext", "^/A/D/H", null, null));
+        externalsToPin.put(sourceUrl + "/A", items);
+
+        List<CopySource> sources = new ArrayList<CopySource>(1);
+        sources.add(new CopySource(sourceUrl, null, null));
+        String target = thisTest.getUrl() + "/A/Bcopy";
+        client.copy(sources, target, true, false, false, false,
+                    true,       // pinExternals
+                    externalsToPin,
+                    null, new ConstMsg("Copy WC to REPO"), null);
+
+        // Verification
+        String expected = ("^/A/D/H ADHext\n" +
+                           "^/A/D/H ADHext2\n" +
                            "^/A/D/H@1 peggedADHext\n" +
                            "-r1 ^/A/D/H revvedADHext\n");
         String actual =

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/tests/org/apache/subversion/javahl/RunTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/tests/org/apache/subversion/javahl/RunTests.java?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/tests/org/apache/subversion/javahl/RunTests.java (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/tests/org/apache/subversion/javahl/RunTests.java Tue Jun 23 12:55:43 2015
@@ -95,6 +95,7 @@ public class RunTests
                 suite.addTestSuite(UtilTests.class);
                 suite.addTestSuite(SVNRemoteTests.class);
                 suite.addTestSuite(SVNReposTests.class);
+                suite.addTestSuite(ExceptionTests.class);
             }
             else
             {

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java Tue Jun 23 12:55:43 2015
@@ -53,15 +53,35 @@ import java.security.NoSuchAlgorithmExce
  */
 public class SVNRemoteTests extends SVNTests
 {
+    /**
+     * Base name of all our tests.
+     */
+    public final static String testName = "remote_test";
+
     protected OneTest thisTest;
 
     public SVNRemoteTests()
     {
+        init();
     }
 
     public SVNRemoteTests(String name)
     {
         super(name);
+        init();
+    }
+
+    /**
+     * Initialize the testBaseName and the testCounter, if this is the
+     * first test of this class.
+     */
+    private void init()
+    {
+        if (!testName.equals(testBaseName))
+        {
+            testCounter = 0;
+            testBaseName = testName;
+        }
     }
 
     protected void setUp() throws Exception
@@ -937,6 +957,7 @@ public class SVNRemoteTests extends SVNT
                        0, false, false, false, null,
                        receiver);
         assertEquals(1, receiver.logs.size());
+        assertTrue(receiver.logs.get(0).revprops.size() > 0);
 
         receiver.logs.clear();
         session.reparent(getTestRepoUrl() + "/A");
@@ -945,6 +966,7 @@ public class SVNRemoteTests extends SVNT
                        0, 0, false, false, false, null,
                        receiver);
         assertEquals(2, receiver.logs.size());
+        assertTrue(receiver.logs.get(0).revprops.size() > 0);
     }
 
     public void testGetLogMissing() throws Exception

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNReposTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNReposTests.java?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNReposTests.java (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNReposTests.java Tue Jun 23 12:55:43 2015
@@ -40,13 +40,33 @@ import java.util.Map;
  */
 public class SVNReposTests extends SVNTests
 {
+    /**
+     * Base name of all our tests.
+     */
+    public final static String testName = "repos_test";
+
     public SVNReposTests()
     {
+        init();
     }
 
     public SVNReposTests(String name)
     {
         super(name);
+        init();
+    }
+
+    /**
+     * Initialize the testBaseName and the testCounter, if this is the
+     * first test of this class.
+     */
+    private void init()
+    {
+        if (!testName.equals(testBaseName))
+        {
+            testCounter = 0;
+            testBaseName = testName;
+        }
     }
 
     /**

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java Tue Jun 23 12:55:43 2015
@@ -80,6 +80,17 @@ class SVNTests extends TestCase
     protected static int testCounter;
 
     /**
+     * Set to true if tests should clean up after themselves.
+     */
+    protected boolean cleanupAfterTests = false;
+
+    /**
+     * this list contains the names of all repository and working copy
+     * directories created by one test case.
+     */
+    protected static List<File> testDirs;
+
+    /**
      * the file in which the sample repository has been dumped.
      */
     protected File greekDump;
@@ -173,6 +184,10 @@ class SVNTests extends TestCase
 
     private void init()
     {
+        String cleanupProp = System.getProperty("test.cleanup");
+        if (cleanupProp != null)
+            cleanupAfterTests = (0 < cleanupProp.trim().length());
+
         String disableCredStore = System.getProperty("test.disablecredstore");
         if (disableCredStore != null)
         {
@@ -510,6 +525,16 @@ class SVNTests extends TestCase
         client.dispose();
         // remove the temporary directory
         removeDirOrFile(localTmp);
+
+        // optionally remove the test directories
+        List<File> td = testDirs;
+        testDirs = null;
+        if (cleanupAfterTests && td != null)
+        {
+            for(File f: td)
+                removeDirOrFile(f);
+        }
+
         super.tearDown();
     }
 
@@ -788,6 +813,13 @@ class SVNTests extends TestCase
             return wc;
         }
 
+        private void trackDir(File dir)
+        {
+            if (testDirs == null)
+                testDirs = new ArrayList<File>();
+            testDirs.add(dir);
+        }
+
         /**
          * Create the repository for the beginning of the test.
          * Assumes that {@link #testName} has been set.
@@ -804,6 +836,7 @@ class SVNTests extends TestCase
             // build a clean repository directory
             File repos = new File(repositories, this.testName);
             removeDirOrFile(repos);
+            trackDir(repos);
             // create and load the repository from the default repository dump
             admin.create(repos, true, false, conf, fsType);
             if (loadGreek)
@@ -829,6 +862,7 @@ class SVNTests extends TestCase
             URI uri = makeReposUrl(repos);
             workingCopy = new File(workingCopies, this.testName);
             removeDirOrFile(workingCopy);
+            trackDir(workingCopy);
             // checkout the repository
             client.checkout(uri.toString(), workingCopy.getAbsolutePath(),
                    null, null, Depth.infinity, false, false);

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/SVNAdminTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/SVNAdminTests.java?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/SVNAdminTests.java (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/SVNAdminTests.java Tue Jun 23 12:55:43 2015
@@ -35,13 +35,33 @@ import org.tigris.subversion.javahl.Subv
  */
 public class SVNAdminTests extends SVNTests
 {
+    /**
+     * Base name of all our tests.
+     */
+    public final static String testName = "admin_test";
+
     public SVNAdminTests()
     {
+        init();
     }
 
     public SVNAdminTests(String name)
     {
         super(name);
+        init();
+    }
+
+    /**
+     * Initialize the testBaseName and the testCounter, if this is the
+     * first test of this class.
+     */
+    private void init()
+    {
+        if (!testName.equals(testBaseName))
+        {
+            testCounter = 0;
+            testBaseName = testName;
+        }
     }
 
     /**

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/swig/INSTALL
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/swig/INSTALL?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/swig/INSTALL (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/swig/INSTALL Tue Jun 23 12:55:43 2015
@@ -65,7 +65,7 @@ BUILDING SWIG BINDINGS FOR SVN ON UNIX
 
 
 Step 1:  Install a suitable version of SWIG (which is
-         currently SWIG version 1.3.24 or later).
+         currently SWIG version 1.3.24 or later, but not SWIG 3.0.0 or newer).
 
     * Perhaps your distribution packages a suitable version - if it does
       install it, and skip to the last bullet point in this section.

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/swig/core.i
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/swig/core.i?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/swig/core.i (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/swig/core.i Tue Jun 23 12:55:43 2015
@@ -532,8 +532,10 @@
         $1 = NULL;
     }
     else if (SvPOK($input)) {
-        if (_global_pool == NULL)
+        if (_global_pool == NULL) {
             _global_pool = svn_swig_pl_make_pool((SV *)NULL);
+            SPAGAIN;
+        }
         $1 = apr_pstrdup(_global_pool, SvPV_nolen($input));
     }
     else {

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/swig/include/apr.swg
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/swig/include/apr.swg?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/swig/include/apr.swg (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/swig/include/apr.swg Tue Jun 23 12:55:43 2015
@@ -31,23 +31,21 @@
 */
 #ifdef SWIGPERL
 %typemap(out) long long {
-    char temp[256];
+    char temp[30];
     sprintf(temp, "%" APR_INT64_T_FMT, (apr_int64_t) $1);
-    ST(argvi) = sv_newmortal();
-    sv_setpv((SV*)ST(argvi++), temp);
+    %append_output(sv_2mortal(newSVpv(temp, 0)));
 }
 
 %typemap(out) unsigned long long {
-    char temp[256];
+    char temp[30];
     sprintf(temp, "%" APR_UINT64_T_FMT, (apr_uint64_t) $1);
-    ST(argvi) = sv_newmortal();
-    sv_setpv((SV*)ST(argvi++), temp);
+    %append_output(sv_2mortal(newSVpv(temp, 0)));
 }
 
 %typemap(in, numinputs=0) long long *OUTPUT (apr_int64_t temp)
     "$1 = &temp;";
 %typemap(argout) long long *OUTPUT {
-  char temp[256];
+  char temp[30];
   sprintf(temp, "%" APR_INT64_T_FMT, (apr_int64_t)*($1));
   %append_output(sv_2mortal(newSVpv(temp, 0)));
 }
@@ -55,7 +53,7 @@
 %typemap(in, numinputs=0) unsigned long long *OUTPUT (apr_uint64_t temp)
     "$1 = &temp;";
 %typemap(argout) unsigned long long *OUTPUT {
-  char temp[256];
+  char temp[30];
   sprintf(temp, "%" APR_UINT64_T_FMT, (apr_uint64_t)*($1));
   %append_output(sv_2mortal(newSVpv(temp, 0)));
 }

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/swig/include/svn_containers.swg
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/swig/include/svn_containers.swg?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/swig/include/svn_containers.swg (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/swig/include/svn_containers.swg Tue Jun 23 12:55:43 2015
@@ -269,8 +269,10 @@
 %typemap(in) apr_hash_t *PROPHASH
   (apr_pool_t *_global_pool = NULL)
 {
-  if (_global_pool == NULL)
+  if (_global_pool == NULL) {
     _global_pool = svn_swig_pl_make_pool((SV *)NULL);
+    SPAGAIN;
+  }
   $1 = svn_swig_pl_hash_to_prophash($input, _global_pool);  
 }
 %typemap(out) apr_hash_t *PROPHASH
@@ -426,6 +428,25 @@
 {
   $1 = svn_swig_py_path_revs_hash_from_dict($input, _global_pool);
 }
+%typemap(in) apr_hash_t *unlock_targets
+{
+  $1 = svn_swig_py_stringhash_from_dict($input, _global_pool);
+}
+%typemap(in) apr_hash_t *lock_targets
+  (apr_pool_t *_global_pool, PyObject *_global_pool = NULL)
+{
+  if (_global_pool == NULL)
+  {
+    if (svn_swig_py_get_parent_pool(args, $descriptor(apr_pool_t *),
+                                    &_global_py_pool, &_global_pool))
+      SWIG_fail;
+  }
+  $1 = svn_swig_py_struct_ptr_hash_from_dict($input,
+     $descriptor(svn_fs_lock_target_t *), _global_pool);
+  if (PyErr_Occurred()) {
+    SWIG_fail;
+  }
+}
 #endif
 
 #ifdef SWIGPERL

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/swig/include/svn_string.swg
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/swig/include/svn_string.swg?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/swig/include/svn_string.swg (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/swig/include/svn_string.swg Tue Jun 23 12:55:43 2015
@@ -90,6 +90,7 @@ typedef struct svn_string_t svn_string_t
 %typemap(in) svn_stringbuf_t * {
     apr_size_t len;
     char *buf;
+    apr_pool_t *pool;
 
     if (!SvOK($input)) {
         $1 = NULL;
@@ -97,8 +98,9 @@ typedef struct svn_string_t svn_string_t
         buf = SvPV($input, len);
         /* Another case of ugly pool handling, this should use the current
            default pool, or make a new one if it doesn't exist yet */
-        $1 = svn_stringbuf_ncreate(buf,len,
-                                   svn_swig_pl_make_pool ((SV *)NULL));
+        pool = svn_swig_pl_make_pool ((SV *)NULL);
+        SPAGAIN;
+        $1 = svn_stringbuf_ncreate(buf,len, pool);
     } else {
         croak("Not a string");
     }

Modified: subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/swig/include/svn_types.swg
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/swig/include/svn_types.swg?rev=1687045&r1=1687044&r2=1687045&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/swig/include/svn_types.swg (original)
+++ subversion/branches/svn-mergeinfo-normalizer/subversion/bindings/swig/include/svn_types.swg Tue Jun 23 12:55:43 2015
@@ -423,9 +423,11 @@ svn_ ## TYPE ## _swig_rb_closed(VALUE se
         if (SvOK(exception_handler)) {
             SV *callback_result;
 
+            PUTBACK;
             svn_swig_pl_callback_thunk (CALL_SV, exception_handler,
                                         &callback_result, "S", $1,
                                         $1_descriptor);
+            SPAGAIN;
         } else {
             $result = SWIG_NewPointerObj($1, $1_descriptor, 0);
             argvi++;
@@ -548,6 +550,7 @@ svn_ ## TYPE ## _swig_rb_closed(VALUE se
 %typemap(in) apr_pool_t *pool "";
 %typemap(default) apr_pool_t *pool(apr_pool_t *_global_pool) {
     _global_pool = $1 = svn_swig_pl_make_pool (ST(items-1));
+    SPAGAIN;
 }
 #endif
 #ifdef SWIGRUBY
@@ -935,15 +938,24 @@ svn_ ## TYPE ## _swig_rb_closed(VALUE se
 #ifdef SWIGPERL
 %typemap(in) svn_stream_t * {
     svn_swig_pl_make_stream (&$1, $input);
+    SPAGAIN;
 }
 
 %typemap(out) svn_stream_t * {
-    $result = svn_swig_pl_from_stream ($1);
+    SV* tmp;
+    PUTBACK;
+    tmp = svn_swig_pl_from_stream ($1);
+    SPAGAIN;
+    $result = tmp;
     argvi++;
 }
 
 %typemap(argout) svn_stream_t ** {
-  %append_output(svn_swig_pl_from_stream(*$1));
+    SV *tmp;
+    PUTBACK;
+    tmp = svn_swig_pl_from_stream(*$1);
+    SPAGAIN;
+    %append_output(tmp);
 }
 #endif
 
@@ -1116,11 +1128,11 @@ svn_ ## TYPE ## _swig_rb_closed(VALUE se
 }
 
 %typemap(argout) unsigned char *result_digest {
-  /* FIXME: This code is clearly buggy. The return value of sv_newmortal()
-     is immediately overwritten by the return value
-     of svn_swig_pl_from_md5(). */
-    ST(argvi) = sv_newmortal();
-    ST(argvi++) = svn_swig_pl_from_md5($1);
+    SV *tmp;
+    PUTBACK;
+    tmp = svn_swig_pl_from_md5($1);
+    SPAGAIN;
+    %append_output(tmp);
 }
 #endif
 
@@ -1174,8 +1186,10 @@ svn_ ## TYPE ## _swig_rb_closed(VALUE se
 %typemap(in) svn_opt_revision_t * 
   (svn_opt_revision_t rev, apr_pool_t *_global_pool = NULL)
 {
-  if (_global_pool == NULL)
+  if (_global_pool == NULL) {
     _global_pool = svn_swig_pl_make_pool((SV *)NULL);
+    SPAGAIN;
+  }
   $1 = svn_swig_pl_set_revision(&rev, $input, TRUE, _global_pool);
 }
 #endif



Mime
View raw message