* Removed all Id tags.
[cacao.git] / src / native / vm / gnu / java_lang_reflect_Field.c
index a58447c3993e5ae280d67c35c1c59a70be15f5d1..261fbfb03ff737c8b6424946c2bad3ebb82fe9ee 100644 (file)
@@ -22,8 +22,6 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: java_lang_reflect_Field.c 8305 2007-08-15 13:49:26Z panzi $
-
 */
 
 
@@ -230,7 +228,7 @@ JNIEXPORT java_lang_Class* JNICALL Java_java_lang_reflect_Field_getType(JNIEnv *
        if (!resolve_class_from_typedesc(desc, true, false, &ret))
                return NULL;
        
-       return (java_lang_Class *) ret;
+       return LLNI_classinfo_wrap(ret);
 }
 
 
@@ -1251,25 +1249,22 @@ JNIEXPORT java_lang_String* JNICALL Java_java_lang_reflect_Field_getSignature(JN
  * Method:    declaredAnnotations
  * Signature: ()Ljava/util/Map;
  */
-JNIEXPORT struct java_util_Map* JNICALL Java_java_lang_reflect_Field_declaredAnnotations(JNIEnv *env, struct java_lang_reflect_Field* this)
+JNIEXPORT struct java_util_Map* JNICALL Java_java_lang_reflect_Field_declaredAnnotations(JNIEnv *env, java_lang_reflect_Field *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);
        }