Merged with new-trap-decoding branch at rev a792088a3f04 (branch closed).
[cacao.git] / src / native / vm / gnuclasspath / gnu_java_lang_management_VMRuntimeMXBeanImpl.cpp
index 673645eda713081270e87e07aeb8e42c4a614542..0bca5347cd76f41d99cc84602649db58b460f4eb 100644 (file)
 #include <stdint.h>
 
 #include "native/jni.hpp"
-#include "native/native.h"
+#include "native/native.hpp"
 
 #if defined(ENABLE_JNI_HEADERS)
 # include "native/vm/include/gnu_java_lang_management_VMRuntimeMXBeanImpl.h"
 #endif
 
+#include "vm/array.hpp"
 #include "vm/jit/builtin.hpp"
 #include "vm/global.h"
 #include "vm/globals.hpp"
@@ -53,7 +54,9 @@ JNIEXPORT java_handle_objectarray_t* JNICALL Java_gnu_java_lang_management_VMRun
 {
        log_println("Java_gnu_java_lang_management_VMRuntimeMXBeanImpl_getInputArguments: IMPLEMENT ME!");
 
-       return builtin_anewarray(0, class_java_lang_String);
+       ObjectArray oa(0, class_java_lang_String);
+
+       return oa.get_handle();
 }
 
 
@@ -84,16 +87,12 @@ static JNINativeMethod methods[] = {
 
 *******************************************************************************/
 
-// FIXME
-extern "C" {
 void _Jv_gnu_java_lang_management_VMRuntimeMXBeanImpl_init(void)
 {
-       utf *u;
+       utf* u = utf_new_char("gnu/java/lang/management/VMRuntimeMXBeanImpl");
 
-       u = utf_new_char("gnu/java/lang/management/VMRuntimeMXBeanImpl");
-
-       native_method_register(u, methods, NATIVE_METHODS_COUNT);
-}
+       NativeMethods& nm = VM::get_current()->get_nativemethods();
+       nm.register_methods(u, methods, NATIVE_METHODS_COUNT);
 }