Removed return value from descriptor_params_from_paramtypes.
[cacao.git] / src / native / vm / reflection.cpp
index 73a8545b8afef1b164d7e7987378f5782e0b7db4..bf954ca40feecd900705936423f5eb49e306eeb0 100644 (file)
@@ -1,6 +1,6 @@
 /* src/native/vm/reflection.cpp - helper functions for java/lang/reflect
 
-   Copyright (C) 2007, 2008
+   Copyright (C) 1996-2011
    CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
 
    This file is part of CACAO.
@@ -37,6 +37,7 @@
 #include "native/vm/reflection.hpp"
 
 #include "vm/access.hpp"
+#include "vm/array.hpp"
 #include "vm/jit/builtin.hpp"
 #include "vm/exceptions.hpp"
 #include "vm/global.h"
@@ -85,8 +86,10 @@ java_handle_t* Reflection::invoke(methodinfo *m, java_handle_t *o, java_handle_o
 
        /* check if we got the right number of arguments */
 
+       ObjectArray oa(params);
+
        if (((params == NULL) && (paramcount != 0)) ||
-               (params && (LLNI_array_size(params) != paramcount))) 
+               (params && (oa.get_length() != paramcount))) 
        {
                exceptions_throw_illegalargumentexception();
                return NULL;
@@ -215,9 +218,6 @@ java_handle_objectarray_t* Reflection::get_parameterannotations(java_handle_byte
 
        int32_t numParameters = method_get_parametercount(m);
 
-       if (numParameters < 0)
-               return NULL;
-
        /* get ConstantPool */
 
        java_handle_t* h = native_new_and_init(class_sun_reflect_ConstantPool);