subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i...@apache.org
Subject svn commit: r1686174 [3/18] - in /subversion/branches/reuse-ra-session: ./ build/ build/ac-macros/ build/generator/ build/generator/templates/ subversion/bindings/javahl/ subversion/bindings/javahl/native/ subversion/bindings/javahl/native/jniwrapper/ ...
Date Thu, 18 Jun 2015 10:35:33 GMT
Modified: subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/EditorProxy.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/EditorProxy.cpp?rev=1686174&r1=1686173&r2=1686174&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/EditorProxy.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/EditorProxy.cpp Thu Jun 18 10:35:30 2015
@@ -123,7 +123,7 @@ get_editor_method(jmethodID& mid, const
     return SVN_NO_ERROR;        // Already known.
 
   JNIEnv* env = JNIUtil::getEnv();
-  jclass cls = env->FindClass(JAVA_PACKAGE"/ISVNEditor");
+  jclass cls = env->FindClass(JAVAHL_CLASS("/ISVNEditor"));
   SVN_JNI_CATCH(,SVN_ERR_RA_SVN_EDIT_ABORTED);
   SVN_JNI_CATCH(mid = env->GetMethodID(cls, name, sig),
                  SVN_ERR_RA_SVN_EDIT_ABORTED);
@@ -151,29 +151,32 @@ EditorProxy::cb_add_directory(void *bato
                               apr_pool_t *scratch_pool)
 {
   //DEBUG:fprintf(stderr, "  (n) EditorProxy::cb_add_directory('%s')\n", relpath);
-
-  EditorProxy* const ep = static_cast<EditorProxy*>(baton);
-  if (!ep->m_valid)
-    return invalid_editor();
-
-  static jmethodID mid = 0;
-  SVN_ERR(get_editor_method(mid, "addDirectory",
-                            "(Ljava/lang/String;"
-                            "Ljava/lang/Iterable;"
-                            "Ljava/util/Map;J)V"));
-
-  jstring jrelpath = JNIUtil::makeJString(relpath);
-  SVN_JNI_CATCH(,SVN_ERR_RA_SVN_EDIT_ABORTED);
-  jobject jchildren = (!children ? NULL : CreateJ::StringSet(children));
-  SVN_JNI_CATCH(,SVN_ERR_RA_SVN_EDIT_ABORTED);
-  jobject jprops = CreateJ::PropertyMap(props, scratch_pool);
-  SVN_JNI_CATCH(,SVN_ERR_RA_SVN_EDIT_ABORTED);
-
-  SVN_JNI_CATCH(
-      JNIUtil::getEnv()->CallVoidMethod(ep->m_jeditor, mid,
-                                        jrelpath, jchildren, jprops,
-                                        jlong(replaces_rev)),
-      SVN_ERR_RA_SVN_EDIT_ABORTED);
+  const ::Java::Env env;
+  SVN_JAVAHL_CATCH(env, SVN_ERR_RA_SVN_EDIT_ABORTED,
+    {
+      ::Java::LocalFrame frame(env);
+
+      EditorProxy* const ep = static_cast<EditorProxy*>(baton);
+      if (!ep->m_valid)
+        return invalid_editor();
+
+      static jmethodID mid = 0;
+      SVN_ERR(get_editor_method(mid, "addDirectory",
+                                "(Ljava/lang/String;"
+                                "Ljava/lang/Iterable;"
+                                "Ljava/util/Map;J)V"));
+
+      jstring jrelpath = JNIUtil::makeJString(relpath);
+      SVN_JAVAHL_OLDSTYLE_EXCEPTION_CHECK(env);
+      jobject jchildren = (!children ? NULL : CreateJ::StringSet(children));
+      SVN_JAVAHL_OLDSTYLE_EXCEPTION_CHECK(env);
+      jobject jprops = CreateJ::PropertyMap(props, scratch_pool);
+      SVN_JAVAHL_OLDSTYLE_EXCEPTION_CHECK(env);
+
+      env.CallVoidMethod(ep->m_jeditor, mid,
+                         jrelpath, jchildren, jprops,
+                         jlong(replaces_rev));
+    });
   return SVN_NO_ERROR;
 }
 
@@ -187,36 +190,37 @@ EditorProxy::cb_add_file(void *baton,
                          apr_pool_t *scratch_pool)
 {
   //DEBUG:fprintf(stderr, "  (n) EditorProxy::cb_add_file('%s')\n", relpath);
-
-  EditorProxy* const ep = static_cast<EditorProxy*>(baton);
-  if (!ep || !ep->m_valid)
-    return invalid_editor();
-
-  static jmethodID mid = 0;
-  SVN_ERR(get_editor_method(mid, "addFile",
-                            "(Ljava/lang/String;"
-                            "L"JAVA_PACKAGE"/types/Checksum;"
-                            "Ljava/io/InputStream;"
-                            "Ljava/util/Map;J)V"));
-
-  jstring jrelpath = JNIUtil::makeJString(relpath);
-  SVN_JNI_CATCH(,SVN_ERR_RA_SVN_EDIT_ABORTED);
-  jobject jchecksum = CreateJ::Checksum(checksum);
-  SVN_JNI_CATCH(,SVN_ERR_RA_SVN_EDIT_ABORTED);
-  jobject jcontents = NULL;
-  SVN_JNI_CATCH(,SVN_ERR_RA_SVN_EDIT_ABORTED);
-  jobject jprops = CreateJ::PropertyMap(props, scratch_pool);
-  SVN_JNI_CATCH(,SVN_ERR_RA_SVN_EDIT_ABORTED);
-
-  if (contents != NULL)
-    SVN_JAVAHL_CATCH(Java::Env(), SVN_ERR_RA_SVN_EDIT_ABORTED,
-                     jcontents = wrap_input_stream(contents));
-
-  SVN_JNI_CATCH(
-      JNIUtil::getEnv()->CallVoidMethod(ep->m_jeditor, mid,
-                                        jrelpath, jchecksum, jcontents,
-                                        jprops, jlong(replaces_rev)),
-      SVN_ERR_RA_SVN_EDIT_ABORTED);
+  const ::Java::Env env;
+  SVN_JAVAHL_CATCH(env, SVN_ERR_RA_SVN_EDIT_ABORTED,
+    {
+      ::Java::LocalFrame frame(env);
+
+      EditorProxy* const ep = static_cast<EditorProxy*>(baton);
+      if (!ep || !ep->m_valid)
+        return invalid_editor();
+
+      static jmethodID mid = 0;
+      SVN_ERR(get_editor_method(mid, "addFile",
+                                "(Ljava/lang/String;"
+                                JAVAHL_ARG("/types/Checksum;")
+                                "Ljava/io/InputStream;"
+                                "Ljava/util/Map;J)V"));
+
+      jstring jrelpath = JNIUtil::makeJString(relpath);
+      SVN_JAVAHL_OLDSTYLE_EXCEPTION_CHECK(env);
+      jobject jchecksum = CreateJ::Checksum(checksum);
+      SVN_JAVAHL_OLDSTYLE_EXCEPTION_CHECK(env);
+      jobject jprops = CreateJ::PropertyMap(props, scratch_pool);
+      SVN_JAVAHL_OLDSTYLE_EXCEPTION_CHECK(env);
+
+      jobject jcontents = NULL;
+      if (contents != NULL)
+        jcontents = wrap_input_stream(contents);
+
+      env.CallVoidMethod(ep->m_jeditor, mid,
+                         jrelpath, jchecksum, jcontents,
+                         jprops, jlong(replaces_rev));
+    });
   return SVN_NO_ERROR;
 }
 
@@ -229,29 +233,32 @@ EditorProxy::cb_add_symlink(void *baton,
                             apr_pool_t *scratch_pool)
 {
   //DEBUG:fprintf(stderr, "  (n) EditorProxy::cb_add_symlink('%s')\n", relpath);
-
-  EditorProxy* const ep = static_cast<EditorProxy*>(baton);
-  if (!ep || !ep->m_valid)
-    return invalid_editor();
-
-  static jmethodID mid = 0;
-  SVN_ERR(get_editor_method(mid, "addSymlink",
-                            "(Ljava/lang/String;"
-                            "Ljava/lang/String;"
-                            "Ljava/util/Map;J)V"));
-
-  jstring jrelpath = JNIUtil::makeJString(relpath);
-  SVN_JNI_CATCH(,SVN_ERR_RA_SVN_EDIT_ABORTED);
-  jstring jtarget = JNIUtil::makeJString(target);
-  SVN_JNI_CATCH(,SVN_ERR_RA_SVN_EDIT_ABORTED);
-  jobject jprops = CreateJ::PropertyMap(props, scratch_pool);
-  SVN_JNI_CATCH(,SVN_ERR_RA_SVN_EDIT_ABORTED);
-
-  SVN_JNI_CATCH(
-      JNIUtil::getEnv()->CallVoidMethod(ep->m_jeditor, mid,
-                                        jrelpath, jtarget, jprops,
-                                        jlong(replaces_rev)),
-      SVN_ERR_RA_SVN_EDIT_ABORTED);
+  const ::Java::Env env;
+  SVN_JAVAHL_CATCH(env, SVN_ERR_RA_SVN_EDIT_ABORTED,
+    {
+      ::Java::LocalFrame frame(env);
+
+      EditorProxy* const ep = static_cast<EditorProxy*>(baton);
+      if (!ep || !ep->m_valid)
+        return invalid_editor();
+
+      static jmethodID mid = 0;
+      SVN_ERR(get_editor_method(mid, "addSymlink",
+                                "(Ljava/lang/String;"
+                                "Ljava/lang/String;"
+                                "Ljava/util/Map;J)V"));
+
+      jstring jrelpath = JNIUtil::makeJString(relpath);
+      SVN_JAVAHL_OLDSTYLE_EXCEPTION_CHECK(env);
+      jstring jtarget = JNIUtil::makeJString(target);
+      SVN_JAVAHL_OLDSTYLE_EXCEPTION_CHECK(env);
+      jobject jprops = CreateJ::PropertyMap(props, scratch_pool);
+      SVN_JAVAHL_OLDSTYLE_EXCEPTION_CHECK(env);
+
+      env.CallVoidMethod(ep->m_jeditor, mid,
+                         jrelpath, jtarget, jprops,
+                         jlong(replaces_rev));
+    });
   return SVN_NO_ERROR;
 }
 
@@ -263,27 +270,30 @@ EditorProxy::cb_add_absent(void *baton,
                            apr_pool_t *scratch_pool)
 {
   //DEBUG:fprintf(stderr, "  (n) EditorProxy::cb_add_absent('%s')\n", relpath);
-
-  EditorProxy* const ep = static_cast<EditorProxy*>(baton);
-  if (!ep || !ep->m_valid)
-    return invalid_editor();
-
-  static jmethodID mid = 0;
-  SVN_ERR(get_editor_method(mid, "addAbsent",
-                            "(Ljava/lang/String;"
-                            "L"JAVA_PACKAGE"/types/NodeKind;"
-                            "J)V"));
-
-  jstring jrelpath = JNIUtil::makeJString(relpath);
-  SVN_JNI_CATCH(,SVN_ERR_RA_SVN_EDIT_ABORTED);
-  jobject jkind = EnumMapper::mapNodeKind(kind);
-  SVN_JNI_CATCH(,SVN_ERR_RA_SVN_EDIT_ABORTED);
-
-  SVN_JNI_CATCH(
-      JNIUtil::getEnv()->CallVoidMethod(ep->m_jeditor, mid,
-                                        jrelpath, jkind,
-                                        jlong(replaces_rev)),
-      SVN_ERR_RA_SVN_EDIT_ABORTED);
+  const ::Java::Env env;
+  SVN_JAVAHL_CATCH(env, SVN_ERR_RA_SVN_EDIT_ABORTED,
+    {
+      ::Java::LocalFrame frame(env);
+
+      EditorProxy* const ep = static_cast<EditorProxy*>(baton);
+      if (!ep || !ep->m_valid)
+        return invalid_editor();
+
+      static jmethodID mid = 0;
+      SVN_ERR(get_editor_method(mid, "addAbsent",
+                                "(Ljava/lang/String;"
+                                JAVAHL_ARG("/types/NodeKind;")
+                                "J)V"));
+
+      jstring jrelpath = JNIUtil::makeJString(relpath);
+      SVN_JAVAHL_OLDSTYLE_EXCEPTION_CHECK(env);
+      jobject jkind = EnumMapper::mapNodeKind(kind);
+      SVN_JAVAHL_OLDSTYLE_EXCEPTION_CHECK(env);
+
+      env.CallVoidMethod(ep->m_jeditor, mid,
+                         jrelpath, jkind,
+                         jlong(replaces_rev));
+    });
   return SVN_NO_ERROR;
 }
 
@@ -297,29 +307,32 @@ EditorProxy::cb_alter_directory(void *ba
 {
   //DEBUG:fprintf(stderr, "  (n) EditorProxy::cb_alter_directory('%s', r%lld)\n",
   //DEBUG:        relpath, static_cast<long long>(revision));
-
-  EditorProxy* const ep = static_cast<EditorProxy*>(baton);
-  if (!ep || !ep->m_valid)
-    return invalid_editor();
-
-  static jmethodID mid = 0;
-  SVN_ERR(get_editor_method(mid, "alterDirectory",
-                            "(Ljava/lang/String;J"
-                            "Ljava/lang/Iterable;"
-                            "Ljava/util/Map;)V"));
-
-  jstring jrelpath = JNIUtil::makeJString(relpath);
-  SVN_JNI_CATCH(,SVN_ERR_RA_SVN_EDIT_ABORTED);
-  jobject jchildren = (!children ? NULL : CreateJ::StringSet(children));
-  SVN_JNI_CATCH(,SVN_ERR_RA_SVN_EDIT_ABORTED);
-  jobject jprops = CreateJ::PropertyMap(props, scratch_pool);
-  SVN_JNI_CATCH(,SVN_ERR_RA_SVN_EDIT_ABORTED);
-
-  SVN_JNI_CATCH(
-      JNIUtil::getEnv()->CallVoidMethod(ep->m_jeditor, mid,
-                                        jrelpath, jlong(revision),
-                                        jchildren, jprops),
-      SVN_ERR_RA_SVN_EDIT_ABORTED);
+  const ::Java::Env env;
+  SVN_JAVAHL_CATCH(env, SVN_ERR_RA_SVN_EDIT_ABORTED,
+    {
+      ::Java::LocalFrame frame(env);
+
+      EditorProxy* const ep = static_cast<EditorProxy*>(baton);
+      if (!ep || !ep->m_valid)
+        return invalid_editor();
+
+      static jmethodID mid = 0;
+      SVN_ERR(get_editor_method(mid, "alterDirectory",
+                                "(Ljava/lang/String;J"
+                                "Ljava/lang/Iterable;"
+                                "Ljava/util/Map;)V"));
+
+      jstring jrelpath = JNIUtil::makeJString(relpath);
+      SVN_JAVAHL_OLDSTYLE_EXCEPTION_CHECK(env);
+      jobject jchildren = (!children ? NULL : CreateJ::StringSet(children));
+      SVN_JAVAHL_OLDSTYLE_EXCEPTION_CHECK(env);
+      jobject jprops = CreateJ::PropertyMap(props, scratch_pool);
+      SVN_JAVAHL_OLDSTYLE_EXCEPTION_CHECK(env);
+
+      env.CallVoidMethod(ep->m_jeditor, mid,
+                         jrelpath, jlong(revision),
+                         jchildren, jprops);
+    });
   return SVN_NO_ERROR;
 }
 
@@ -334,36 +347,37 @@ EditorProxy::cb_alter_file(void *baton,
 {
   //DEBUG:fprintf(stderr, "  (n) EditorProxy::cb_alter_file('%s', r%lld)\n",
   //DEBUG:        relpath, static_cast<long long>(revision));
-
-  EditorProxy* const ep = static_cast<EditorProxy*>(baton);
-  if (!ep || !ep->m_valid)
-    return invalid_editor();
-
-  static jmethodID mid = 0;
-  SVN_ERR(get_editor_method(mid, "alterFile",
-                            "(Ljava/lang/String;J"
-                            "L"JAVA_PACKAGE"/types/Checksum;"
-                            "Ljava/io/InputStream;"
-                            "Ljava/util/Map;)V"));
-
-  jstring jrelpath = JNIUtil::makeJString(relpath);
-  SVN_JNI_CATCH(,SVN_ERR_RA_SVN_EDIT_ABORTED);
-  jobject jchecksum = CreateJ::Checksum(checksum);
-  SVN_JNI_CATCH(,SVN_ERR_RA_SVN_EDIT_ABORTED);
-  jobject jcontents = NULL;
-  SVN_JNI_CATCH(,SVN_ERR_RA_SVN_EDIT_ABORTED);
-  jobject jprops = CreateJ::PropertyMap(props, scratch_pool);
-  SVN_JNI_CATCH(,SVN_ERR_RA_SVN_EDIT_ABORTED);
-
-  if (contents != NULL)
-    SVN_JAVAHL_CATCH(Java::Env(), SVN_ERR_RA_SVN_EDIT_ABORTED,
-                     jcontents = wrap_input_stream(contents));
-
-  SVN_JNI_CATCH(
-      JNIUtil::getEnv()->CallVoidMethod(ep->m_jeditor, mid,
-                                        jrelpath, jlong(revision),
-                                        jchecksum, jcontents, jprops),
-      SVN_ERR_RA_SVN_EDIT_ABORTED);
+  const ::Java::Env env;
+  SVN_JAVAHL_CATCH(env, SVN_ERR_RA_SVN_EDIT_ABORTED,
+    {
+      ::Java::LocalFrame frame(env);
+
+      EditorProxy* const ep = static_cast<EditorProxy*>(baton);
+      if (!ep || !ep->m_valid)
+        return invalid_editor();
+
+      static jmethodID mid = 0;
+      SVN_ERR(get_editor_method(mid, "alterFile",
+                                "(Ljava/lang/String;J"
+                                JAVAHL_ARG("/types/Checksum;")
+                                "Ljava/io/InputStream;"
+                                "Ljava/util/Map;)V"));
+
+      jstring jrelpath = JNIUtil::makeJString(relpath);
+      SVN_JAVAHL_OLDSTYLE_EXCEPTION_CHECK(env);
+      jobject jchecksum = CreateJ::Checksum(checksum);
+      SVN_JAVAHL_OLDSTYLE_EXCEPTION_CHECK(env);
+      jobject jprops = CreateJ::PropertyMap(props, scratch_pool);
+      SVN_JAVAHL_OLDSTYLE_EXCEPTION_CHECK(env);
+
+      jobject jcontents = NULL;
+      if (contents != NULL)
+        jcontents = wrap_input_stream(contents);
+
+      env.CallVoidMethod(ep->m_jeditor, mid,
+                         jrelpath, jlong(revision),
+                         jchecksum, jcontents, jprops);
+    });
   return SVN_NO_ERROR;
 }
 
@@ -377,29 +391,32 @@ EditorProxy::cb_alter_symlink(void *bato
 {
   //DEBUG:fprintf(stderr, "  (n) EditorProxy::cb_alter_symlink('%s', r%lld)\n",
   //DEBUG:        relpath, static_cast<long long>(revision));
-
-  EditorProxy* const ep = static_cast<EditorProxy*>(baton);
-  if (!ep || !ep->m_valid)
-    return invalid_editor();
-
-  static jmethodID mid = 0;
-  SVN_ERR(get_editor_method(mid, "alterSymlink",
-                            "(Ljava/lang/String;J"
-                            "Ljava/lang/String;"
-                            "Ljava/util/Map;)V"));
-
-  jstring jrelpath = JNIUtil::makeJString(relpath);
-  SVN_JNI_CATCH(,SVN_ERR_RA_SVN_EDIT_ABORTED);
-  jstring jtarget = JNIUtil::makeJString(target);
-  SVN_JNI_CATCH(,SVN_ERR_RA_SVN_EDIT_ABORTED);
-  jobject jprops = CreateJ::PropertyMap(props, scratch_pool);
-  SVN_JNI_CATCH(,SVN_ERR_RA_SVN_EDIT_ABORTED);
-
-  SVN_JNI_CATCH(
-      JNIUtil::getEnv()->CallVoidMethod(ep->m_jeditor, mid,
-                                        jrelpath, jlong(revision),
-                                        jtarget, jprops),
-      SVN_ERR_RA_SVN_EDIT_ABORTED);
+  const ::Java::Env env;
+  SVN_JAVAHL_CATCH(env, SVN_ERR_RA_SVN_EDIT_ABORTED,
+    {
+      ::Java::LocalFrame frame(env);
+
+      EditorProxy* const ep = static_cast<EditorProxy*>(baton);
+      if (!ep || !ep->m_valid)
+        return invalid_editor();
+
+      static jmethodID mid = 0;
+      SVN_ERR(get_editor_method(mid, "alterSymlink",
+                                "(Ljava/lang/String;J"
+                                "Ljava/lang/String;"
+                                "Ljava/util/Map;)V"));
+
+      jstring jrelpath = JNIUtil::makeJString(relpath);
+      SVN_JAVAHL_OLDSTYLE_EXCEPTION_CHECK(env);
+      jstring jtarget = JNIUtil::makeJString(target);
+      SVN_JAVAHL_OLDSTYLE_EXCEPTION_CHECK(env);
+      jobject jprops = CreateJ::PropertyMap(props, scratch_pool);
+      SVN_JAVAHL_OLDSTYLE_EXCEPTION_CHECK(env);
+
+      env.CallVoidMethod(ep->m_jeditor, mid,
+                         jrelpath, jlong(revision),
+                         jtarget, jprops);
+    });
   return SVN_NO_ERROR;
 }
 
@@ -411,21 +428,24 @@ EditorProxy::cb_delete(void *baton,
 {
   //DEBUG:fprintf(stderr, "  (n) EditorProxy::cb_delete('%s', r%lld)\n",
   //DEBUG:        relpath, static_cast<long long>(revision));
+  const ::Java::Env env;
+  SVN_JAVAHL_CATCH(env, SVN_ERR_RA_SVN_EDIT_ABORTED,
+    {
+      ::Java::LocalFrame frame(env);
+
+      EditorProxy* const ep = static_cast<EditorProxy*>(baton);
+      if (!ep || !ep->m_valid)
+        return invalid_editor();
+
+      static jmethodID mid = 0;
+      SVN_ERR(get_editor_method(mid, "delete",
+                                "(Ljava/lang/String;J)V"));
 
-  EditorProxy* const ep = static_cast<EditorProxy*>(baton);
-  if (!ep || !ep->m_valid)
-    return invalid_editor();
-
-  static jmethodID mid = 0;
-  SVN_ERR(get_editor_method(mid, "delete",
-                            "(Ljava/lang/String;J)V"));
+      jstring jrelpath = JNIUtil::makeJString(relpath);
+      SVN_JAVAHL_OLDSTYLE_EXCEPTION_CHECK(env);
 
-  jstring jrelpath = JNIUtil::makeJString(relpath);
-  SVN_JNI_CATCH(,SVN_ERR_RA_SVN_EDIT_ABORTED);
-
-  SVN_JNI_CATCH(
-      JNIUtil::getEnv()->CallVoidMethod(ep->m_jeditor, mid, jrelpath),
-      SVN_ERR_RA_SVN_EDIT_ABORTED);
+      env.CallVoidMethod(ep->m_jeditor, mid, jrelpath);
+    });
   return SVN_NO_ERROR;
 }
 
@@ -439,26 +459,29 @@ EditorProxy::cb_copy(void *baton,
 {
   //DEBUG:fprintf(stderr, "  (n) EditorProxy::cb_copy('%s', r%lld, '%s')\n",
   //DEBUG:        src_relpath, static_cast<long long>(src_revision), dst_relpath);
-
-  EditorProxy* const ep = static_cast<EditorProxy*>(baton);
-  if (!ep || !ep->m_valid)
-    return invalid_editor();
-
-  static jmethodID mid = 0;
-  SVN_ERR(get_editor_method(mid, "copy",
-                            "(Ljava/lang/String;J"
-                            "Ljava/lang/String;J)V"));
-
-  jstring jsrc_relpath = JNIUtil::makeJString(src_relpath);
-  SVN_JNI_CATCH(,SVN_ERR_RA_SVN_EDIT_ABORTED);
-  jstring jdst_relpath = JNIUtil::makeJString(dst_relpath);
-  SVN_JNI_CATCH(,SVN_ERR_RA_SVN_EDIT_ABORTED);
-
-  SVN_JNI_CATCH(
-      JNIUtil::getEnv()->CallVoidMethod(ep->m_jeditor, mid,
-                                        jsrc_relpath, jlong(src_revision),
-                                        jdst_relpath, jlong(replaces_rev)),
-      SVN_ERR_RA_SVN_EDIT_ABORTED);
+  const ::Java::Env env;
+  SVN_JAVAHL_CATCH(env, SVN_ERR_RA_SVN_EDIT_ABORTED,
+    {
+      ::Java::LocalFrame frame(env);
+
+      EditorProxy* const ep = static_cast<EditorProxy*>(baton);
+      if (!ep || !ep->m_valid)
+        return invalid_editor();
+
+      static jmethodID mid = 0;
+      SVN_ERR(get_editor_method(mid, "copy",
+                                "(Ljava/lang/String;J"
+                                "Ljava/lang/String;J)V"));
+
+      jstring jsrc_relpath = JNIUtil::makeJString(src_relpath);
+      SVN_JAVAHL_OLDSTYLE_EXCEPTION_CHECK(env);
+      jstring jdst_relpath = JNIUtil::makeJString(dst_relpath);
+      SVN_JAVAHL_OLDSTYLE_EXCEPTION_CHECK(env);
+
+      env.CallVoidMethod(ep->m_jeditor, mid,
+                         jsrc_relpath, jlong(src_revision),
+                         jdst_relpath, jlong(replaces_rev));
+    });
   return SVN_NO_ERROR;
 }
 
@@ -472,26 +495,29 @@ EditorProxy::cb_move(void *baton,
 {
   //DEBUG:fprintf(stderr, "  (n) EditorProxy::cb_move('%s', r%lld, '%s')\n",
   //DEBUG:        src_relpath, static_cast<long long>(src_revision), dst_relpath);
-
-  EditorProxy* const ep = static_cast<EditorProxy*>(baton);
-  if (!ep || !ep->m_valid)
-    return invalid_editor();
-
-  static jmethodID mid = 0;
-  SVN_ERR(get_editor_method(mid, "move",
-                            "(Ljava/lang/String;J"
-                            "Ljava/lang/String;J)V"));
-
-  jstring jsrc_relpath = JNIUtil::makeJString(src_relpath);
-  SVN_JNI_CATCH(,SVN_ERR_RA_SVN_EDIT_ABORTED);
-  jstring jdst_relpath = JNIUtil::makeJString(dst_relpath);
-  SVN_JNI_CATCH(,SVN_ERR_RA_SVN_EDIT_ABORTED);
-
-  SVN_JNI_CATCH(
-      JNIUtil::getEnv()->CallVoidMethod(ep->m_jeditor, mid,
-                                        jsrc_relpath, jlong(src_revision),
-                                        jdst_relpath, jlong(replaces_rev)),
-      SVN_ERR_RA_SVN_EDIT_ABORTED);
+  const ::Java::Env env;
+  SVN_JAVAHL_CATCH(env, SVN_ERR_RA_SVN_EDIT_ABORTED,
+    {
+      ::Java::LocalFrame frame(env);
+
+      EditorProxy* const ep = static_cast<EditorProxy*>(baton);
+      if (!ep || !ep->m_valid)
+        return invalid_editor();
+
+      static jmethodID mid = 0;
+      SVN_ERR(get_editor_method(mid, "move",
+                                "(Ljava/lang/String;J"
+                                "Ljava/lang/String;J)V"));
+
+      jstring jsrc_relpath = JNIUtil::makeJString(src_relpath);
+      SVN_JAVAHL_OLDSTYLE_EXCEPTION_CHECK(env);
+      jstring jdst_relpath = JNIUtil::makeJString(dst_relpath);
+      SVN_JAVAHL_OLDSTYLE_EXCEPTION_CHECK(env);
+
+      env.CallVoidMethod(ep->m_jeditor, mid,
+                         jsrc_relpath, jlong(src_revision),
+                         jdst_relpath, jlong(replaces_rev));
+    });
   return SVN_NO_ERROR;
 }
 
@@ -499,18 +525,21 @@ svn_error_t*
 EditorProxy::cb_complete(void *baton, apr_pool_t *scratch_pool)
 {
   //DEBUG:fprintf(stderr, "  (n) EditorProxy::cb_complete()\n");
+  const ::Java::Env env;
+  SVN_JAVAHL_CATCH(env, SVN_ERR_RA_SVN_EDIT_ABORTED,
+    {
+      ::Java::LocalFrame frame(env);
+
+      EditorProxy* const ep = static_cast<EditorProxy*>(baton);
+      if (!ep || !ep->m_valid)
+        return invalid_editor();
+      ep->m_valid = false;
+
+      static jmethodID mid = 0;
+      SVN_ERR(get_editor_method(mid, "complete", "()V"));
 
-  EditorProxy* const ep = static_cast<EditorProxy*>(baton);
-  if (!ep || !ep->m_valid)
-    return invalid_editor();
-  ep->m_valid = false;
-
-  static jmethodID mid = 0;
-  SVN_ERR(get_editor_method(mid, "complete", "()V"));
-
-  SVN_JNI_CATCH(
-      JNIUtil::getEnv()->CallVoidMethod(ep->m_jeditor, mid),
-      SVN_ERR_RA_SVN_EDIT_ABORTED);
+      env.CallVoidMethod(ep->m_jeditor, mid);
+    });
   return SVN_NO_ERROR;
 }
 
@@ -518,17 +547,20 @@ svn_error_t*
 EditorProxy::cb_abort(void *baton, apr_pool_t *scratch_pool)
 {
   //DEBUG:fprintf(stderr, "  (n) EditorProxy::cb_abort()\n");
+  const ::Java::Env env;
+  SVN_JAVAHL_CATCH(env, SVN_ERR_RA_SVN_EDIT_ABORTED,
+    {
+      ::Java::LocalFrame frame(env);
+
+      EditorProxy* const ep = static_cast<EditorProxy*>(baton);
+      if (!ep || !ep->m_valid)
+        return invalid_editor();
+      ep->m_valid = false;
+
+      static jmethodID mid = 0;
+      SVN_ERR(get_editor_method(mid, "abort", "()V"));
 
-  EditorProxy* const ep = static_cast<EditorProxy*>(baton);
-  if (!ep || !ep->m_valid)
-    return invalid_editor();
-  ep->m_valid = false;
-
-  static jmethodID mid = 0;
-  SVN_ERR(get_editor_method(mid, "abort", "()V"));
-
-  SVN_JNI_CATCH(
-      JNIUtil::getEnv()->CallVoidMethod(ep->m_jeditor, mid),
-      SVN_ERR_RA_SVN_EDIT_ABORTED);
+      env.CallVoidMethod(ep->m_jeditor, mid);
+    });
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/EditorProxy.h
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/EditorProxy.h?rev=1686174&r1=1686173&r2=1686174&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/EditorProxy.h (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/EditorProxy.h Thu Jun 18 10:35:30 2015
@@ -27,6 +27,8 @@
 #ifndef JAVAHL_EDITOR_PROXY_H
 #define JAVAHL_EDITOR_PROXY_H
 
+#include <memory>
+
 #include "svn_delta.h"
 #include "private/svn_editor.h"
 #include "private/svn_delta_private.h"
@@ -51,6 +53,8 @@ struct EditorProxyCallbacks
 class EditorProxy
 {
 public:
+  typedef std::auto_ptr<EditorProxy> UniquePtr;
+
   EditorProxy(jobject jeditor, apr_pool_t* edit_pool,
               const char* repos_root_url, const char* base_relpath,
               svn_cancel_func_t cancel_func, void* cancel_baton,

Modified: subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/EnumMapper.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/EnumMapper.cpp?rev=1686174&r1=1686173&r2=1686174&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/EnumMapper.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/EnumMapper.cpp Thu Jun 18 10:35:30 2015
@@ -37,13 +37,13 @@ jobject EnumMapper::mapChangePathAction(
   switch (action)
     {
       case 'A':
-        return mapEnum(JAVA_PACKAGE"/types/ChangePath$Action", 0);
+        return mapEnum(JAVAHL_CLASS("/types/ChangePath$Action"), 0);
       case 'D':
-        return mapEnum(JAVA_PACKAGE"/types/ChangePath$Action", 1);
+        return mapEnum(JAVAHL_CLASS("/types/ChangePath$Action"), 1);
       case 'R':
-        return mapEnum(JAVA_PACKAGE"/types/ChangePath$Action", 2);
+        return mapEnum(JAVAHL_CLASS("/types/ChangePath$Action"), 2);
       case 'M':
-        return mapEnum(JAVA_PACKAGE"/types/ChangePath$Action", 3);
+        return mapEnum(JAVAHL_CLASS("/types/ChangePath$Action"), 3);
       default:
         return NULL;
     }
@@ -55,7 +55,7 @@ jobject EnumMapper::mapChangePathAction(
 jobject EnumMapper::mapNotifyState(svn_wc_notify_state_t state)
 {
   // We're assuming a valid value for the C enum above
-  return mapEnum(JAVA_PACKAGE"/ClientNotifyInformation$Status",
+  return mapEnum(JAVAHL_CLASS("/ClientNotifyInformation$Status"),
                  static_cast<int>(state));
 }
 
@@ -65,14 +65,14 @@ jobject EnumMapper::mapNotifyState(svn_w
 jobject EnumMapper::mapNotifyAction(svn_wc_notify_action_t action)
 {
   // We're assuming a valid value for the C enum above
-  return mapEnum(JAVA_PACKAGE"/ClientNotifyInformation$Action",
+  return mapEnum(JAVAHL_CLASS("/ClientNotifyInformation$Action"),
                  static_cast<int>(action));
 }
 
 jobject EnumMapper::mapReposNotifyNodeAction(svn_node_action action)
 {
   // We're assuming a valid value for the C enum above
-  return mapEnum(JAVA_PACKAGE"/ReposNotifyInformation$NodeAction",
+  return mapEnum(JAVAHL_CLASS("/ReposNotifyInformation$NodeAction"),
                  static_cast<int>(action));
 }
 
@@ -82,7 +82,7 @@ jobject EnumMapper::mapReposNotifyNodeAc
 jobject EnumMapper::mapReposNotifyAction(svn_repos_notify_action_t action)
 {
   // We're assuming a valid value for the C enum above
-  return mapEnum(JAVA_PACKAGE"/ReposNotifyInformation$Action",
+  return mapEnum(JAVAHL_CLASS("/ReposNotifyInformation$Action"),
                  static_cast<int>(action));
 }
 
@@ -92,7 +92,7 @@ jobject EnumMapper::mapReposNotifyAction
 jobject EnumMapper::mapNodeKind(svn_node_kind_t nodeKind)
 {
   // We're assuming a valid value for the C enum above
-  return mapEnum(JAVA_PACKAGE"/types/NodeKind",
+  return mapEnum(JAVAHL_CLASS("/types/NodeKind"),
                  static_cast<int>(nodeKind));
 }
 
@@ -102,7 +102,7 @@ jobject EnumMapper::mapNodeKind(svn_node
 jobject EnumMapper::mapNotifyLockState(svn_wc_notify_lock_state_t state)
 {
   // We're assuming a valid value for the C enum above
-  return mapEnum(JAVA_PACKAGE"/ClientNotifyInformation$LockStatus",
+  return mapEnum(JAVAHL_CLASS("/ClientNotifyInformation$LockStatus"),
                  static_cast<int>(state));
 }
 
@@ -112,7 +112,7 @@ jobject EnumMapper::mapNotifyLockState(s
 jobject EnumMapper::mapScheduleKind(svn_wc_schedule_t schedule)
 {
   // We're assuming a valid value for the C enum above
-  return mapEnum(JAVA_PACKAGE"/types/Info$ScheduleKind",
+  return mapEnum(JAVAHL_CLASS("/types/Info$ScheduleKind"),
                  static_cast<int>(schedule));
 }
 
@@ -123,63 +123,63 @@ jobject EnumMapper::mapStatusKind(svn_wc
 {
   // We're assuming a valid value for the C enum above
   // The offset here is +1
-  return mapEnum(JAVA_PACKAGE"/types/Status$Kind",
+  return mapEnum(JAVAHL_CLASS("/types/Status$Kind"),
                  static_cast<int>(svnKind) - 1);
 }
 
 jobject EnumMapper::mapChecksumKind(svn_checksum_kind_t kind)
 {
   // We're assuming a valid value for the C enum above
-  return mapEnum(JAVA_PACKAGE"/types/Checksum$Kind",
+  return mapEnum(JAVAHL_CLASS("/types/Checksum$Kind"),
                  static_cast<int>(kind));
 }
 
 jobject EnumMapper::mapConflictKind(svn_wc_conflict_kind_t kind)
 {
   // We're assuming a valid value for the C enum above
-  return mapEnum(JAVA_PACKAGE"/ConflictDescriptor$Kind",
+  return mapEnum(JAVAHL_CLASS("/ConflictDescriptor$Kind"),
                  static_cast<int>(kind));
 }
 
 jobject EnumMapper::mapConflictAction(svn_wc_conflict_action_t action)
 {
   // We're assuming a valid value for the C enum above
-  return mapEnum(JAVA_PACKAGE"/ConflictDescriptor$Action",
+  return mapEnum(JAVAHL_CLASS("/ConflictDescriptor$Action"),
                  static_cast<int>(action));
 }
 
 jobject EnumMapper::mapConflictReason(svn_wc_conflict_reason_t reason)
 {
   // We're assuming a valid value for the C enum above
-  return mapEnum(JAVA_PACKAGE"/ConflictDescriptor$Reason",
+  return mapEnum(JAVAHL_CLASS("/ConflictDescriptor$Reason"),
                  static_cast<int>(reason));
 }
 
 int EnumMapper::toMergeinfoLogKind(jobject jLogKind)
 {
-  return getOrdinal(JAVA_PACKAGE"/types/Mergeinfo$LogKind", jLogKind);
+  return getOrdinal(JAVAHL_CLASS("/types/Mergeinfo$LogKind"), jLogKind);
 }
 
 int EnumMapper::toLogLevel(jobject jLogLevel)
 {
-  return getOrdinal(JAVA_PACKAGE"/SVNClient$ClientLogLevel", jLogLevel);
+  return getOrdinal(JAVAHL_CLASS("/SVNClient$ClientLogLevel"), jLogLevel);
 }
 
 svn_node_kind_t EnumMapper::toNodeKind(jobject jNodeKind)
 {
   return svn_node_kind_t(
-      getOrdinal(JAVA_PACKAGE"/types/NodeKind", jNodeKind));
+      getOrdinal(JAVAHL_CLASS("/types/NodeKind"), jNodeKind));
 }
 
 svn_checksum_kind_t EnumMapper::toChecksumKind(jobject jChecksumKind)
 {
   return svn_checksum_kind_t(
-      getOrdinal(JAVA_PACKAGE"/types/Checksum$Kind", jChecksumKind));
+      getOrdinal(JAVAHL_CLASS("/types/Checksum$Kind"), jChecksumKind));
 }
 
 svn_tristate_t EnumMapper::toTristate(jobject jTristate)
 {
-  switch (getOrdinal(JAVA_PACKAGE"/types/Tristate", jTristate))
+  switch (getOrdinal(JAVAHL_CLASS("/types/Tristate"), jTristate))
     {
     case 1: return svn_tristate_false;
     case 2: return svn_tristate_true;
@@ -190,14 +190,14 @@ svn_tristate_t EnumMapper::toTristate(jo
 svn_depth_t EnumMapper::toDepth(jobject jdepth)
 {
   // The offset for depths is -2
-  return static_cast<svn_depth_t>(getOrdinal(JAVA_PACKAGE"/types/Depth", jdepth) - 2);
+  return static_cast<svn_depth_t>(getOrdinal(JAVAHL_CLASS("/types/Depth"), jdepth) - 2);
 }
 
 svn_mergeinfo_inheritance_t
 EnumMapper::toMergeinfoInheritance(jobject jInheritance)
 {
   return static_cast<svn_mergeinfo_inheritance_t>(
-      getOrdinal(JAVA_PACKAGE"/types/Mergeinfo$Inheritance", jInheritance));
+      getOrdinal(JAVAHL_CLASS("/types/Mergeinfo$Inheritance"), jInheritance));
 }
 
 
@@ -205,39 +205,39 @@ jobject EnumMapper::mapDepth(svn_depth_t
 {
   // We're assuming a valid value for the C enum above
   // The offset for depths is -2
-  return mapEnum(JAVA_PACKAGE"/types/Depth", static_cast<int>(depth) + 2);
+  return mapEnum(JAVAHL_CLASS("/types/Depth"), static_cast<int>(depth) + 2);
 }
 
 jobject EnumMapper::mapOperation(svn_wc_operation_t operation)
 {
   // We're assuming a valid value for the C enum above
-  return mapEnum(JAVA_PACKAGE"/ConflictDescriptor$Operation",
+  return mapEnum(JAVAHL_CLASS("/ConflictDescriptor$Operation"),
                  static_cast<int>(operation));
 }
 
 jobject EnumMapper::mapTristate(svn_tristate_t tristate)
 {
   // We're assuming a valid value for the C enum above
-  return mapEnum(JAVA_PACKAGE"/types/Tristate",
+  return mapEnum(JAVAHL_CLASS("/types/Tristate"),
                  static_cast<int>(tristate - svn_tristate_false));
 }
 
 svn_wc_conflict_choice_t EnumMapper::toConflictChoice(jobject jchoice)
 {
   return static_cast<svn_wc_conflict_choice_t>
-             (getOrdinal(JAVA_PACKAGE"/ConflictResult$Choice", jchoice));
+             (getOrdinal(JAVAHL_CLASS("/ConflictResult$Choice"), jchoice));
 }
 
 svn_opt_revision_kind EnumMapper::toRevisionKind(jobject jkind)
 {
   return static_cast<svn_opt_revision_kind>
-             (getOrdinal(JAVA_PACKAGE"/types/Revision$Kind", jkind));
+             (getOrdinal(JAVAHL_CLASS("/types/Revision$Kind"), jkind));
 }
 
 jobject EnumMapper::mapSummarizeKind(svn_client_diff_summarize_kind_t sKind)
 {
   // We're assuming a valid value for the C enum above
-  return mapEnum(JAVA_PACKAGE"/DiffSummary$DiffKind",
+  return mapEnum(JAVAHL_CLASS("/DiffSummary$DiffKind"),
                  static_cast<int>(sKind));
 }
 

Modified: subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/ExternalItem.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/ExternalItem.cpp?rev=1686174&r1=1686173&r2=1686174&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/ExternalItem.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/ExternalItem.cpp Thu Jun 18 10:35:30 2015
@@ -29,21 +29,22 @@
 namespace JavaHL {
 
 const char* const ExternalItem::m_class_name =
-  JAVA_PACKAGE"/types/ExternalItem";
+  JAVAHL_CLASS("/types/ExternalItem");
 
 ExternalItem::ClassImpl::ClassImpl(::Java::Env env, jclass cls)
   : ::Java::Object::ClassImpl(env, cls),
     m_mid_ctor(
         env.GetMethodID(cls, "<init>",
                         "(ZLjava/lang/String;Ljava/lang/String;"
-                        "L"JAVA_PACKAGE"/types/Revision;"
-                        "L"JAVA_PACKAGE"/types/Revision;)V")),
+                        JAVAHL_ARG("/types/Revision;")
+                        JAVAHL_ARG("/types/Revision;")
+                        ")V")),
     m_fid_target_dir(env.GetFieldID(cls, "targetDir", "Ljava/lang/String;")),
     m_fid_url(env.GetFieldID(cls, "url", "Ljava/lang/String;")),
     m_fid_revision(env.GetFieldID(cls, "revision",
-                                  "L"JAVA_PACKAGE"/types/Revision;")),
+                                  JAVAHL_ARG("/types/Revision;"))),
     m_fid_peg_revision(env.GetFieldID(cls, "pegRevision",
-                                      "L"JAVA_PACKAGE"/types/Revision;"))
+                                      JAVAHL_ARG("/types/Revision;")))
 {}
 
 ExternalItem::ClassImpl::~ClassImpl() {}
@@ -131,7 +132,7 @@ inline jobject get_static_revision(::Jav
 {
   return env.GetStaticObjectField(
       cls, env.GetStaticFieldID(cls, field_name,
-                                "L"JAVA_PACKAGE"/types/Revision;"));
+                                JAVAHL_ARG("/types/Revision;")));
 }
 } // anonymous namespace
 
@@ -145,12 +146,12 @@ jobject Revision::makeJRevision(const sv
   if (rev.kind == svn_opt_revision_date)
     {
       const jclass cls = env.FindClass(
-          JAVA_PACKAGE"/types/Revision$DateSpec");
+          JAVAHL_CLASS("/types/Revision$DateSpec"));
       return env.NewObject(cls, env.GetMethodID(cls, "<init>", "(J)V"),
                            jlong(rev.value.date / 1000));
     }
 
-  const jclass cls = env.FindClass(JAVA_PACKAGE"/types/Revision");
+  const jclass cls = env.FindClass(JAVAHL_CLASS("/types/Revision"));
   switch (rev.kind)
     {
     case svn_opt_revision_committed:

Modified: subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/ImportFilterCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/ImportFilterCallback.cpp?rev=1686174&r1=1686173&r2=1686174&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/ImportFilterCallback.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/ImportFilterCallback.cpp Thu Jun 18 10:35:30 2015
@@ -83,13 +83,14 @@ ImportFilterCallback::doImportFilter(svn
   static jmethodID mid = 0;
   if (mid == 0)
     {
-      jclass clazz = env->FindClass(JAVA_PACKAGE"/callback/ImportFilterCallback");
+      jclass clazz = env->FindClass(JAVAHL_CLASS("/callback/ImportFilterCallback"));
       if (JNIUtil::isJavaExceptionThrown())
         POP_AND_RETURN(SVN_NO_ERROR);
 
       mid = env->GetMethodID(clazz, "filter",
                              "(Ljava/lang/String;"
-                             "L"JAVA_PACKAGE"/types/NodeKind;Z)Z");
+                             JAVAHL_ARG("/types/NodeKind;")
+                             "Z)Z");
       if (JNIUtil::isJavaExceptionThrown() || mid == 0)
         POP_AND_RETURN(SVN_NO_ERROR);
     }

Modified: subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/InfoCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/InfoCallback.cpp?rev=1686174&r1=1686173&r2=1686174&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/InfoCallback.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/InfoCallback.cpp Thu Jun 18 10:35:30 2015
@@ -80,12 +80,12 @@ InfoCallback::singleInfo(const char *pat
   static jmethodID mid = 0;
   if (mid == 0)
     {
-      jclass clazz = env->FindClass(JAVA_PACKAGE"/callback/InfoCallback");
+      jclass clazz = env->FindClass(JAVAHL_CLASS("/callback/InfoCallback"));
       if (JNIUtil::isJavaExceptionThrown())
         POP_AND_RETURN(SVN_NO_ERROR);
 
       mid = env->GetMethodID(clazz, "singleInfo",
-                             "(L"JAVA_PACKAGE"/types/Info;)V");
+                             "(" JAVAHL_ARG("/types/Info;") ")V");
       if (JNIUtil::isJavaExceptionThrown() || mid == 0)
         POP_AND_RETURN(SVN_NO_ERROR);
     }
@@ -95,8 +95,6 @@ InfoCallback::singleInfo(const char *pat
     POP_AND_RETURN(SVN_NO_ERROR);
 
   env->CallVoidMethod(m_callback, mid, jinfo2);
-  // Return SVN_NO_ERROR here regardless of an exception or not.
 
-  env->PopLocalFrame(NULL);
-  return SVN_NO_ERROR;
+  POP_AND_RETURN_EXCEPTION_AS_SVNERROR();
 }

Modified: subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/JNIUtil.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/JNIUtil.cpp?rev=1686174&r1=1686173&r2=1686174&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/JNIUtil.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/JNIUtil.cpp Thu Jun 18 10:35:30 2015
@@ -77,6 +77,11 @@ bool JNIUtil::g_initException;
 int JNIUtil::g_logLevel = JNIUtil::noLog;
 std::ofstream JNIUtil::g_logStream;
 
+/* The error code we will use to signal a Java exception */
+static const apr_status_t
+SVN_ERR_JAVAHL_WRAPPED = SVN_ERR_MALFUNC_CATEGORY_START
+                         + SVN_ERR_CATEGORY_SIZE - 10;
+
 /**
  * Return the JNI environment to use
  * @return the JNI environment
@@ -446,7 +451,8 @@ ErrorMessageStack assemble_error_message
     {
       /* When we're recursing, don't repeat the top-level message if its
        * the same as before. */
-      if (depth == 0 || err->apr_err != parent_apr_err)
+      if ((depth == 0 || err->apr_err != parent_apr_err)
+          && err->apr_err != SVN_ERR_JAVAHL_WRAPPED)
         {
           const char *message;
           /* Is this a Subversion-specific error code? */
@@ -511,7 +517,7 @@ jobject construct_Jmessage_stack(const E
   if (JNIUtil::isJavaExceptionThrown())
     POP_AND_RETURN_NULL;
 
-  jclass clazz = env->FindClass(JAVA_PACKAGE"/ClientException$ErrorMessage");
+  jclass clazz = env->FindClass(JAVAHL_CLASS("/ClientException$ErrorMessage"));
   if (JNIUtil::isJavaExceptionThrown())
     POP_AND_RETURN_NULL;
   mid = env->GetMethodID(clazz, "<init>",
@@ -586,6 +592,9 @@ void JNIUtil::wrappedHandleSVNError(svn_
 #endif
 #endif
 
+  if (!jcause)
+    jcause = JNIUtil::unwrapJavaException(err);
+
   // Much of the following is stolen from throwNativeException().  As much as
   // we'd like to call that function, we need to do some manual stack
   // unrolling, so it isn't feasible.
@@ -597,7 +606,7 @@ void JNIUtil::wrappedHandleSVNError(svn_
   if (JNIUtil::isJavaExceptionThrown())
     return;
 
-  jclass clazz = env->FindClass(JAVA_PACKAGE "/ClientException");
+  jclass clazz = env->FindClass(JAVAHL_CLASS("/ClientException"));
   if (isJavaExceptionThrown())
     POP_AND_RETURN_NOTHING();
 
@@ -804,6 +813,25 @@ JNIUtil::checkJavaException(apr_status_t
     err->message = apr_psprintf(err->pool, _("Java exception: %s"), msg);
   else
     err->message = _("Java exception");
+
+  
+  /* ### TODO: Use apr_pool_userdata_set() on the pool we just created
+               for the error chain to keep track of the actual Java
+               exception while the error is inside Subversion.
+
+               Once the error chain re-enters JavaHL we can check
+               if there is a true exception that we can add to the chain.
+
+               If the error is cleared in Subversion (which may happen
+               during composing error chains, etc.) the cleanup handler
+               handles properly releasing the exception.
+
+    apr_status_t
+    apr_pool_userdata_set(const void *data,
+                          const char *key,
+                          apr_status_t (*cleanup)(void *),
+                          apr_pool_t *pool)
+   */
   return err;
 }
 
@@ -1043,3 +1071,91 @@ svn_error_t *JNIUtil::preprocessPath(con
 
   return NULL;
 }
+
+/* Tag to use on the apr_pool_t to store a WrappedException reference */
+static const char *WrapExceptionTag = "org.apache.subversion.JavaHL.svnerror";
+
+class WrappedException
+{
+  JNIEnv *m_env;
+  jthrowable m_exception;
+#ifdef SVN_DEBUG
+  bool m_fetched;
+#endif
+public:
+  WrappedException(JNIEnv *env)
+  {
+    m_env = env;
+
+    // Fetch exception inside local frame
+    jthrowable exceptionObj = env->ExceptionOccurred();
+
+    // Now clear exception status
+    env->ExceptionClear();
+
+    // As adding a reference in exception state fails
+    m_exception = static_cast<jthrowable>(env->NewGlobalRef(exceptionObj));
+
+#ifdef SVN_DEBUG
+    m_fetched = false;
+#endif
+  }
+
+  static jthrowable get_exception(apr_pool_t *pool)
+  {
+      void *data;
+      if (! apr_pool_userdata_get(&data, WrapExceptionTag, pool))
+      {
+          WrappedException *we = reinterpret_cast<WrappedException *>(data);
+
+          if (we)
+          {
+#ifdef SVN_DEBUG
+              we->m_fetched = TRUE;
+#endif
+              // Create reference in local frame, as the pool will be cleared
+              return static_cast<jthrowable>(
+                            we->m_env->NewLocalRef(we->m_exception));
+          }
+      }
+      return NULL;
+  }
+
+private:
+  ~WrappedException()
+  {
+#ifdef SVN_DEBUG
+      if (!m_fetched)
+          SVN_DBG(("Cleared svn_error_t * before Java exception was fetched"));
+#endif
+      m_env->DeleteGlobalRef(m_exception);
+  }
+public:
+  static apr_status_t cleanup(void *data)
+  {
+    WrappedException *we = reinterpret_cast<WrappedException *>(data);
+
+    delete we;
+    return APR_SUCCESS;
+  }
+};
+
+svn_error_t* JNIUtil::wrapJavaException()
+{
+  if (!isExceptionThrown())
+    return SVN_NO_ERROR;
+
+  svn_error_t *err = svn_error_create(SVN_ERR_JAVAHL_WRAPPED, NULL,
+                                      "Wrapped Java Exception");
+  apr_pool_userdata_set(new WrappedException(getEnv()), WrapExceptionTag,
+                        WrappedException::cleanup, err->pool);
+  return err;
+}
+
+jthrowable JNIUtil::unwrapJavaException(const svn_error_t *err)
+{
+    if (!err)
+        return NULL;
+    return
+        WrappedException::get_exception(err->pool);
+}

Modified: subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/JNIUtil.h
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/JNIUtil.h?rev=1686174&r1=1686173&r2=1686174&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/JNIUtil.h (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/JNIUtil.h Thu Jun 18 10:35:30 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/reuse-ra-session/subversion/bindings/javahl/native/ListCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/ListCallback.cpp?rev=1686174&r1=1686173&r2=1686174&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/ListCallback.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/ListCallback.cpp Thu Jun 18 10:35:30 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/reuse-ra-session/subversion/bindings/javahl/native/LockTokenTable.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/LockTokenTable.cpp?rev=1686174&r1=1686173&r2=1686174&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/LockTokenTable.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/LockTokenTable.cpp Thu Jun 18 10:35:30 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/reuse-ra-session/subversion/bindings/javahl/native/LogMessageCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/LogMessageCallback.cpp?rev=1686174&r1=1686173&r2=1686174&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/LogMessageCallback.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/LogMessageCallback.cpp Thu Jun 18 10:35:30 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/reuse-ra-session/subversion/bindings/javahl/native/MessageReceiver.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/MessageReceiver.cpp?rev=1686174&r1=1686173&r2=1686174&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/MessageReceiver.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/MessageReceiver.cpp Thu Jun 18 10:35:30 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/reuse-ra-session/subversion/bindings/javahl/native/NativeStream.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/NativeStream.cpp?rev=1686174&r1=1686173&r2=1686174&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/NativeStream.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/NativeStream.cpp Thu Jun 18 10:35:30 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/reuse-ra-session/subversion/bindings/javahl/native/NativeStream.hpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/NativeStream.hpp?rev=1686174&r1=1686173&r2=1686174&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/NativeStream.hpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/NativeStream.hpp Thu Jun 18 10:35:30 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/reuse-ra-session/subversion/bindings/javahl/native/OperationContext.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/OperationContext.cpp?rev=1686174&r1=1686173&r2=1686174&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/OperationContext.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/OperationContext.cpp Thu Jun 18 10:35:30 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/reuse-ra-session/subversion/bindings/javahl/native/PatchCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/PatchCallback.cpp?rev=1686174&r1=1686173&r2=1686174&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/PatchCallback.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/PatchCallback.cpp Thu Jun 18 10:35:30 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/reuse-ra-session/subversion/bindings/javahl/native/PropertyTable.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/PropertyTable.cpp?rev=1686174&r1=1686173&r2=1686174&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/PropertyTable.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/PropertyTable.cpp Thu Jun 18 10:35:30 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/reuse-ra-session/subversion/bindings/javahl/native/ProplistCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/ProplistCallback.cpp?rev=1686174&r1=1686173&r2=1686174&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/ProplistCallback.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/ProplistCallback.cpp Thu Jun 18 10:35:30 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/reuse-ra-session/subversion/bindings/javahl/native/RemoteSession.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/RemoteSession.cpp?rev=1686174&r1=1686173&r2=1686174&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/RemoteSession.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/RemoteSession.cpp Thu Jun 18 10:35:30 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/reuse-ra-session/subversion/bindings/javahl/native/RemoteSession.h
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/RemoteSession.h?rev=1686174&r1=1686173&r2=1686174&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/RemoteSession.h (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/RemoteSession.h Thu Jun 18 10:35:30 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/reuse-ra-session/subversion/bindings/javahl/native/RemoteSessionContext.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/RemoteSessionContext.cpp?rev=1686174&r1=1686173&r2=1686174&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/RemoteSessionContext.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/RemoteSessionContext.cpp Thu Jun 18 10:35:30 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/reuse-ra-session/subversion/bindings/javahl/native/ReposFreezeAction.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/ReposFreezeAction.cpp?rev=1686174&r1=1686173&r2=1686174&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/ReposFreezeAction.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/ReposFreezeAction.cpp Thu Jun 18 10:35:30 2015
@@ -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/reuse-ra-session/subversion/bindings/javahl/native/ReposNotifyCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/ReposNotifyCallback.cpp?rev=1686174&r1=1686173&r2=1686174&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/ReposNotifyCallback.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/ReposNotifyCallback.cpp Thu Jun 18 10:35:30 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/reuse-ra-session/subversion/bindings/javahl/native/Revision.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/Revision.cpp?rev=1686174&r1=1686173&r2=1686174&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/Revision.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/Revision.cpp Thu Jun 18 10:35:30 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/reuse-ra-session/subversion/bindings/javahl/native/RevisionRange.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/RevisionRange.cpp?rev=1686174&r1=1686173&r2=1686174&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/RevisionRange.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/RevisionRange.cpp Thu Jun 18 10:35:30 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/reuse-ra-session/subversion/bindings/javahl/native/RevisionRangeList.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/RevisionRangeList.cpp?rev=1686174&r1=1686173&r2=1686174&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/RevisionRangeList.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/RevisionRangeList.cpp Thu Jun 18 10:35:30 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/reuse-ra-session/subversion/bindings/javahl/native/SVNClient.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/SVNClient.cpp?rev=1686174&r1=1686173&r2=1686174&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/SVNClient.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/SVNClient.cpp Thu Jun 18 10:35:30 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/reuse-ra-session/subversion/bindings/javahl/native/SVNRepos.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/SVNRepos.cpp?rev=1686174&r1=1686173&r2=1686174&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/SVNRepos.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/SVNRepos.cpp Thu Jun 18 10:35:30 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/reuse-ra-session/subversion/bindings/javahl/native/StateReporter.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/StateReporter.cpp?rev=1686174&r1=1686173&r2=1686174&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/StateReporter.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/StateReporter.cpp Thu Jun 18 10:35:30 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/reuse-ra-session/subversion/bindings/javahl/native/StateReporter.h
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/StateReporter.h?rev=1686174&r1=1686173&r2=1686174&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/StateReporter.h (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/StateReporter.h Thu Jun 18 10:35:30 2015
@@ -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/reuse-ra-session/subversion/bindings/javahl/native/StatusCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/StatusCallback.cpp?rev=1686174&r1=1686173&r2=1686174&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/StatusCallback.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/StatusCallback.cpp Thu Jun 18 10:35:30 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/reuse-ra-session/subversion/bindings/javahl/native/SubversionException.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/SubversionException.cpp?rev=1686174&r1=1686173&r2=1686174&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/SubversionException.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/SubversionException.cpp Thu Jun 18 10:35:30 2015
@@ -27,6 +27,6 @@
 namespace JavaHL {
 
 const char* const SubversionException::m_class_name =
-  JAVA_PACKAGE"/SubversionException";
+  JAVAHL_CLASS("/SubversionException");
 
 } // namespace JavaHL



Mime
View raw message