* Removed all Id tags.
[cacao.git] / src / native / vm / gnu / java_lang_reflect_Method.c
index e105ea1a0c291d35db02eb9771434a02100fd54b..150e46201c91d15310c4d2b8fb6b1467a3098491 100644 (file)
@@ -22,8 +22,6 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: java_lang_reflect_Method.c 8311 2007-08-15 17:03:40Z panzi $
-
 */
 
 
@@ -135,7 +133,7 @@ JNIEXPORT java_lang_Class* JNICALL Java_java_lang_reflect_Method_getReturnType(J
 
        result = method_returntype_get(m);
 
-       return (java_lang_Class *) result;
+       return LLNI_classinfo_wrap(result);
 }
 
 
@@ -144,7 +142,7 @@ JNIEXPORT java_lang_Class* JNICALL Java_java_lang_reflect_Method_getReturnType(J
  * Method:    getParameterTypes
  * Signature: ()[Ljava/lang/Class;
  */
-JNIEXPORT java_objectarray* JNICALL Java_java_lang_reflect_Method_getParameterTypes(JNIEnv *env, java_lang_reflect_Method *this)
+JNIEXPORT java_handle_objectarray_t* JNICALL Java_java_lang_reflect_Method_getParameterTypes(JNIEnv *env, java_lang_reflect_Method *this)
 {
        classinfo  *c;
        methodinfo *m;
@@ -163,7 +161,7 @@ JNIEXPORT java_objectarray* JNICALL Java_java_lang_reflect_Method_getParameterTy
  * Method:    getExceptionTypes
  * Signature: ()[Ljava/lang/Class;
  */
-JNIEXPORT java_objectarray* JNICALL Java_java_lang_reflect_Method_getExceptionTypes(JNIEnv *env, java_lang_reflect_Method *this)
+JNIEXPORT java_handle_objectarray_t* JNICALL Java_java_lang_reflect_Method_getExceptionTypes(JNIEnv *env, java_lang_reflect_Method *this)
 {
        classinfo  *c;
        methodinfo *m;
@@ -182,7 +180,7 @@ JNIEXPORT java_objectarray* JNICALL Java_java_lang_reflect_Method_getExceptionTy
  * Method:    invokeNative
  * Signature: (Ljava/lang/Object;[Ljava/lang/Object;Ljava/lang/Class;I)Ljava/lang/Object;
  */
-JNIEXPORT java_lang_Object* JNICALL Java_java_lang_reflect_Method_invokeNative(JNIEnv *env, java_lang_reflect_Method *this, java_lang_Object *o, java_objectarray *args, java_lang_Class *clazz, s4 slot)
+JNIEXPORT java_lang_Object* JNICALL Java_java_lang_reflect_Method_invokeNative(JNIEnv *env, java_lang_reflect_Method *this, java_lang_Object *o, java_handle_objectarray_t *args, java_lang_Class *clazz, s4 slot)
 {
        /* just to be sure */
 
@@ -233,6 +231,7 @@ JNIEXPORT struct java_lang_Object* JNICALL Java_java_lang_reflect_Method_getDefa
        sun_reflect_ConstantPool *constantPool    = NULL;
        java_handle_t            *o               = (java_handle_t*)this;
        java_lang_Class          *constantPoolOop = NULL;
+       classinfo                *referer         = NULL;
 
        if (this == NULL) {
                exceptions_throw_nullpointerexception();
@@ -263,15 +262,16 @@ JNIEXPORT struct java_lang_Object* JNICALL Java_java_lang_reflect_Method_getDefa
                        return NULL;
                }
 
+               LLNI_class_get(this, referer);
+
                m_parseAnnotationDefault = class_resolveclassmethod(
                        class_sun_reflect_annotation_AnnotationParser,
                        utf_parseAnnotationDefault,
                        utf_desc,
-                       o->vftbl->class,
+                       referer,
                        true);
 
-               if (m_parseAnnotationDefault == NULL)
-               {
+               if (m_parseAnnotationDefault == NULL) {
                        /* method not found */
                        return NULL;
                }
@@ -288,25 +288,22 @@ JNIEXPORT struct java_lang_Object* JNICALL Java_java_lang_reflect_Method_getDefa
  * Method:    declaredAnnotations
  * Signature: ()Ljava/util/Map;
  */
-JNIEXPORT struct java_util_Map* JNICALL Java_java_lang_reflect_Method_declaredAnnotations(JNIEnv *env, struct java_lang_reflect_Method* this)
+JNIEXPORT struct java_util_Map* JNICALL Java_java_lang_reflect_Method_declaredAnnotations(JNIEnv *env, java_lang_reflect_Method *this)
 {
-       java_handle_t        *o                   = (java_handle_t*)this;
-       struct java_util_Map *declaredAnnotations = NULL;
-       java_bytearray       *annotations         = NULL;
-       java_lang_Class      *declaringClass      = NULL;
-
-       if (this == NULL) {
-               exceptions_throw_nullpointerexception();
-               return NULL;
-       }
+       java_handle_t           *o                   = (java_handle_t*)this;
+       struct java_util_Map    *declaredAnnotations = NULL;
+       java_handle_bytearray_t *annotations         = NULL;
+       java_lang_Class         *declaringClass      = NULL;
+       classinfo               *referer             = NULL;
 
        LLNI_field_get_ref(this, declaredAnnotations, declaredAnnotations);
 
        if (declaredAnnotations == NULL) {
                LLNI_field_get_val(this, annotations, annotations);
                LLNI_field_get_ref(this, clazz, declaringClass);
+               LLNI_class_get(this, referer);
 
-               declaredAnnotations = reflect_get_declaredannotatios(annotations, declaringClass, o->vftbl->class);
+               declaredAnnotations = reflect_get_declaredannotatios(annotations, declaringClass, referer);
 
                LLNI_field_set_ref(this, declaredAnnotations, declaredAnnotations);
        }
@@ -320,23 +317,20 @@ JNIEXPORT struct java_util_Map* JNICALL Java_java_lang_reflect_Method_declaredAn
  * Method:    getParameterAnnotations
  * Signature: ()[[Ljava/lang/annotation/Annotation;
  */
-JNIEXPORT java_objectarray* JNICALL Java_java_lang_reflect_Method_getParameterAnnotations(JNIEnv *env, struct java_lang_reflect_Method* this)
+JNIEXPORT java_handle_objectarray_t* JNICALL Java_java_lang_reflect_Method_getParameterAnnotations(JNIEnv *env, java_lang_reflect_Method *this)
 {
-       java_handle_t   *o                    = (java_handle_t*)this;
-       java_bytearray  *parameterAnnotations = NULL;
-       int32_t          slot                 = -1;
-       java_lang_Class *declaringClass       = NULL;
-
-       if (this == NULL) {
-               exceptions_throw_nullpointerexception();
-               return NULL;
-       }
+       java_handle_t           *o                    = (java_handle_t*)this;
+       java_handle_bytearray_t *parameterAnnotations = NULL;
+       int32_t                  slot                 = -1;
+       java_lang_Class         *declaringClass       = NULL;
+       classinfo               *referer              = NULL;
 
        LLNI_field_get_ref(this, parameterAnnotations, parameterAnnotations);
        LLNI_field_get_val(this, slot, slot);
        LLNI_field_get_ref(this, clazz, declaringClass);
+       LLNI_class_get(this, referer);
 
-       return reflect_get_parameterannotations((java_handle_t*)parameterAnnotations, slot, declaringClass, o->vftbl->class);
+       return reflect_get_parameterannotations((java_handle_t*)parameterAnnotations, slot, declaringClass, referer);
 }
 #endif