1 /* class: java/lang/reflect/Constructor */
10 #include "java_lang_Class.h"
11 #include "java_lang_reflect_Constructor.h"
15 * Class: java/lang/reflect/Constructor
17 * Signature: ([Ljava/lang/Object;)Ljava/lang/Object;
19 JNIEXPORT struct java_lang_Object* JNICALL Java_java_lang_reflect_Constructor_constructNative( JNIEnv *env , struct java_lang_reflect_Constructor* this,
20 java_objectarray* parameters,struct java_lang_Class* clazz, s4 par3)
23 #warning fix me for parameters float/double and long long parameters
29 /* log_text("Java_java_lang_reflect_Constructor_constructNative called");
30 log_plain_utf(((struct classinfo*)clazz)->name);*/
33 /* find initializer */
36 if (this->parameterTypes->header.size!=0) {
37 log_text("Parameter count mismatch in Java_java_lang_reflect_Constructor_constructNative(1)");
38 #warning throw an exception here
42 if (this->parameterTypes->header.size!=parameters->header.size) {
43 log_text("Parameter count mismatch in Java_java_lang_reflect_Constructor_constructNative(2)");
44 #warning throw an exception here
48 if (this->slot>=((classinfo*)clazz)->methodscount) {
49 log_text("illegal index in methods table");
53 o = builtin_new (clazz); /* create object */
55 log_text("Objet instance could not be created");
59 /* log_text("o!=NULL\n");*/
62 m = &((classinfo*)clazz)->methods[this->slot];
63 if (!((m->name == utf_new_char("<init>"))))
65 (m->descriptor == create_methodsig(this->parameterTypes,"V"))))*/
68 char logtext[MAXLOGTEXT];
69 sprintf(logtext, "Warning: class has no instance-initializer of specified type: ");
70 utf_sprint(logtext + strlen(logtext), ((struct classinfo*)clazz)->name);
72 log_plain_utf( create_methodsig(this->parameterTypes,"V"));
74 class_showconstantpool(clazz);
76 #warning throw an exception here, although this should never happen
80 /* log_text("calling initializer");*/
81 /* call initializer */
83 switch (this->parameterTypes->header.size) {
84 case 0: exceptionptr=asm_calljavamethod (m, o, NULL, NULL, NULL);
86 case 1: exceptionptr=asm_calljavamethod (m, o, parameters->data[0], NULL, NULL);
88 case 2: exceptionptr=asm_calljavamethod (m, o, parameters->data[0], parameters->data[1], NULL);
90 case 3: exceptionptr=asm_calljavamethod (m, o, parameters->data[0], parameters->data[1],
94 log_text("Not supported number of arguments in Java_java_lang_reflect_Constructor");
97 /*log_plain_utf(m->descriptor);
98 log_text("calling constructor");*/
99 (void) jni_method_invokeNativeHelper(env, m ,o, parameters);
105 * Class: java_lang_reflect_Constructor
106 * Method: getModifiers
109 JNIEXPORT s4 JNICALL Java_java_lang_reflect_Constructor_getModifiers (JNIEnv *env , struct java_lang_reflect_Constructor* this ) {
110 /* log_text("Java_java_lang_reflect_Constructor_getModifiers called");*/
111 classinfo *c=(classinfo*)(this->clazz);
112 if ((this->slot<0) || (this->slot>=c->methodscount))
113 panic("error illegal slot for method in class (getReturnType)");
114 return (c->methods[this->slot]).flags & (ACC_PUBLIC | ACC_PRIVATE | ACC_PROTECTED);
119 * These are local overrides for various environment variables in Emacs.
120 * Please do not remove this and leave it at the end of the file, where
121 * Emacs will automagically detect them.
122 * ---------------------------------------------------------------------
125 * indent-tabs-mode: t