mturk       2005/06/03 00:44:10

  Modified:    jni/native/src error.c
  Log:
  Remove extra static function by merge it to the ThrowException.
  
  Revision  Changes    Path
  1.9       +6 -13     jakarta-tomcat-connectors/jni/native/src/error.c
  
  Index: error.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jni/native/src/error.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- error.c   3 Jun 2005 07:35:07 -0000       1.8
  +++ error.c   3 Jun 2005 07:44:10 -0000       1.9
  @@ -28,27 +28,20 @@
    */
   #define TCN_STATUS_IS_ETIMEDOUT(x) (APR_STATUS_IS_ETIMEDOUT((x)) || ((x) == 
APR_TIMEUP))
   /*
  - * Convenience function to help throw an Exception.
  + * Convenience function to help throw an java.lang.Exception.
    */
  -static void do_throw(JNIEnv *env, const char *cname, const char *msg)
  +void tcn_ThrowException(JNIEnv *env, const char *msg)
   {
       jclass javaExceptionClass;
   
  -    javaExceptionClass = (*env)->FindClass(env, cname);
  +    javaExceptionClass = (*env)->FindClass(env, "java/lang/Exception");
       if (javaExceptionClass == NULL) {
  -        fprintf(stderr, "Cannot find %s class\n", cname);
  +        fprintf(stderr, "Cannot find java/lang/Exception class\n");
           return;
       }
       (*env)->ThrowNew(env, javaExceptionClass, msg);
       (*env)->DeleteLocalRef(env, javaExceptionClass);
  -}
   
  -/*
  - * Convenience function to help throw an java.lang.Exception.
  - */
  -void tcn_ThrowException(JNIEnv *env, const char *msg)
  -{
  -    do_throw(env, "java/lang/Exception", msg);
   }
   
   void tcn_Throw(JNIEnv *env, const char *fmt, ...)
  @@ -58,7 +51,7 @@
   
       va_start(ap, fmt);
       apr_vsnprintf(msg, TCN_BUFFER_SZ, fmt, ap);
  -    do_throw(env, "java/lang/Exception", msg);
  +    tcn_ThrowException(env, msg);
       va_end(ap);
       free(msg);
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to