[[[
JavaHL: Added SVN_JNI_BYTE_ARRAY macro to reduce amount of duplicate
code dealing with jbyteArray wrapper and checking for exceptions
[ in subversion/bindings/javahl/native ]
* JNIByteArray.h
(SVN_JNI_BYTE_ARRAY): New macro to declare local variable of type
JNIByteArray and return in case of exceptions
]]]
Index: subversion/bindings/javahl/native/JNIByteArray.h
===================================================================
--- subversion/bindings/javahl/native/JNIByteArray.h (revision 1328758)
+++ subversion/bindings/javahl/native/JNIByteArray.h (working copy)
@@ -62,4 +62,13 @@ class JNIByteArray
~JNIByteArray();
};
+#define SVN_JNI_BYTE_ARRAY(localName, jname, ret_val) \
+JNIByteArray localName(jname); \
+do { \
+ if (JNIUtil::isExceptionThrown()) \
+ { \
+ return ret_val ; \
+ } \
+} while (0)
+
#endif // JNIBYTEARRAY_H