1 /* class: java/lang/reflect/Constructor */
11 #include "toolbox/loging.h"
12 #include "java_lang_Class.h"
13 #include "java_lang_reflect_Constructor.h"
17 * Class: java/lang/reflect/Constructor
19 * Signature: ([Ljava/lang/Object;)Ljava/lang/Object;
21 JNIEXPORT struct java_lang_Object* JNICALL Java_java_lang_reflect_Constructor_constructNative( JNIEnv *env , struct java_lang_reflect_Constructor* this,
22 java_objectarray* parameters,struct java_lang_Class* clazz, s4 par3)
25 #warning fix me for parameters float/double and long long parameters
31 /* log_text("Java_java_lang_reflect_Constructor_constructNative called");
32 log_plain_utf(((struct classinfo*)clazz)->name);*/
35 /* find initializer */
38 if (this->parameterTypes->header.size!=0) {
39 log_text("Parameter count mismatch in Java_java_lang_reflect_Constructor_constructNative(1)");
40 #warning throw an exception here
44 if (this->parameterTypes->header.size!=parameters->header.size) {
45 log_text("Parameter count mismatch in Java_java_lang_reflect_Constructor_constructNative(2)");
46 #warning throw an exception here
50 if (this->slot>=((classinfo*)clazz)->methodscount) {
51 log_text("illegal index in methods table");
55 o = builtin_new (clazz); /* create object */
57 log_text("Objet instance could not be created");
61 /* log_text("o!=NULL\n");*/
64 m = &((classinfo*)clazz)->methods[this->slot];
65 if (!((m->name == utf_new_char("<init>"))))
67 (m->descriptor == create_methodsig(this->parameterTypes,"V"))))*/
70 char logtext[MAXLOGTEXT];
71 sprintf(logtext, "Warning: class has no instance-initializer of specified type: ");
72 utf_sprint(logtext + strlen(logtext), ((struct classinfo*)clazz)->name);
74 log_plain_utf( create_methodsig(this->parameterTypes,"V"));
76 class_showconstantpool(clazz);
78 #warning throw an exception here, although this should never happen
82 /* log_text("calling initializer");*/
83 /* call initializer */
85 switch (this->parameterTypes->header.size) {
86 case 0: exceptionptr=asm_calljavamethod (m, o, NULL, NULL, NULL);
88 case 1: exceptionptr=asm_calljavamethod (m, o, parameters->data[0], NULL, NULL);
90 case 2: exceptionptr=asm_calljavamethod (m, o, parameters->data[0], parameters->data[1], NULL);
92 case 3: exceptionptr=asm_calljavamethod (m, o, parameters->data[0], parameters->data[1],
96 log_text("Not supported number of arguments in Java_java_lang_reflect_Constructor");
99 /*log_plain_utf(m->descriptor);
100 log_text("calling constructor");*/
101 (void) jni_method_invokeNativeHelper(env, m ,o, parameters);
107 * Class: java_lang_reflect_Constructor
108 * Method: getModifiers
111 JNIEXPORT s4 JNICALL Java_java_lang_reflect_Constructor_getModifiers (JNIEnv *env , struct java_lang_reflect_Constructor* this ) {
112 /* log_text("Java_java_lang_reflect_Constructor_getModifiers called");*/
113 classinfo *c=(classinfo*)(this->clazz);
114 if ((this->slot<0) || (this->slot>=c->methodscount))
115 panic("error illegal slot for method in class (getReturnType)");
116 return (c->methods[this->slot]).flags & (ACC_PUBLIC | ACC_PRIVATE | ACC_PROTECTED);
121 * These are local overrides for various environment variables in Emacs.
122 * Please do not remove this and leave it at the end of the file, where
123 * Emacs will automagically detect them.
124 * ---------------------------------------------------------------------
127 * indent-tabs-mode: t