From e5f90521eb1bdbba68d660242e0ef74e96aca681 Mon Sep 17 00:00:00 2001 From: Oliver Bolte Date: Mon, 18 Apr 2005 11:16:20 +0000 Subject: 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 --- ...om_sun_star_lib_connections_pipe_PipeConnection.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'jurt') 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 */ -- cgit