diff options
author | Mark Wielaard <mark@klomp.org> | 2006-03-19 22:39:02 +0000 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2006-03-19 22:39:02 +0000 |
commit | 288bf5c74aa0e512390a1900d96968c15ab47c05 (patch) | |
tree | 6babc915c7afc073437b35deb328c4dd1a82f181 /vm | |
parent | b52dd0ef2e0a4ac240416f9cb257c7dfddfbd86f (diff) | |
download | classpath-288bf5c74aa0e512390a1900d96968c15ab47c05.tar.gz |
2006-03-19 Andrew John Hughes <gnu_andrew@member.fsf.org>
* doc/vmintegration.texinfo:
Updated to include VMArray.
* include/Makefile.am:
Replace java_lang_reflect_Array.h with
java_lang_reflect_VMArray.h
* include/java_lang_reflect_VMArray.h:
New autogenerated header.
* include/java_lang_reflect_Array.h:
Removed.
* java/lang/reflect/Array.java:
(newInstance(Class,int)): Calls VMArray.
(createMultiArray(Class,int[],int)): Likewise.
(createObjectArray(Class,int)): Removed.
* native/jni/java-lang/Makefile.am:
Replaced java_lang_reflect_Array.c with
java_lang_reflect_VMArray.c
* native/jni/java-lang/java_lang_reflect_VMArray.c:
Renamed from java_lang_reflect_Array.c.
* vm/reference/java/lang/reflect/VMArray.java:
(createObjectArray(Class,int)): Native method moved
from java.lang.reflect.Array.
Diffstat (limited to 'vm')
-rw-r--r-- | vm/reference/java/lang/reflect/VMArray.java | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/vm/reference/java/lang/reflect/VMArray.java b/vm/reference/java/lang/reflect/VMArray.java new file mode 100644 index 000000000..d6277aebd --- /dev/null +++ b/vm/reference/java/lang/reflect/VMArray.java @@ -0,0 +1,65 @@ +/* java.lang.reflect.VMArray - VM class for array manipulation by reflection. + Copyright (C) 1998, 1999, 2001, 2003, 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package java.lang.reflect; + +import gnu.classpath.Configuration; + +class VMArray +{ + + static + { + if (Configuration.INIT_LOAD_LIBRARY) + { + System.loadLibrary("javalangreflect"); + } + } + + /** + * Dynamically create an array of objects. + * + * @param type guaranteed to be a valid object type + * @param dim the length of the array + * @return the new array + * @throws NegativeArraySizeException if dim is negative + * @throws OutOfMemoryError if memory allocation fails + */ + static native Object createObjectArray(Class type, int dim); + +} |