A-better-version 1.0.
[cacao.git] / nat / Constructor.c
index a52034f4f249ac0a5de3d64a61eb33f94047181a..764ec5d8079f1ab1d1fecbdbe4d27ffa885d8ccb 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes: Joseph Wenninger
 
-   $Id: Constructor.c 940 2004-03-06 14:04:15Z jowenn $
+   $Id: Constructor.c 1344 2004-07-21 17:12:53Z twisti $
 
 */
 
 #include <string.h>
 #include "jni.h"
 #include "builtin.h"
+#include "exceptions.h"
 #include "loader.h"
 #include "native.h"
 #include "tables.h"
 #include "asmpart.h"
-#include "toolbox/loging.h"
+#include "options.h"
+#include "toolbox/logging.h"
 #include "java_lang_Object.h"
 #include "java_lang_Class.h"
 #include "java_lang_reflect_Constructor.h"
 JNIEXPORT java_lang_Object* JNICALL Java_java_lang_reflect_Constructor_constructNative(JNIEnv *env, java_lang_reflect_Constructor *this, java_objectarray *parameters, java_lang_Class *clazz, s4 par3)
 {
 
+#if defined(__GNUC__)
 #warning fix me for parameters float/double and long long  parameters
+#endif
 
        methodinfo *m;
        java_objectheader *o;
 
-        
-       /*      log_text("Java_java_lang_reflect_Constructor_constructNative called");
-        log_plain_utf(((struct classinfo*)clazz)->name);*/
-/*     log_plain("\n"); */
-
        /* find initializer */
 
        if (!parameters) {
                if (this->parameterTypes->header.size != 0) {
-                       (*env)->ThrowNew(env, loader_load(utf_new_char("java/lang/IllegalArgumentException")), "wrong number of arguments");
+                       *exceptionptr =
+                               new_exception_message(string_java_lang_IllegalArgumentException,
+                                                                         "wrong number of arguments");
                        return 0;
                }
 
        } else {
                if (this->parameterTypes->header.size != parameters->header.size) {
-                       (*env)->ThrowNew(env, loader_load(utf_new_char("java/lang/IllegalArgumentException")), "wrong number of arguments");
+                       *exceptionptr =
+                               new_exception_message(string_java_lang_IllegalArgumentException,
+                                                                         "wrong number of arguments");
                        return 0;
                }
        }
@@ -107,7 +110,9 @@ JNIEXPORT java_lang_Object* JNICALL Java_java_lang_reflect_Constructor_construct
                                log_plain("\n");
                                class_showconstantpool((classinfo *) clazz);
                        }
+#if defined(__GNUC__)
 #warning throw an exception here, although this should never happen
+#endif
                        return (java_lang_Object *) o;
                }
 
@@ -128,11 +133,8 @@ JNIEXPORT java_lang_Object* JNICALL Java_java_lang_reflect_Constructor_construct
                log_text("Not supported number of arguments in Java_java_lang_reflect_Constructor");
        }
 #endif
-       /*log_plain_utf(m->descriptor);
-         log_text("calling constructor");*/
-       (void) jni_method_invokeNativeHelper(env, m ,o, parameters); 
 
-       log_text("Java_java_lang_reflect_Constructor: returning object");
+       (void) jni_method_invokeNativeHelper(env, m ,o, parameters); 
 
        return (java_lang_Object *) o;
 }
@@ -145,7 +147,6 @@ JNIEXPORT java_lang_Object* JNICALL Java_java_lang_reflect_Constructor_construct
  */
 JNIEXPORT s4 JNICALL Java_java_lang_reflect_Constructor_getModifiers(JNIEnv *env, java_lang_reflect_Constructor *this)
 {
-       /*      log_text("Java_java_lang_reflect_Constructor_getModifiers called");*/
        classinfo *c = (classinfo *) (this->clazz);
 
        if ((this->slot < 0) || (this->slot >= c->methodscount))