Removed return value from descriptor_params_from_paramtypes.
[cacao.git] / src / native / vm / reflection.cpp
index 14ba348a2879d137e9e1c22eb1e0b599af231a56..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.
@@ -28,7 +28,7 @@
 #include <stdint.h>
 
 #include "native/llni.h"
-#include "native/native.h"
+#include "native/native.hpp"
 
 #if defined(ENABLE_ANNOTATIONS) && defined(WITH_JAVA_RUNTIME_LIBRARY_GNU_CLASSPATH)
 # include "vm/vm.hpp"
 
 #include "native/vm/reflection.hpp"
 
-#include "vm/access.h"
+#include "vm/access.hpp"
+#include "vm/array.hpp"
 #include "vm/jit/builtin.hpp"
 #include "vm/exceptions.hpp"
 #include "vm/global.h"
 #include "vm/globals.hpp"
-#include "vm/initialize.h"
+#include "vm/initialize.hpp"
 #include "vm/javaobjects.hpp"
-#include "vm/method.h"
+#include "vm/method.hpp"
 #include "vm/string.hpp"
 
 
@@ -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);