summaryrefslogtreecommitdiff
path: root/jurt/source
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2005-04-18 11:16:20 +0000
committerOliver Bolte <obo@openoffice.org>2005-04-18 11:16:20 +0000
commite5f90521eb1bdbba68d660242e0ef74e96aca681 (patch)
tree473b55e206eec054c94cd297566c21f7dc77cf8b /jurt/source
parent665941dfd05bae740aa89c3842f82599733ea189 (diff)
INTEGRATION: CWS fwkfinal8 (1.4.48); FILE MERGED
2005/04/05 14:31:39 jl 1.4.48.1: #i46616# Before a JNI exception is thrown we make sure that ExceptionClear is called
Diffstat (limited to 'jurt/source')
-rw-r--r--jurt/source/pipe/com_sun_star_lib_connections_pipe_PipeConnection.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/jurt/source/pipe/com_sun_star_lib_connections_pipe_PipeConnection.c b/jurt/source/pipe/com_sun_star_lib_connections_pipe_PipeConnection.c
index 4b812a80eb09..f73479b21d4c 100644
--- a/jurt/source/pipe/com_sun_star_lib_connections_pipe_PipeConnection.c
+++ b/jurt/source/pipe/com_sun_star_lib_connections_pipe_PipeConnection.c
@@ -2,9 +2,9 @@
*
* $RCSfile: com_sun_star_lib_connections_pipe_PipeConnection.c,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: kz $ $Date: 2004-03-25 11:04:12 $
+ * last change: $Author: obo $ $Date: 2005-04-18 12:16:20 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -71,8 +71,20 @@
/*****************************************************************************/
/* exception macros */
-#define ThrowException(env, type, msg) { \
- (*env)->ThrowNew(env, (*env)->FindClass(env, type), msg); }
+static void ThrowException(JNIEnv * env, char const * type, char const * msg) {
+ jclass c;
+ (*env)->ExceptionClear(env);
+ c = (*env)->FindClass(env, "java/lang/RuntimeException");
+ if (c == NULL) {
+ (*env)->ExceptionClear(env);
+ (*env)->FatalError(
+ env, "JNI FindClass(\"java/lang/RuntimeException\") failed");
+ }
+ if ((*env)->ThrowNew(env, c, msg) != 0) {
+ (*env)->ExceptionClear(env);
+ (*env)->FatalError(env, "JNI ThrowNew failed");
+ }
+}
/*****************************************************************************/
/* helper functions prototypes */