subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1544138 - in /subversion/trunk/subversion/bindings/javahl/native: jniwrapper/jni_stack.hpp org_apache_subversion_javahl_util_PropLib.cpp
Date Thu, 21 Nov 2013 11:52:12 GMT
Author: brane
Date: Thu Nov 21 11:52:12 2013
New Revision: 1544138

URL: http://svn.apache.org/r1544138
Log:
Provide compatibility exception checking boilerplate in JavaHL.

[in subversion/bindings/javahl]
* native/jniwrapper/jni_stack.hpp
  (SVN_JAVAHL_OLDSTYLE_EXCEPTION_CHECK): New macro.

* native/org_apache_subversion_javahl_util_PropLib.cpp
  (Java_org_apache_subversion_javahl_util_PropLib_checkNodeProp):
   Use SVN_JAVAHL_OLDSTYLE_EXCEPTION_CHECK instead of manual check.

Modified:
    subversion/trunk/subversion/bindings/javahl/native/jniwrapper/jni_stack.hpp
    subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_PropLib.cpp

Modified: subversion/trunk/subversion/bindings/javahl/native/jniwrapper/jni_stack.hpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/jniwrapper/jni_stack.hpp?rev=1544138&r1=1544137&r2=1544138&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/jniwrapper/jni_stack.hpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/jniwrapper/jni_stack.hpp Thu Nov 21
11:52:12 2013
@@ -176,6 +176,21 @@
       return svn_error_create((C), NULL, msg);                          \
     }
 
+/**
+ * Exception checker for the oldstyle implementation that does not use
+ * the @c Java::Env environment wrapper.
+ *
+ * @param E A wrapped environment (@c Java::Env) instance.
+ *
+ * @since New in 1.9.
+ */
+#define SVN_JAVAHL_OLDSTYLE_EXCEPTION_CHECK(E)  \
+  do {                                          \
+    if ((E).ExceptionCheck())                   \
+      throw ::Java::SignalExceptionThrown();    \
+  } while(0)
+
+
 namespace Java {
 
 /**

Modified: subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_PropLib.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_PropLib.cpp?rev=1544138&r1=1544137&r2=1544138&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_PropLib.cpp
(original)
+++ subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_PropLib.cpp
Thu Nov 21 11:52:12 2013
@@ -225,8 +225,7 @@ Java_org_apache_subversion_javahl_util_P
       const Java::Env env(jenv);
 
       const svn_node_kind_t kind = EnumMapper::toNodeKind(jkind);
-      if (env.ExceptionCheck())
-        throw Java::SignalExceptionThrown();
+      SVN_JAVAHL_OLDSTYLE_EXCEPTION_CHECK(env);
 
       const Java::String name_str(env, jname);
       const Java::ByteArray value(env, jvalue);



Mime
View raw message