subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1717223 [5/50] - in /subversion/branches/ra-git: ./ build/ build/ac-macros/ build/generator/ build/generator/templates/ contrib/hook-scripts/ notes/ notes/api-errata/1.9/ notes/move-tracking/ subversion/ subversion/bindings/ctypes-python/c...
Date Mon, 30 Nov 2015 10:24:23 GMT
Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/CommitCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/CommitCallback.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/CommitCallback.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/CommitCallback.cpp Mon Nov 30 10:24:16 2015
@@ -80,13 +80,13 @@ CommitCallback::commitInfo(const svn_com
   static jmethodID sm_mid = 0;
   if (sm_mid == 0)
     {
-      jclass clazz = env->FindClass(JAVA_PACKAGE"/callback/CommitCallback");
+      jclass clazz = env->FindClass(JAVAHL_CLASS("/callback/CommitCallback"));
       if (JNIUtil::isJavaExceptionThrown())
         POP_AND_RETURN(SVN_NO_ERROR);
 
       sm_mid = env->GetMethodID(clazz,
                                 "commitInfo",
-                                "(L"JAVA_PACKAGE"/CommitInfo;)V");
+                                "(" JAVAHL_ARG("/CommitInfo;") ")V");
       if (JNIUtil::isJavaExceptionThrown())
         POP_AND_RETURN(SVN_NO_ERROR);
     }
@@ -96,10 +96,8 @@ CommitCallback::commitInfo(const svn_com
     POP_AND_RETURN(SVN_NO_ERROR);
 
   env->CallVoidMethod(m_callback, sm_mid, jcommitInfo);
-  // 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/ra-git/subversion/bindings/javahl/native/CommitEditor.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/CommitEditor.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/CommitEditor.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/CommitEditor.cpp Mon Nov 30 10:24:16 2015
@@ -48,7 +48,7 @@ CommitEditor::getCppObject(jobject jthis
 {
   static jfieldID fid = 0;
   jlong cppAddr = SVNBase::findCppAddrForJObject(
-      jthis, &fid, JAVA_PACKAGE"/remote/CommitEditor");
+      jthis, &fid, JAVAHL_CLASS("/remote/CommitEditor"));
   return (cppAddr == 0 ? NULL : reinterpret_cast<CommitEditor*>(cppAddr));
 }
 
@@ -136,7 +136,7 @@ void CommitEditor::dispose(jobject jthis
     abort();
 
   static jfieldID fid = 0;
-  SVNBase::dispose(jthis, &fid, JAVA_PACKAGE"/remote/CommitEditor");
+  SVNBase::dispose(jthis, &fid, JAVAHL_CLASS("/remote/CommitEditor"));
 }
 
 namespace {
@@ -184,7 +184,7 @@ build_checksum(jobject jchecksum, SVN::P
 
       if (0 == digest_mid || 0 == kind_mid)
         {
-          jclass cls = env->FindClass(JAVA_PACKAGE"/types/Checksum");
+          jclass cls = env->FindClass(JAVAHL_CLASS("/types/Checksum"));
           if (JNIUtil::isJavaExceptionThrown())
             return checksum;
 
@@ -192,7 +192,7 @@ build_checksum(jobject jchecksum, SVN::P
           if (JNIUtil::isJavaExceptionThrown())
             return checksum;
           kind_mid = env->GetMethodID(cls, "getKind", "()L"
-                                      JAVA_PACKAGE"/types/Checksum$Kind;");
+                                      JAVAHL_CLASS("/types/Checksum$Kind;"));
           if (JNIUtil::isJavaExceptionThrown())
             return checksum;
         }

Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/CommitMessage.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/CommitMessage.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/CommitMessage.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/CommitMessage.cpp Mon Nov 30 10:24:16 2015
@@ -73,7 +73,7 @@ CommitMessage::getCommitMessage(const ch
   static jmethodID midCallback = 0;
   if (midCallback == 0)
     {
-      jclass clazz2 = env->FindClass(JAVA_PACKAGE"/callback/CommitMessageCallback");
+      jclass clazz2 = env->FindClass(JAVAHL_CLASS("/callback/CommitMessageCallback"));
       if (JNIUtil::isJavaExceptionThrown())
         return SVN_NO_ERROR;
 
@@ -106,7 +106,7 @@ CommitMessage::getCommitMessage(const ch
                                                     midCallback,
                                                     CreateJ::Set(jitems));
   if (JNIUtil::isJavaExceptionThrown())
-    POP_AND_RETURN(SVN_NO_ERROR);
+    POP_AND_RETURN_EXCEPTION_AS_SVNERROR();
 
   if (jmessage != NULL)
     {

Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/CopySources.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/CopySources.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/CopySources.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/CopySources.cpp Mon Nov 30 10:24:16 2015
@@ -60,7 +60,7 @@ CopySources::makeJCopySource(const char
   if (JNIUtil::isJavaExceptionThrown())
     POP_AND_RETURN_NULL;
 
-  jclass clazz = env->FindClass(JAVA_PACKAGE "/types/CopySource");
+  jclass clazz = env->FindClass(JAVAHL_CLASS("/types/CopySource"));
   if (JNIUtil::isJavaExceptionThrown())
     POP_AND_RETURN_NULL;
 
@@ -69,8 +69,8 @@ CopySources::makeJCopySource(const char
     {
       ctor = env->GetMethodID(clazz, "<init>",
                               "(Ljava/lang/String;"
-                              "L" JAVA_PACKAGE "/types/Revision;"
-                              "L" JAVA_PACKAGE "/types/Revision;)V");
+                              JAVAHL_ARG("/types/Revision;")
+                              JAVAHL_ARG("/types/Revision;") ")V");
       if (JNIUtil::isExceptionThrown())
         POP_AND_RETURN_NULL;
     }
@@ -88,7 +88,7 @@ CopySources::array(SVN::Pool &pool)
   apr_pool_t *p = pool.getPool();
 
   JNIEnv *env = JNIUtil::getEnv();
-  jclass clazz = env->FindClass(JAVA_PACKAGE "/types/CopySource");
+  jclass clazz = env->FindClass(JAVAHL_CLASS("/types/CopySource"));
   if (JNIUtil::isJavaExceptionThrown())
     return NULL;
 
@@ -132,7 +132,7 @@ CopySources::array(SVN::Pool &pool)
       if (getRevision == 0)
         {
           getRevision = env->GetMethodID(clazz, "getRevision",
-                                         "()L"JAVA_PACKAGE"/types/Revision;");
+                                         "()" JAVAHL_ARG("/types/Revision;"));
           if (JNIUtil::isJavaExceptionThrown() || getRevision == 0)
             return NULL;
         }
@@ -151,7 +151,7 @@ CopySources::array(SVN::Pool &pool)
       if (getPegRevision == 0)
         {
           getPegRevision = env->GetMethodID(clazz, "getPegRevision",
-                                            "()L"JAVA_PACKAGE"/types/Revision;");
+                                            "()" JAVAHL_ARG("/types/Revision;"));
           if (JNIUtil::isJavaExceptionThrown() || getPegRevision == 0)
             return NULL;
         }

Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/CreateJ.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/CreateJ.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/CreateJ.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/CreateJ.cpp Mon Nov 30 10:24:16 2015
@@ -54,7 +54,7 @@ CreateJ::ConflictDescriptor(const svn_wc
     return NULL;
 
   // Create an instance of the conflict descriptor.
-  jclass clazz = env->FindClass(JAVA_PACKAGE "/ConflictDescriptor");
+  jclass clazz = env->FindClass(JAVAHL_CLASS("/ConflictDescriptor"));
   if (JNIUtil::isJavaExceptionThrown())
     POP_AND_RETURN_NULL;
 
@@ -62,16 +62,16 @@ CreateJ::ConflictDescriptor(const svn_wc
   if (ctor == 0)
     {
       ctor = env->GetMethodID(clazz, "<init>", "(Ljava/lang/String;"
-                              "L"JAVA_PACKAGE"/ConflictDescriptor$Kind;"
-                              "L"JAVA_PACKAGE"/types/NodeKind;"
+                              JAVAHL_ARG("/ConflictDescriptor$Kind;")
+                              JAVAHL_ARG("/types/NodeKind;")
                               "Ljava/lang/String;ZLjava/lang/String;"
-                              "L"JAVA_PACKAGE"/ConflictDescriptor$Action;"
-                              "L"JAVA_PACKAGE"/ConflictDescriptor$Reason;"
-                              "L"JAVA_PACKAGE"/ConflictDescriptor$Operation;"
+                              JAVAHL_ARG("/ConflictDescriptor$Action;")
+                              JAVAHL_ARG("/ConflictDescriptor$Reason;")
+                              JAVAHL_ARG("/ConflictDescriptor$Operation;")
                               "Ljava/lang/String;Ljava/lang/String;"
                               "Ljava/lang/String;Ljava/lang/String;"
-                              "L"JAVA_PACKAGE"/types/ConflictVersion;"
-                              "L"JAVA_PACKAGE"/types/ConflictVersion;"
+                              JAVAHL_ARG("/types/ConflictVersion;")
+                              JAVAHL_ARG("/types/ConflictVersion;")
                               "Ljava/lang/String;[B[B[B[B)V");
       if (JNIUtil::isJavaExceptionThrown() || ctor == 0)
         POP_AND_RETURN_NULL;
@@ -177,7 +177,7 @@ CreateJ::ConflictVersion(const svn_wc_co
     return NULL;
 
   // Create an instance of the conflict version.
-  jclass clazz = env->FindClass(JAVA_PACKAGE "/types/ConflictVersion");
+  jclass clazz = env->FindClass(JAVAHL_CLASS("/types/ConflictVersion"));
   if (JNIUtil::isJavaExceptionThrown())
     POP_AND_RETURN_NULL;
 
@@ -187,7 +187,7 @@ CreateJ::ConflictVersion(const svn_wc_co
       ctor = env->GetMethodID(clazz, "<init>", "(Ljava/lang/String;"
                                                "Ljava/lang/String;J"
                                                "Ljava/lang/String;"
-                                               "L"JAVA_PACKAGE"/types/NodeKind;"
+                                               JAVAHL_ARG("/types/NodeKind;")
                                                ")V");
       if (JNIUtil::isJavaExceptionThrown() || ctor == 0)
         POP_AND_RETURN_NULL;
@@ -228,7 +228,7 @@ CreateJ::Checksum(const svn_checksum_t *
   if (JNIUtil::isJavaExceptionThrown())
     return NULL;
 
-  jclass clazz = env->FindClass(JAVA_PACKAGE"/types/Checksum");
+  jclass clazz = env->FindClass(JAVAHL_CLASS("/types/Checksum"));
   if (JNIUtil::isExceptionThrown())
     POP_AND_RETURN_NULL;
 
@@ -238,7 +238,7 @@ CreateJ::Checksum(const svn_checksum_t *
     {
       midConstructor = env->GetMethodID(clazz, "<init>",
                                         "([B"
-                                        "L"JAVA_PACKAGE"/types/Checksum$Kind;"
+                                        JAVAHL_ARG("/types/Checksum$Kind;")
                                         ")V");
       if (JNIUtil::isExceptionThrown())
         POP_AND_RETURN_NULL;
@@ -273,7 +273,7 @@ CreateJ::DirEntry(const char *path, cons
   if (JNIUtil::isJavaExceptionThrown())
     return SVN_NO_ERROR;
 
-  jclass clazz = env->FindClass(JAVA_PACKAGE"/types/DirEntry");
+  jclass clazz = env->FindClass(JAVAHL_CLASS("/types/DirEntry"));
   if (JNIUtil::isJavaExceptionThrown())
     POP_AND_RETURN_NULL;
 
@@ -282,7 +282,7 @@ CreateJ::DirEntry(const char *path, cons
     {
       mid = env->GetMethodID(clazz, "<init>",
                              "(Ljava/lang/String;Ljava/lang/String;"
-                             "L"JAVA_PACKAGE"/types/NodeKind;"
+                             JAVAHL_ARG("/types/NodeKind;")
                              "JZJJLjava/lang/String;)V");
       if (JNIUtil::isJavaExceptionThrown())
         POP_AND_RETURN_NULL;
@@ -327,7 +327,7 @@ CreateJ::Info(const char *path, const sv
   if (JNIUtil::isJavaExceptionThrown())
     return NULL;
 
-  jclass clazz = env->FindClass(JAVA_PACKAGE "/types/Info");
+  jclass clazz = env->FindClass(JAVAHL_CLASS("/types/Info"));
   if (JNIUtil::isJavaExceptionThrown())
     POP_AND_RETURN_NULL;
 
@@ -337,15 +337,16 @@ CreateJ::Info(const char *path, const sv
       mid = env->GetMethodID(clazz, "<init>",
                              "(Ljava/lang/String;Ljava/lang/String;"
                              "Ljava/lang/String;J"
-                             "L"JAVA_PACKAGE"/types/NodeKind;"
+                             JAVAHL_ARG("/types/NodeKind;")
                              "Ljava/lang/String;Ljava/lang/String;"
                              "JJLjava/lang/String;"
-                             "L"JAVA_PACKAGE"/types/Lock;Z"
-                             "L"JAVA_PACKAGE"/types/Info$ScheduleKind;"
+                             JAVAHL_ARG("/types/Lock;Z")
+                             JAVAHL_ARG("/types/Info$ScheduleKind;")
                              "Ljava/lang/String;JJ"
-                             "L"JAVA_PACKAGE"/types/Checksum;"
+                             JAVAHL_ARG("/types/Checksum;")
                              "Ljava/lang/String;JJ"
-                             "L"JAVA_PACKAGE"/types/Depth;Ljava/util/Set;)V");
+                             JAVAHL_ARG("/types/Depth;Ljava/util/Set;")
+                             ")V");
       if (mid == 0 || JNIUtil::isJavaExceptionThrown())
         POP_AND_RETURN_NULL;
     }
@@ -472,7 +473,7 @@ CreateJ::Lock(const svn_lock_t *lock)
   if (JNIUtil::isJavaExceptionThrown())
     return NULL;
 
-  jclass clazz = env->FindClass(JAVA_PACKAGE"/types/Lock");
+  jclass clazz = env->FindClass(JAVAHL_CLASS("/types/Lock"));
   if (JNIUtil::isJavaExceptionThrown())
     POP_AND_RETURN_NULL;
 
@@ -586,7 +587,7 @@ CreateJ::ChangedPath(const char *path, s
   if (JNIUtil::isJavaExceptionThrown())
     return NULL;
 
-  jclass clazzCP = env->FindClass(JAVA_PACKAGE"/types/ChangePath");
+  jclass clazzCP = env->FindClass(JAVAHL_CLASS("/types/ChangePath"));
   if (JNIUtil::isJavaExceptionThrown())
     POP_AND_RETURN_NULL;
 
@@ -596,10 +597,11 @@ CreateJ::ChangedPath(const char *path, s
       midCP = env->GetMethodID(clazzCP,
                                "<init>",
                                "(Ljava/lang/String;JLjava/lang/String;"
-                               "L"JAVA_PACKAGE"/types/ChangePath$Action;"
-                               "L"JAVA_PACKAGE"/types/NodeKind;"
-                               "L"JAVA_PACKAGE"/types/Tristate;"
-                               "L"JAVA_PACKAGE"/types/Tristate;)V");
+                               JAVAHL_ARG("/types/ChangePath$Action;")
+                               JAVAHL_ARG("/types/NodeKind;")
+                               JAVAHL_ARG("/types/Tristate;")
+                               JAVAHL_ARG("/types/Tristate;")
+                               ")V");
       if (JNIUtil::isJavaExceptionThrown())
         POP_AND_RETURN_NULL;
     }
@@ -647,7 +649,7 @@ CreateJ::Status(svn_wc_context_t *wc_ctx
   if (JNIUtil::isJavaExceptionThrown())
     return NULL;
 
-  jclass clazz = env->FindClass(JAVA_PACKAGE"/types/Status");
+  jclass clazz = env->FindClass(JAVAHL_CLASS("/types/Status"));
   if (JNIUtil::isJavaExceptionThrown())
     POP_AND_RETURN_NULL;
 
@@ -656,18 +658,18 @@ CreateJ::Status(svn_wc_context_t *wc_ctx
     {
       mid = env->GetMethodID(clazz, "<init>",
                              "(Ljava/lang/String;Ljava/lang/String;"
-                             "L"JAVA_PACKAGE"/types/NodeKind;"
+                             JAVAHL_ARG("/types/NodeKind;")
                              "JJJLjava/lang/String;"
-                             "L"JAVA_PACKAGE"/types/Status$Kind;"
-                             "L"JAVA_PACKAGE"/types/Status$Kind;"
-                             "L"JAVA_PACKAGE"/types/Status$Kind;"
-                             "L"JAVA_PACKAGE"/types/Status$Kind;"
-                             "L"JAVA_PACKAGE"/types/Status$Kind;"
-                             "L"JAVA_PACKAGE"/types/Status$Kind;"
-                             "ZZL"JAVA_PACKAGE"/types/Depth;"
-                             "ZZZL"JAVA_PACKAGE"/types/Lock;"
-                             "L"JAVA_PACKAGE"/types/Lock;"
-                             "JJL"JAVA_PACKAGE"/types/NodeKind;"
+                             JAVAHL_ARG("/types/Status$Kind;")
+                             JAVAHL_ARG("/types/Status$Kind;")
+                             JAVAHL_ARG("/types/Status$Kind;")
+                             JAVAHL_ARG("/types/Status$Kind;")
+                             JAVAHL_ARG("/types/Status$Kind;")
+                             JAVAHL_ARG("/types/Status$Kind;")
+                             "ZZ" JAVAHL_ARG("/types/Depth;")
+                             "ZZZ" JAVAHL_ARG("/types/Lock;")
+                             JAVAHL_ARG("/types/Lock;")
+                             "JJ" JAVAHL_ARG("/types/NodeKind;")
                              "Ljava/lang/String;Ljava/lang/String;"
                              "Ljava/lang/String;Ljava/lang/String;)V");
       if (JNIUtil::isJavaExceptionThrown())
@@ -790,7 +792,7 @@ CreateJ::ClientNotifyInformation(const s
     return NULL;
 
   static jmethodID midCT = 0;
-  jclass clazz = env->FindClass(JAVA_PACKAGE"/ClientNotifyInformation");
+  jclass clazz = env->FindClass(JAVAHL_CLASS("/ClientNotifyInformation"));
   if (JNIUtil::isJavaExceptionThrown())
     POP_AND_RETURN_NULL;
 
@@ -798,16 +800,16 @@ CreateJ::ClientNotifyInformation(const s
     {
       midCT = env->GetMethodID(clazz, "<init>",
                                "(Ljava/lang/String;"
-                               "L"JAVA_PACKAGE"/ClientNotifyInformation$Action;"
-                               "L"JAVA_PACKAGE"/types/NodeKind;"
+                               JAVAHL_ARG("/ClientNotifyInformation$Action;")
+                               JAVAHL_ARG("/types/NodeKind;")
                                "Ljava/lang/String;"
-                               "L"JAVA_PACKAGE"/types/Lock;"
+                               JAVAHL_ARG("/types/Lock;")
                                "Ljava/lang/String;Ljava/util/List;"
-                               "L"JAVA_PACKAGE"/ClientNotifyInformation$Status;"
-                               "L"JAVA_PACKAGE"/ClientNotifyInformation$Status;"
-                               "L"JAVA_PACKAGE"/ClientNotifyInformation$LockStatus;"
+                               JAVAHL_ARG("/ClientNotifyInformation$Status;")
+                               JAVAHL_ARG("/ClientNotifyInformation$Status;")
+                               JAVAHL_ARG("/ClientNotifyInformation$LockStatus;")
                                "JLjava/lang/String;"
-                               "L"JAVA_PACKAGE"/types/RevisionRange;"
+                               JAVAHL_ARG("/types/RevisionRange;")
                                "Ljava/lang/String;"
                                "Ljava/lang/String;Ljava/lang/String;"
                                "Ljava/util/Map;JJJJJJI)V");
@@ -923,16 +925,16 @@ CreateJ::ReposNotifyInformation(const sv
     return NULL;
 
   static jmethodID midCT = 0;
-  jclass clazz = env->FindClass(JAVA_PACKAGE"/ReposNotifyInformation");
+  jclass clazz = env->FindClass(JAVAHL_CLASS("/ReposNotifyInformation"));
   if (JNIUtil::isJavaExceptionThrown())
     POP_AND_RETURN_NULL;
 
   if (midCT == 0)
     {
       midCT = env->GetMethodID(clazz, "<init>",
-                               "(L"JAVA_PACKAGE"/ReposNotifyInformation$Action;"
+                               "(" JAVAHL_ARG("/ReposNotifyInformation$Action;")
                                "JLjava/lang/String;JJJ"
-                               "L"JAVA_PACKAGE"/ReposNotifyInformation$NodeAction;"
+                               JAVAHL_ARG("/ReposNotifyInformation$NodeAction;")
                                "Ljava/lang/String;)V");
       if (JNIUtil::isJavaExceptionThrown() || midCT == 0)
         POP_AND_RETURN_NULL;
@@ -981,7 +983,7 @@ CreateJ::CommitItem(svn_client_commit_it
   if (JNIUtil::isJavaExceptionThrown())
     return NULL;
 
-  jclass clazz = env->FindClass(JAVA_PACKAGE"/CommitItem");
+  jclass clazz = env->FindClass(JAVAHL_CLASS("/CommitItem"));
   if (JNIUtil::isExceptionThrown())
     POP_AND_RETURN_NULL;
 
@@ -991,7 +993,7 @@ CreateJ::CommitItem(svn_client_commit_it
     {
       midConstructor = env->GetMethodID(clazz, "<init>",
                                         "(Ljava/lang/String;"
-                                        "L"JAVA_PACKAGE"/types/NodeKind;"
+                                        JAVAHL_ARG("/types/NodeKind;")
                                         "ILjava/lang/String;"
                                         "Ljava/lang/String;J"
                                         "Ljava/lang/String;)V");
@@ -1063,7 +1065,7 @@ CreateJ::CommitInfo(const svn_commit_inf
     return NULL;
 
   static jmethodID midCT = 0;
-  jclass clazz = env->FindClass(JAVA_PACKAGE"/CommitInfo");
+  jclass clazz = env->FindClass(JAVAHL_CLASS("/CommitInfo"));
   if (JNIUtil::isJavaExceptionThrown())
     POP_AND_RETURN_NULL;
 
@@ -1158,17 +1160,18 @@ void fill_property_map(jobject map,
         if (JNIUtil::isJavaExceptionThrown())
           return;
 
-        jbyteArray jpropVal = (!val ? NULL
-                               : JNIUtil::makeJByteArray(val));
+        jbyteArray jpropVal = (val ? JNIUtil::makeJByteArray(val) : NULL);
         if (JNIUtil::isJavaExceptionThrown())
           return;
 
-        m_env->CallObjectMethod(m_map, m_put_mid, jpropName, jpropVal);
+        jobject ret = m_env->CallObjectMethod(m_map, m_put_mid,
+                                              jpropName, jpropVal);
         if (JNIUtil::isJavaExceptionThrown())
           return;
 
-        m_env->DeleteLocalRef(jpropName);
+        m_env->DeleteLocalRef(ret);
         m_env->DeleteLocalRef(jpropVal);
+        m_env->DeleteLocalRef(jpropName);
       }
 
     JNIEnv*& m_env;
@@ -1214,6 +1217,7 @@ void fill_property_map(jobject map,
             POP_AND_RETURN_NOTHING();
         }
     }
+  POP_AND_RETURN_NOTHING();
 }
 
 jobject property_map(apr_hash_t *prop_hash, apr_array_header_t* prop_diffs,
@@ -1322,7 +1326,7 @@ jobject CreateJ::InheritedProps(apr_arra
     }
 
   jclass item_cls = env->FindClass(
-      JAVA_PACKAGE"/callback/InheritedProplistCallback$InheritedItem");
+      JAVAHL_CLASS("/callback/InheritedProplistCallback$InheritedItem"));
   if (JNIUtil::isJavaExceptionThrown())
     POP_AND_RETURN_NULL;
 
@@ -1375,7 +1379,7 @@ jobject CreateJ::Mergeinfo(svn_mergeinfo
 
   // Transform mergeinfo into Java Mergeinfo object.
   JNIEnv *env = JNIUtil::getEnv();
-  jclass clazz = env->FindClass(JAVA_PACKAGE "/types/Mergeinfo");
+  jclass clazz = env->FindClass(JAVAHL_CLASS("/types/Mergeinfo"));
   if (JNIUtil::isJavaExceptionThrown())
     return NULL;
 

Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/Credential.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/Credential.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/Credential.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/Credential.cpp Mon Nov 30 10:24:16 2015
@@ -29,17 +29,17 @@ namespace JavaHL {
 
 // Class JavaHL::Credential
 const char* const Credential::m_class_name =
-  JAVA_PACKAGE"/SVNUtil$Credential";
+  JAVAHL_CLASS("/SVNUtil$Credential");
 
 Credential::ClassImpl::ClassImpl(::Java::Env env, jclass cls)
   : ::Java::Object::ClassImpl(env, cls),
     m_mid_ctor(
         env.GetMethodID(cls, "<init>",
-                        "(L"JAVA_PACKAGE"/SVNUtil$Credential$Kind;"
+                        "(" JAVAHL_ARG("/SVNUtil$Credential$Kind;")
                         "Ljava/lang/String;Ljava/lang/String;"
                         "Ljava/lang/String;Ljava/lang/String;"
-                        "L"JAVA_PACKAGE"/callback/AuthnCallback$SSLServerCertInfo;"
-                        "L"JAVA_PACKAGE"/callback/AuthnCallback$SSLServerCertFailures;"
+                        JAVAHL_ARG("/callback/AuthnCallback$SSLServerCertInfo;")
+                        JAVAHL_ARG("/callback/AuthnCallback$SSLServerCertFailures;")
                         "Ljava/lang/String;)V"))
 {}
 
@@ -62,14 +62,14 @@ Credential::Credential(::Java::Env env,
 
 // Enum JavaHL::Credential::Kind
 const char* const Credential::Kind::m_class_name =
-  JAVA_PACKAGE"/SVNUtil$Credential$Kind";
+  JAVAHL_CLASS("/SVNUtil$Credential$Kind");
 
 Credential::Kind::ClassImpl::ClassImpl(::Java::Env env, jclass cls)
   : ::Java::Object::ClassImpl(env, cls),
     m_static_mid_from_string(
         env.GetStaticMethodID(cls, "fromString",
                               "(Ljava/lang/String;)"
-                              "L"JAVA_PACKAGE"/SVNUtil$Credential$Kind;"))
+                              JAVAHL_ARG("/SVNUtil$Credential$Kind;")))
 {}
 
 Credential::Kind::ClassImpl::~ClassImpl() {}

Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/DiffSummaryReceiver.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/DiffSummaryReceiver.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/DiffSummaryReceiver.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/DiffSummaryReceiver.cpp Mon Nov 30 10:24:16 2015
@@ -69,12 +69,12 @@ DiffSummaryReceiver::onSummary(const svn
   if (callback == 0)
     {
       // Initialize the method ID.
-      clazz = env->FindClass(JAVA_PACKAGE "/callback/DiffSummaryCallback");
+      clazz = env->FindClass(JAVAHL_CLASS("/callback/DiffSummaryCallback"));
       if (JNIUtil::isJavaExceptionThrown())
         POP_AND_RETURN(SVN_NO_ERROR);
 
       callback = env->GetMethodID(clazz, "onSummary",
-                                  "(L"JAVA_PACKAGE"/DiffSummary;)V");
+                                  "(" JAVAHL_ARG("/DiffSummary;") ")V");
       if (JNIUtil::isJavaExceptionThrown() || callback == 0)
         POP_AND_RETURN(SVN_NO_ERROR);
     }
@@ -82,7 +82,7 @@ DiffSummaryReceiver::onSummary(const svn
   // Do some prep work for tranforming the DIFF parameter into a
   // Java equivalent.
   static jmethodID ctor = 0;
-  clazz = env->FindClass(JAVA_PACKAGE "/DiffSummary");
+  clazz = env->FindClass(JAVAHL_CLASS("/DiffSummary"));
   if (JNIUtil::isJavaExceptionThrown())
     POP_AND_RETURN(SVN_NO_ERROR);
 
@@ -90,8 +90,8 @@ DiffSummaryReceiver::onSummary(const svn
     {
       ctor = env->GetMethodID(clazz, "<init>",
                               "(Ljava/lang/String;"
-                              "L"JAVA_PACKAGE"/DiffSummary$DiffKind;Z"
-                              "L"JAVA_PACKAGE"/types/NodeKind;)V");
+                              JAVAHL_ARG("/DiffSummary$DiffKind;") "Z"
+                              JAVAHL_ARG("/types/NodeKind;") ")V");
       if (JNIUtil::isJavaExceptionThrown() || ctor == 0)
         POP_AND_RETURN(SVN_NO_ERROR);
     }
@@ -117,8 +117,5 @@ DiffSummaryReceiver::onSummary(const svn
 
   // Invoke the Java DiffSummaryReceiver callback.
   env->CallVoidMethod(m_receiver, callback, jDiffSummary);
-  // We return whether an exception was thrown or not.
-
-  env->PopLocalFrame(NULL);
-  return SVN_NO_ERROR;
+  POP_AND_RETURN_EXCEPTION_AS_SVNERROR();
 }

Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/EditorCallbacks.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/EditorCallbacks.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/EditorCallbacks.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/EditorCallbacks.cpp Mon Nov 30 10:24:16 2015
@@ -34,23 +34,22 @@ namespace JavaHL {
 // class JavaHL::ProvideBaseCallback
 
 const char* const ProvideBaseCallback::m_class_name =
-  JAVA_PACKAGE"/ISVNEditor$ProvideBaseCallback";
+  JAVAHL_CLASS("/ISVNEditor$ProvideBaseCallback");
 
 ProvideBaseCallback::ClassImpl::ClassImpl(::Java::Env env, jclass cls)
   : ::Java::Object::ClassImpl(env, cls),
     m_mid_get_contents(
-        env.GetMethodID(cls,
-                        "getContents",
-                        "(Ljava/lang/String;)"
-                        "L"JAVA_PACKAGE
-                        "/ISVNEditor$ProvideBaseCallback$ReturnValue;"))
+        env.GetMethodID(
+            cls, "getContents",
+            "(Ljava/lang/String;)"
+            JAVAHL_ARG("/ISVNEditor$ProvideBaseCallback$ReturnValue;")))
 {}
 
 ProvideBaseCallback::ClassImpl::~ClassImpl() {}
 
 
 const char* const ProvideBaseCallback::ReturnValue::m_class_name =
-  JAVA_PACKAGE"/ISVNEditor$ProvideBaseCallback$ReturnValue";
+  JAVAHL_CLASS("/ISVNEditor$ProvideBaseCallback$ReturnValue");
 
 ProvideBaseCallback::ReturnValue::ClassImpl::ClassImpl(
     ::Java::Env env, jclass cls)
@@ -73,23 +72,22 @@ ProvideBaseCallback::ReturnValue::get_gl
 // class JavaHL::ProvidePropsCallback
 
 const char* const ProvidePropsCallback::m_class_name =
-  JAVA_PACKAGE"/ISVNEditor$ProvidePropsCallback";
+  JAVAHL_CLASS("/ISVNEditor$ProvidePropsCallback");
 
 ProvidePropsCallback::ClassImpl::ClassImpl(::Java::Env env, jclass cls)
   : ::Java::Object::ClassImpl(env, cls),
     m_mid_get_props(
-        env.GetMethodID(cls,
-                        "getProperties",
-                        "(Ljava/lang/String;)"
-                        "L"JAVA_PACKAGE
-                        "/ISVNEditor$ProvidePropsCallback$ReturnValue;"))
+        env.GetMethodID(
+            cls, "getProperties",
+            "(Ljava/lang/String;)"
+            JAVAHL_ARG("/ISVNEditor$ProvidePropsCallback$ReturnValue;")))
 {}
 
 ProvidePropsCallback::ClassImpl::~ClassImpl() {}
 
 
 const char* const ProvidePropsCallback::ReturnValue::m_class_name =
-  JAVA_PACKAGE"/ISVNEditor$ProvidePropsCallback$ReturnValue";
+  JAVAHL_CLASS("/ISVNEditor$ProvidePropsCallback$ReturnValue");
 
 ProvidePropsCallback::ReturnValue::ClassImpl::ClassImpl(
     ::Java::Env env, jclass cls)
@@ -111,7 +109,7 @@ ProvidePropsCallback::ReturnValue::get_p
 // class JavaHL::GetNodeKindCallback
 
 const char* const GetNodeKindCallback::m_class_name =
-  JAVA_PACKAGE"/ISVNEditor$GetNodeKindCallback";
+  JAVAHL_CLASS("/ISVNEditor$GetNodeKindCallback");
 
 GetNodeKindCallback::ClassImpl::ClassImpl(::Java::Env env, jclass cls)
   : ::Java::Object::ClassImpl(env, cls),
@@ -119,7 +117,7 @@ GetNodeKindCallback::ClassImpl::ClassImp
         env.GetMethodID(cls,
                         "getKind",
                         "(Ljava/lang/String;J)"
-                        "L"JAVA_PACKAGE"/types/NodeKind;"))
+                        JAVAHL_ARG("/types/NodeKind;")))
 {}
 
 GetNodeKindCallback::ClassImpl::~ClassImpl() {}

Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/EditorProxy.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/EditorProxy.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/EditorProxy.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/EditorProxy.cpp Mon Nov 30 10:24:16 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/ra-git/subversion/bindings/javahl/native/EditorProxy.h
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/EditorProxy.h?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/EditorProxy.h (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/EditorProxy.h Mon Nov 30 10:24:16 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/ra-git/subversion/bindings/javahl/native/EnumMapper.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/EnumMapper.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/EnumMapper.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/EnumMapper.cpp Mon Nov 30 10:24:16 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/ra-git/subversion/bindings/javahl/native/ExternalItem.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/ExternalItem.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/ExternalItem.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/ExternalItem.cpp Mon Nov 30 10:24:16 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/ra-git/subversion/bindings/javahl/native/ImportFilterCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/ImportFilterCallback.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/ImportFilterCallback.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/ImportFilterCallback.cpp Mon Nov 30 10:24:16 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/ra-git/subversion/bindings/javahl/native/InfoCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/InfoCallback.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/InfoCallback.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/InfoCallback.cpp Mon Nov 30 10:24:16 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/ra-git/subversion/bindings/javahl/native/JNIUtil.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/JNIUtil.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/JNIUtil.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/JNIUtil.cpp Mon Nov 30 10:24:16 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>",
@@ -564,13 +570,13 @@ std::string JNIUtil::makeSVNErrorMessage
   return buffer;
 }
 
-void JNIUtil::wrappedHandleSVNError(svn_error_t *err, jthrowable jcause)
+jthrowable JNIUtil::wrappedCreateClientException(svn_error_t *err, jthrowable jcause)
 {
   jstring jmessage;
   jobject jstack;
   std::string msg = makeSVNErrorMessage(err, &jmessage, &jstack);
   if (JNIUtil::isJavaExceptionThrown())
-    return;
+    return NULL;
 
   const char *source = NULL;
 #ifdef SVN_DEBUG
@@ -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.
@@ -595,11 +604,11 @@ void JNIUtil::wrappedHandleSVNError(svn_
   // Create a local frame for our references
   env->PushLocalFrame(LOCAL_FRAME_SIZE);
   if (JNIUtil::isJavaExceptionThrown())
-    return;
+    return NULL;
 
-  jclass clazz = env->FindClass(JAVA_PACKAGE "/ClientException");
+  jclass clazz = env->FindClass(JAVAHL_CLASS("/ClientException"));
   if (isJavaExceptionThrown())
-    POP_AND_RETURN_NOTHING();
+    POP_AND_RETURN_NULL;
 
   if (getLogLevel() >= exceptionLog)
     {
@@ -613,11 +622,11 @@ void JNIUtil::wrappedHandleSVNError(svn_
       g_logStream << std::endl;
     }
   if (isJavaExceptionThrown())
-    POP_AND_RETURN_NOTHING();
+    POP_AND_RETURN_NULL;
 
   jstring jsource = makeJString(source);
   if (isJavaExceptionThrown())
-    POP_AND_RETURN_NOTHING();
+    POP_AND_RETURN_NULL;
 
   jmethodID mid = env->GetMethodID(clazz, "<init>",
                                    "(Ljava/lang/String;"
@@ -625,12 +634,12 @@ void JNIUtil::wrappedHandleSVNError(svn_
                                    "Ljava/lang/String;I"
                                    "Ljava/util/List;)V");
   if (isJavaExceptionThrown())
-    POP_AND_RETURN_NOTHING();
+    POP_AND_RETURN_NULL;
   jobject nativeException = env->NewObject(clazz, mid, jmessage, jcause,
                                            jsource, jint(err->apr_err),
                                            jstack);
   if (isJavaExceptionThrown())
-    POP_AND_RETURN_NOTHING();
+    POP_AND_RETURN_NULL;
 
 #ifdef SVN_ERR__TRACING
   // Add all the C error stack trace information to the Java Exception
@@ -642,7 +651,7 @@ void JNIUtil::wrappedHandleSVNError(svn_
       mid_gst = env->GetMethodID(clazz, "getStackTrace",
                                  "()[Ljava/lang/StackTraceElement;");
       if (isJavaExceptionThrown())
-        POP_AND_RETURN_NOTHING();
+        POP_AND_RETURN_NULL;
     }
   Array stackTraceArray((jobjectArray) env->CallObjectMethod(nativeException,
                                                              mid_gst));
@@ -661,18 +670,18 @@ void JNIUtil::wrappedHandleSVNError(svn_
 
   jclass stClazz = env->FindClass("java/lang/StackTraceElement");
   if (isJavaExceptionThrown())
-    POP_AND_RETURN_NOTHING();
+    POP_AND_RETURN_NULL;
 
   const jsize stSize = static_cast<jsize>(newStackTrace.size());
   if (stSize < 0 || stSize != newStackTrace.size())
     {
       env->ThrowNew(env->FindClass("java.lang.ArithmeticException"),
                     "Overflow converting C size_t to JNI jsize");
-      POP_AND_RETURN_NOTHING();
+      POP_AND_RETURN_NULL;
     }
   jobjectArray jStackTrace = env->NewObjectArray(stSize, stClazz, NULL);
   if (isJavaExceptionThrown())
-    POP_AND_RETURN_NOTHING();
+    POP_AND_RETURN_NULL;
 
   int i = 0;
   for (std::vector<jobject>::const_iterator it = newStackTrace.begin();
@@ -689,25 +698,34 @@ void JNIUtil::wrappedHandleSVNError(svn_
       mid_sst = env->GetMethodID(clazz, "setStackTrace",
                                  "([Ljava/lang/StackTraceElement;)V");
       if (isJavaExceptionThrown())
-        POP_AND_RETURN_NOTHING();
+        POP_AND_RETURN_NULL;
     }
   env->CallVoidMethod(nativeException, mid_sst, jStackTrace);
   if (isJavaExceptionThrown())
-    POP_AND_RETURN_NOTHING();
+    POP_AND_RETURN_NULL;
 #endif
 
-  env->Throw(static_cast<jthrowable>(env->PopLocalFrame(nativeException)));
+  return static_cast<jthrowable>(env->PopLocalFrame(nativeException));
 }
 
-void JNIUtil::handleSVNError(svn_error_t *err, jthrowable jcause)
+jthrowable JNIUtil::createClientException(svn_error_t *err, jthrowable jcause)
 {
+  jthrowable jexc = NULL;
   try {
-    wrappedHandleSVNError(err, jcause);
+    jexc = wrappedCreateClientException(err, jcause);
   } catch (...) {
     svn_error_clear(err);
     throw;
   }
   svn_error_clear(err);
+  return jexc;
+}
+
+void JNIUtil::handleSVNError(svn_error_t *err, jthrowable jcause)
+{
+  jthrowable jexc = createClientException(err, jcause);
+  if (jexc)
+    getEnv()->Throw(jexc);
 }
 
 void JNIUtil::putFinalizedClient(SVNBase *object)
@@ -804,6 +822,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 +1080,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/ra-git/subversion/bindings/javahl/native/JNIUtil.h
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/JNIUtil.h?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/JNIUtil.h (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/JNIUtil.h Mon Nov 30 10:24:16 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);
 
   /**
@@ -118,6 +136,13 @@ class JNIUtil
   static svn_error_t* checkJavaException(apr_status_t errorcode);
 
   /**
+   * Create a Java exception corresponding to err, and run
+   * svn_error_clear() on err.
+   */
+  static jthrowable createClientException(svn_error_t *err,
+                                          jthrowable jcause = NULL);
+
+  /**
    * Throw a Java exception corresponding to err, and run
    * svn_error_clear() on err.
    */
@@ -143,7 +168,7 @@ class JNIUtil
    */
   static void throwError(const char *message)
     {
-      raiseThrowable(JAVA_PACKAGE"/JNIError", message);
+      raiseThrowable(JAVAHL_CLASS("/JNIError"), message);
     }
 
   static apr_pool_t *getPool();
@@ -160,7 +185,8 @@ class JNIUtil
   friend bool initialize_jni_util(JNIEnv *env);
   static bool JNIGlobalInit(JNIEnv *env);
 
-  static void wrappedHandleSVNError(svn_error_t *err, jthrowable jcause);
+  static jthrowable wrappedCreateClientException(svn_error_t *err,
+                                                 jthrowable jcause);
   static void putErrorsInTrace(svn_error_t *err,
                                std::vector<jobject> &stackTrace);
 
@@ -265,6 +291,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/ra-git/subversion/bindings/javahl/native/ListCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/ListCallback.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/ListCallback.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/ListCallback.cpp Mon Nov 30 10:24:16 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/ra-git/subversion/bindings/javahl/native/LockTokenTable.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/LockTokenTable.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/LockTokenTable.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/LockTokenTable.cpp Mon Nov 30 10:24:16 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/ra-git/subversion/bindings/javahl/native/LogMessageCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/LogMessageCallback.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/LogMessageCallback.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/LogMessageCallback.cpp Mon Nov 30 10:24:16 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/ra-git/subversion/bindings/javahl/native/MessageReceiver.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/MessageReceiver.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/MessageReceiver.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/MessageReceiver.cpp Mon Nov 30 10:24:16 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;
 




Mime
View raw message