harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r446491 [7/24] - in /incubator/harmony/enhanced/classlib/trunk/modules: luni-kernel/.settings/ luni-kernel/META-INF/ luni-kernel/make/ luni-kernel/src/main/java/java/lang/ luni-kernel/src/main/java/java/lang/ref/ luni-kernel/src/main/java/j...
Date Fri, 15 Sep 2006 03:08:13 GMT
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/PhantomReference.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/Reference.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/Reference.java?view=diff&rev=446491&r1=446490&r2=446491
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/Reference.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/Reference.java Thu Sep 14 20:08:07 2006
@@ -1,115 +1,115 @@
-/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.lang.ref;
-
-/**
- * This class must be implemented by the vm vendor. The documented methods must
- * be implemented to support the provided subclass implementations. As the
- * provided subclass implementations are trivial and simply call
- * initReference(Object) and initReference(Object, ReferenceQueue) from their
- * constructors, the vm vendor may elect to implement the subclasses as well.
- * Abstract class which describes behavior common to all reference objects.
- * 
- * @since 1.2
- */
-public abstract class Reference<T> {
-
-    /**
-     * Constructs a new instance of this class.
-     * 
-     */
-    Reference() {
-        super();
-    }
-
-    /**
-     * Make the referent null. This does not force the reference object to be
-     * enqueued.
-     */
-    public void clear() {
-        return;
-    }
-
-    /**
-     * Force the reference object to be enqueued if it has been associated with
-     * a queue.
-     * 
-     * @return boolean true if Reference is enqueued. false otherwise.
-     */
-    public boolean enqueue() {
-        return false;
-    }
-
-    /**
-     * Return the referent of the reference object.
-     * 
-     * @return Referent to which reference refers, or null if object has been
-     *         cleared.
-     */
-    public T get() {
-        return null;
-    }
-
-    /**
-     * Return whether the reference object has been enqueued.
-     * 
-     * @return boolean true if Reference has been enqueued. false otherwise.
-     */
-    public boolean isEnqueued() {
-        return false;
-    }
-
-    /**
-     * Implement this method to support the provided subclass implementations.
-     * Initialize a newly created reference object. Associate the reference
-     * object with the referent.
-     * 
-     * @param r the referent
-     */
-    void initReference(Object r) {
-        return;
-    }
-
-    /**
-     * Implement this method to support the provided subclass implementations.
-     * Initialize a newly created reference object. Associate the reference
-     * object with the referent, and the specified ReferenceQueue.
-     * 
-     * @param r the referent
-     * @param q the ReferenceQueue
-     */
-    void initReference(Object r, ReferenceQueue<? super T> q) {
-        return;
-    }
-
-    /**
-     * Enqueue the reference object on the associated queue.
-     * 
-     * @return boolean true if the Reference was successfully enqueued. false
-     *         otherwise.
-     */
-    boolean enqueueImpl() {
-        return false;
-    }
-
-    /**
-     * Called when a Reference has been removed from its ReferenceQueue. Set the
-     * enqueued field to false.
-     */
-    void dequeue() {
-        return;
-    }
-}
+/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang.ref;
+
+/**
+ * This class must be implemented by the vm vendor. The documented methods must
+ * be implemented to support the provided subclass implementations. As the
+ * provided subclass implementations are trivial and simply call
+ * initReference(Object) and initReference(Object, ReferenceQueue) from their
+ * constructors, the vm vendor may elect to implement the subclasses as well.
+ * Abstract class which describes behavior common to all reference objects.
+ * 
+ * @since 1.2
+ */
+public abstract class Reference<T> {
+
+    /**
+     * Constructs a new instance of this class.
+     * 
+     */
+    Reference() {
+        super();
+    }
+
+    /**
+     * Make the referent null. This does not force the reference object to be
+     * enqueued.
+     */
+    public void clear() {
+        return;
+    }
+
+    /**
+     * Force the reference object to be enqueued if it has been associated with
+     * a queue.
+     * 
+     * @return boolean true if Reference is enqueued. false otherwise.
+     */
+    public boolean enqueue() {
+        return false;
+    }
+
+    /**
+     * Return the referent of the reference object.
+     * 
+     * @return Referent to which reference refers, or null if object has been
+     *         cleared.
+     */
+    public T get() {
+        return null;
+    }
+
+    /**
+     * Return whether the reference object has been enqueued.
+     * 
+     * @return boolean true if Reference has been enqueued. false otherwise.
+     */
+    public boolean isEnqueued() {
+        return false;
+    }
+
+    /**
+     * Implement this method to support the provided subclass implementations.
+     * Initialize a newly created reference object. Associate the reference
+     * object with the referent.
+     * 
+     * @param r the referent
+     */
+    void initReference(Object r) {
+        return;
+    }
+
+    /**
+     * Implement this method to support the provided subclass implementations.
+     * Initialize a newly created reference object. Associate the reference
+     * object with the referent, and the specified ReferenceQueue.
+     * 
+     * @param r the referent
+     * @param q the ReferenceQueue
+     */
+    void initReference(Object r, ReferenceQueue<? super T> q) {
+        return;
+    }
+
+    /**
+     * Enqueue the reference object on the associated queue.
+     * 
+     * @return boolean true if the Reference was successfully enqueued. false
+     *         otherwise.
+     */
+    boolean enqueueImpl() {
+        return false;
+    }
+
+    /**
+     * Called when a Reference has been removed from its ReferenceQueue. Set the
+     * enqueued field to false.
+     */
+    void dequeue() {
+        return;
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/Reference.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/SoftReference.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/SoftReference.java?view=diff&rev=446491&r1=446490&r2=446491
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/SoftReference.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/SoftReference.java Thu Sep 14 20:08:07 2006
@@ -1,57 +1,57 @@
-/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.lang.ref;
-
-/**
- * SoftReference objects are used to detect referents which are no longer
- * visible and who's memory is to be reclaimed.
- * 
- * @since 1.2
- */
-public class SoftReference<T> extends Reference<T> {
-
-    /**
-     * Constructs a new instance of this class.
-     * 
-     * @param r referent to track.
-     */
-    public SoftReference(T r) {
-        super();
-        initReference(r);
-    }
-    
-    /**
-     * Constructs a new instance of this class.
-     * 
-     * @param r referent to track.
-     * @param q queue to register to the reference object with.
-     */
-    public SoftReference(T r, ReferenceQueue<? super T> q) {
-        super();
-        initReference(r, q);
-    }
-
-    /**
-     * Return the referent of the reference object.
-     * 
-     * @return Object Referent to which reference refers, or null if object has
-     *         been cleared.
-     */
-    @Override
-    public T get() {
-        return super.get();
-    }
-}
+/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang.ref;
+
+/**
+ * SoftReference objects are used to detect referents which are no longer
+ * visible and who's memory is to be reclaimed.
+ * 
+ * @since 1.2
+ */
+public class SoftReference<T> extends Reference<T> {
+
+    /**
+     * Constructs a new instance of this class.
+     * 
+     * @param r referent to track.
+     */
+    public SoftReference(T r) {
+        super();
+        initReference(r);
+    }
+    
+    /**
+     * Constructs a new instance of this class.
+     * 
+     * @param r referent to track.
+     * @param q queue to register to the reference object with.
+     */
+    public SoftReference(T r, ReferenceQueue<? super T> q) {
+        super();
+        initReference(r, q);
+    }
+
+    /**
+     * Return the referent of the reference object.
+     * 
+     * @return Object Referent to which reference refers, or null if object has
+     *         been cleared.
+     */
+    @Override
+    public T get() {
+        return super.get();
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/SoftReference.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/WeakReference.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/WeakReference.java?view=diff&rev=446491&r1=446490&r2=446491
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/WeakReference.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/WeakReference.java Thu Sep 14 20:08:07 2006
@@ -1,46 +1,46 @@
-/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.lang.ref;
-
-/**
- * WeakReference objects are used to detect referents which are no longer
- * visible.
- * 
- * @since 1.2
- */
-public class WeakReference<T> extends Reference<T> {
-
-    /**
-     * Constructs a new instance of this class.
-     * 
-     * @param r referent to track.
-     */
-    public WeakReference(T r) {
-        super();
-        initReference(r);
-    }
-
-    /**
-     * Constructs a new instance of this class.
-     * 
-     * @param r referent to track.
-     * @param q queue to register to the reference object with.
-     */
-    public WeakReference(T r, ReferenceQueue<? super T> q) {
-        super();
-        initReference(r, q);
-    }
-}
+/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang.ref;
+
+/**
+ * WeakReference objects are used to detect referents which are no longer
+ * visible.
+ * 
+ * @since 1.2
+ */
+public class WeakReference<T> extends Reference<T> {
+
+    /**
+     * Constructs a new instance of this class.
+     * 
+     * @param r referent to track.
+     */
+    public WeakReference(T r) {
+        super();
+        initReference(r);
+    }
+
+    /**
+     * Constructs a new instance of this class.
+     * 
+     * @param r referent to track.
+     * @param q queue to register to the reference object with.
+     */
+    public WeakReference(T r, ReferenceQueue<? super T> q) {
+        super();
+        initReference(r, q);
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/WeakReference.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/reflect/AccessibleObject.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/reflect/AccessibleObject.java?view=diff&rev=446491&r1=446490&r2=446491
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/reflect/AccessibleObject.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/reflect/AccessibleObject.java Thu Sep 14 20:08:07 2006
@@ -1,270 +1,270 @@
-/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.lang.reflect;
-
-import java.lang.annotation.Annotation;
-
-/**
- * This class must be implemented by the VM vendor. This class is the superclass
- * of all member reflect classes (Field, Constructor, Method). AccessibleObject
- * provides the ability to toggle access checks for these objects. By default
- * accessing a member (for example, setting a field or invoking a method) checks
- * the validity of the access (for example, invoking a private method from
- * outside the defining class is prohibited) and throws IllegalAccessException
- * if the operation is not permitted. If the accessible flag is set to true,
- * these checks are omitted. This allows privileged applications such as Java
- * Object Serialization, inspectors, and debuggers to have complete access to
- * objects.
- * 
- * @see Field
- * @see Constructor
- * @see Method
- * @see ReflectPermission
- * @since 1.2
- */
-public class AccessibleObject implements AnnotatedElement {
-    /**
-     * TODO Is this necessary?
-     */
-    static final Object[] emptyArgs = new Object[0];
-
-    /**
-     * Attempts to set the value of the accessible flag for all the objects in
-     * the array provided. Only one security check is performed. Setting this
-     * flag to false will enable access checks, setting to true will disable
-     * them. If there is a security manager, checkPermission is called with a
-     * ReflectPermission("suppressAccessChecks").
-     * 
-     * @param objects the accessible objects
-     * @param flag the new value for the accessible flag
-     * @see #setAccessible(boolean)
-     * @see ReflectPermission
-     * @throws SecurityException if the request is denied
-     */
-    public static void setAccessible(AccessibleObject[] objects, boolean flag)
-            throws SecurityException {
-        return;
-    }
-
-    /**
-     * <p>
-     * TODO Document this method.
-     * </p>
-     * 
-     * @param parameterTypes
-     * @param args
-     * @return
-     * @throws IllegalArgumentException
-     */
-    static Object[] marshallArguments(Class[] parameterTypes, Object[] args)
-            throws IllegalArgumentException {
-        return null;
-    }
-
-    /**
-     * <p>
-     * TODO Document this method.
-     * </p>
-     * 
-     * @param clazz
-     */
-    static native void initializeClass(Class<?> clazz);
-
-    /**
-     * Answer the class at depth. Notes: 1) This method operates on the defining
-     * classes of methods on stack. NOT the classes of receivers. 2) The item at
-     * index zero describes the caller of this method.
-     */
-    static final native Class<?> getStackClass(int depth);
-
-    /**
-     * AccessibleObject constructor. AccessibleObjects can only be created by
-     * the Virtual Machine.
-     */
-    protected AccessibleObject() {
-        super();
-    }
-
-    /**
-     * <p>
-     * TODO Document this method.
-     * </p>
-     * 
-     * @return
-     */
-    native Class[] getParameterTypesImpl();
-
-    /**
-     * <p>
-     * TODO Document this method.
-     * </p>
-     * 
-     * @return
-     */
-    native int getModifiers();
-
-    /**
-     * <p>
-     * TODO Document this method.
-     * </p>
-     * 
-     * @return
-     */
-    native Class[] getExceptionTypesImpl();
-
-    /**
-     * <p>
-     * TODO Document this method.
-     * </p>
-     * 
-     * @return
-     */
-    native String getSignature();
-
-    /**
-     * <p>
-     * TODO Document this method.
-     * </p>
-     * 
-     * @param senderClass
-     * @param receiver
-     * @return
-     */
-    native boolean checkAccessibility(Class<?> senderClass, Object receiver);
-
-    /**
-     * Returns the value of the accessible flag. This is false if access checks
-     * are performed, true if they are skipped.
-     * 
-     * @return the value of the accessible flag
-     */
-    public boolean isAccessible() {
-        return false;
-    }
-
-    /**
-     * Attempts to set the value of the accessible flag. Setting this flag to
-     * false will enable access checks, setting to true will disable them. If
-     * there is a security manager, checkPermission is called with a
-     * ReflectPermission("suppressAccessChecks").
-     * 
-     * @param flag the new value for the accessible flag
-     * @see ReflectPermission
-     * @throws SecurityException if the request is denied
-     */
-    public void setAccessible(boolean flag) throws SecurityException {
-        return;
-    }
-
-    public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) {
-        return false;
-    }
-
-    public Annotation[] getDeclaredAnnotations() {
-        return new Annotation[0];
-    }
-
-    public Annotation[] getAnnotations() {
-        return new Annotation[0];
-    }
-
-    public <T extends Annotation> T getAnnotation(Class<T> annotationType) {
-        return null;
-    }
-
-    /**
-     * <p>
-     * TODO Document this method.
-     * </p>
-     * 
-     * @param receiver
-     * @param args
-     * @throws InvocationTargetException
-     */
-    void invokeV(Object receiver, Object args[]) throws InvocationTargetException {
-        return;
-    }
-
-    /**
-     * <p>
-     * TODO Document this method.
-     * </p>
-     * 
-     * @param receiver
-     * @param args
-     * @return
-     * @throws InvocationTargetException
-     */
-    Object invokeL(Object receiver, Object args[]) throws InvocationTargetException {
-        return null;
-    }
-
-    /**
-     * <p>
-     * TODO Document this method.
-     * </p>
-     * 
-     * @param receiver
-     * @param args
-     * @return
-     * @throws InvocationTargetException
-     */
-    int invokeI(Object receiver, Object args[]) throws InvocationTargetException {
-        return 0;
-    }
-
-    /**
-     * <p>
-     * TODO Document this method.
-     * </p>
-     * 
-     * @param receiver
-     * @param args
-     * @return
-     * @throws InvocationTargetException
-     */
-    long invokeJ(Object receiver, Object args[]) throws InvocationTargetException {
-        return 0L;
-    }
-
-    /**
-     * <p>
-     * TODO Document this method.
-     * </p>
-     * 
-     * @param receiver
-     * @param args
-     * @return
-     * @throws InvocationTargetException
-     */
-    float invokeF(Object receiver, Object args[]) throws InvocationTargetException {
-        return 0.0F;
-    }
-
-    /**
-     * <p>
-     * TODO Document this method.
-     * </p>
-     * 
-     * @param receiver
-     * @param args
-     * @return
-     * @throws InvocationTargetException
-     */
-    double invokeD(Object receiver, Object args[]) throws InvocationTargetException {
-        return 0.0D;
-    }
-}
+/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang.reflect;
+
+import java.lang.annotation.Annotation;
+
+/**
+ * This class must be implemented by the VM vendor. This class is the superclass
+ * of all member reflect classes (Field, Constructor, Method). AccessibleObject
+ * provides the ability to toggle access checks for these objects. By default
+ * accessing a member (for example, setting a field or invoking a method) checks
+ * the validity of the access (for example, invoking a private method from
+ * outside the defining class is prohibited) and throws IllegalAccessException
+ * if the operation is not permitted. If the accessible flag is set to true,
+ * these checks are omitted. This allows privileged applications such as Java
+ * Object Serialization, inspectors, and debuggers to have complete access to
+ * objects.
+ * 
+ * @see Field
+ * @see Constructor
+ * @see Method
+ * @see ReflectPermission
+ * @since 1.2
+ */
+public class AccessibleObject implements AnnotatedElement {
+    /**
+     * TODO Is this necessary?
+     */
+    static final Object[] emptyArgs = new Object[0];
+
+    /**
+     * Attempts to set the value of the accessible flag for all the objects in
+     * the array provided. Only one security check is performed. Setting this
+     * flag to false will enable access checks, setting to true will disable
+     * them. If there is a security manager, checkPermission is called with a
+     * ReflectPermission("suppressAccessChecks").
+     * 
+     * @param objects the accessible objects
+     * @param flag the new value for the accessible flag
+     * @see #setAccessible(boolean)
+     * @see ReflectPermission
+     * @throws SecurityException if the request is denied
+     */
+    public static void setAccessible(AccessibleObject[] objects, boolean flag)
+            throws SecurityException {
+        return;
+    }
+
+    /**
+     * <p>
+     * TODO Document this method.
+     * </p>
+     * 
+     * @param parameterTypes
+     * @param args
+     * @return
+     * @throws IllegalArgumentException
+     */
+    static Object[] marshallArguments(Class[] parameterTypes, Object[] args)
+            throws IllegalArgumentException {
+        return null;
+    }
+
+    /**
+     * <p>
+     * TODO Document this method.
+     * </p>
+     * 
+     * @param clazz
+     */
+    static native void initializeClass(Class<?> clazz);
+
+    /**
+     * Answer the class at depth. Notes: 1) This method operates on the defining
+     * classes of methods on stack. NOT the classes of receivers. 2) The item at
+     * index zero describes the caller of this method.
+     */
+    static final native Class<?> getStackClass(int depth);
+
+    /**
+     * AccessibleObject constructor. AccessibleObjects can only be created by
+     * the Virtual Machine.
+     */
+    protected AccessibleObject() {
+        super();
+    }
+
+    /**
+     * <p>
+     * TODO Document this method.
+     * </p>
+     * 
+     * @return
+     */
+    native Class[] getParameterTypesImpl();
+
+    /**
+     * <p>
+     * TODO Document this method.
+     * </p>
+     * 
+     * @return
+     */
+    native int getModifiers();
+
+    /**
+     * <p>
+     * TODO Document this method.
+     * </p>
+     * 
+     * @return
+     */
+    native Class[] getExceptionTypesImpl();
+
+    /**
+     * <p>
+     * TODO Document this method.
+     * </p>
+     * 
+     * @return
+     */
+    native String getSignature();
+
+    /**
+     * <p>
+     * TODO Document this method.
+     * </p>
+     * 
+     * @param senderClass
+     * @param receiver
+     * @return
+     */
+    native boolean checkAccessibility(Class<?> senderClass, Object receiver);
+
+    /**
+     * Returns the value of the accessible flag. This is false if access checks
+     * are performed, true if they are skipped.
+     * 
+     * @return the value of the accessible flag
+     */
+    public boolean isAccessible() {
+        return false;
+    }
+
+    /**
+     * Attempts to set the value of the accessible flag. Setting this flag to
+     * false will enable access checks, setting to true will disable them. If
+     * there is a security manager, checkPermission is called with a
+     * ReflectPermission("suppressAccessChecks").
+     * 
+     * @param flag the new value for the accessible flag
+     * @see ReflectPermission
+     * @throws SecurityException if the request is denied
+     */
+    public void setAccessible(boolean flag) throws SecurityException {
+        return;
+    }
+
+    public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) {
+        return false;
+    }
+
+    public Annotation[] getDeclaredAnnotations() {
+        return new Annotation[0];
+    }
+
+    public Annotation[] getAnnotations() {
+        return new Annotation[0];
+    }
+
+    public <T extends Annotation> T getAnnotation(Class<T> annotationType) {
+        return null;
+    }
+
+    /**
+     * <p>
+     * TODO Document this method.
+     * </p>
+     * 
+     * @param receiver
+     * @param args
+     * @throws InvocationTargetException
+     */
+    void invokeV(Object receiver, Object args[]) throws InvocationTargetException {
+        return;
+    }
+
+    /**
+     * <p>
+     * TODO Document this method.
+     * </p>
+     * 
+     * @param receiver
+     * @param args
+     * @return
+     * @throws InvocationTargetException
+     */
+    Object invokeL(Object receiver, Object args[]) throws InvocationTargetException {
+        return null;
+    }
+
+    /**
+     * <p>
+     * TODO Document this method.
+     * </p>
+     * 
+     * @param receiver
+     * @param args
+     * @return
+     * @throws InvocationTargetException
+     */
+    int invokeI(Object receiver, Object args[]) throws InvocationTargetException {
+        return 0;
+    }
+
+    /**
+     * <p>
+     * TODO Document this method.
+     * </p>
+     * 
+     * @param receiver
+     * @param args
+     * @return
+     * @throws InvocationTargetException
+     */
+    long invokeJ(Object receiver, Object args[]) throws InvocationTargetException {
+        return 0L;
+    }
+
+    /**
+     * <p>
+     * TODO Document this method.
+     * </p>
+     * 
+     * @param receiver
+     * @param args
+     * @return
+     * @throws InvocationTargetException
+     */
+    float invokeF(Object receiver, Object args[]) throws InvocationTargetException {
+        return 0.0F;
+    }
+
+    /**
+     * <p>
+     * TODO Document this method.
+     * </p>
+     * 
+     * @param receiver
+     * @param args
+     * @return
+     * @throws InvocationTargetException
+     */
+    double invokeD(Object receiver, Object args[]) throws InvocationTargetException {
+        return 0.0D;
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/reflect/AccessibleObject.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/reflect/Array.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/reflect/Array.java?view=diff&rev=446491&r1=446490&r2=446491
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/reflect/Array.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/reflect/Array.java Thu Sep 14 20:08:07 2006
@@ -1,494 +1,494 @@
-/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.lang.reflect;
-
-/**
- * This class must be implemented by the VM vendor. This class provides methods
- * to dynamically create and access arrays.
- */
-public final class Array {
-    /**
-     * <p>TODO Document this method. Is it actually used?</p>
-     * @param componentType
-     * @param dimensions
-     * @param dimensionsArray
-     * @return
-     */
-    @SuppressWarnings("unused")
-    private static native Object multiNewArrayImpl(Class<?> componentType,
-            int dimensions, int[] dimensionsArray);
-
-    /**
-     * <p>TODO Document this method. Is it actually used?</p>
-     * @param componentType
-     * @param dimension
-     * @return
-     */
-    @SuppressWarnings("unused")
-    private static native Object newArrayImpl(Class<?> componentType, int dimension);
-    
-	/**
-	 * Return the element of the array at the specified index. This reproduces
-	 * the effect of <code>array[index]</code> If the array component is a
-	 * base type, the result is automatically wrapped.
-	 * 
-	 * @param array
-	 *            the array
-	 * @param index
-	 *            the index
-	 * @return the requested element, possibly wrapped
-	 * @throws java.lang.NullPointerException
-	 *                if the array is null
-	 * @throws java.lang.IllegalArgumentException
-	 *                if the array is not an array
-	 * @throws java.lang.ArrayIndexOutOfBoundsException
-	 *                if the index is out of bounds -- negative or greater than
-	 *                or equal to the array length
-	 */
-	public static native Object get(Object array, int index)
-			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
-
-	/**
-	 * Return the element of the array at the specified index, converted to a
-	 * boolean if possible. This reproduces the effect of
-	 * <code>array[index]</code>
-	 * 
-	 * @param array
-	 *            the array
-	 * @param index
-	 *            the index
-	 * @return the requested element
-	 * @throws java.lang.NullPointerException
-	 *                if the array is null
-	 * @throws java.lang.IllegalArgumentException
-	 *                if the array is not an array or the element cannot be
-	 *                converted to the requested type by a widening conversion
-	 * @throws java.lang.ArrayIndexOutOfBoundsException
-	 *                if the index is out of bounds -- negative or greater than
-	 *                or equal to the array length
-	 */
-	public static native boolean getBoolean(Object array, int index)
-			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
-
-	/**
-	 * Return the element of the array at the specified index, converted to a
-	 * byte if possible. This reproduces the effect of <code>array[index]</code>
-	 * 
-	 * @param array
-	 *            the array
-	 * @param index
-	 *            the index
-	 * @return the requested element
-	 * @throws java.lang.NullPointerException
-	 *                if the array is null
-	 * @throws java.lang.IllegalArgumentException
-	 *                if the array is not an array or the element cannot be
-	 *                converted to the requested type by a widening conversion
-	 * @throws java.lang.ArrayIndexOutOfBoundsException
-	 *                if the index is out of bounds -- negative or greater than
-	 *                or equal to the array length
-	 */
-	public static native byte getByte(Object array, int index)
-			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
-
-	/**
-	 * Return the element of the array at the specified index, converted to a
-	 * char if possible. This reproduces the effect of <code>array[index]</code>
-	 * 
-	 * @param array
-	 *            the array
-	 * @param index
-	 *            the index
-	 * @return the requested element
-	 * @throws java.lang.NullPointerException
-	 *                if the array is null
-	 * @throws java.lang.IllegalArgumentException
-	 *                if the array is not an array or the element cannot be
-	 *                converted to the requested type by a widening conversion
-	 * @throws java.lang.ArrayIndexOutOfBoundsException
-	 *                if the index is out of bounds -- negative or greater than
-	 *                or equal to the array length
-	 */
-	public static native char getChar(Object array, int index)
-			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
-
-	/**
-	 * Return the element of the array at the specified index, converted to a
-	 * double if possible. This reproduces the effect of
-	 * <code>array[index]</code>
-	 * 
-	 * @param array
-	 *            the array
-	 * @param index
-	 *            the index
-	 * @return the requested element
-	 * @throws java.lang.NullPointerException
-	 *                if the array is null
-	 * @throws java.lang.IllegalArgumentException
-	 *                if the array is not an array or the element cannot be
-	 *                converted to the requested type by a widening conversion
-	 * @throws java.lang.ArrayIndexOutOfBoundsException
-	 *                if the index is out of bounds -- negative or greater than
-	 *                or equal to the array length
-	 */
-	public static native double getDouble(Object array, int index)
-			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
-
-	/**
-	 * Return the element of the array at the specified index, converted to a
-	 * float if possible. This reproduces the effect of
-	 * <code>array[index]</code>
-	 * 
-	 * @param array
-	 *            the array
-	 * @param index
-	 *            the index
-	 * @return the requested element
-	 * @throws java.lang.NullPointerException
-	 *                if the array is null
-	 * @throws java.lang.IllegalArgumentException
-	 *                if the array is not an array or the element cannot be
-	 *                converted to the requested type by a widening conversion
-	 * @throws java.lang.ArrayIndexOutOfBoundsException
-	 *                if the index is out of bounds -- negative or greater than
-	 *                or equal to the array length
-	 */
-	public static native float getFloat(Object array, int index)
-			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
-
-	/**
-	 * Return the element of the array at the specified index, converted to an
-	 * int if possible. This reproduces the effect of <code>array[index]</code>
-	 * 
-	 * @param array
-	 *            the array
-	 * @param index
-	 *            the index
-	 * @return the requested element
-	 * @throws java.lang.NullPointerException
-	 *                if the array is null
-	 * @throws java.lang.IllegalArgumentException
-	 *                if the array is not an array or the element cannot be
-	 *                converted to the requested type by a widening conversion
-	 * @throws java.lang.ArrayIndexOutOfBoundsException
-	 *                if the index is out of bounds -- negative or greater than
-	 *                or equal to the array length
-	 */
-	public static native int getInt(Object array, int index)
-			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
-
-	/**
-	 * Return the length of the array. This reproduces the effect of
-	 * <code>array.length</code>
-	 * 
-	 * @param array
-	 *            the array
-	 * @return the length
-	 * @throws java.lang.NullPointerException
-	 *                if the array is null
-	 * @throws java.lang.IllegalArgumentException
-	 *                if the array is not an array
-	 */
-	public static native int getLength(Object array)
-			throws IllegalArgumentException;
-
-	/**
-	 * Return the element of the array at the specified index, converted to a
-	 * long if possible. This reproduces the effect of <code>array[index]</code>
-	 * 
-	 * @param array
-	 *            the array
-	 * @param index
-	 *            the index
-	 * @return the requested element
-	 * @throws java.lang.NullPointerException
-	 *                if the array is null
-	 * @throws java.lang.IllegalArgumentException
-	 *                if the array is not an array or the element cannot be
-	 *                converted to the requested type by a widening conversion
-	 * @throws java.lang.ArrayIndexOutOfBoundsException
-	 *                if the index is out of bounds -- negative or greater than
-	 *                or equal to the array length
-	 */
-	public static native long getLong(Object array, int index)
-			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
-
-	/**
-	 * Return the element of the array at the specified index, converted to a
-	 * short if possible. This reproduces the effect of
-	 * <code>array[index]</code>
-	 * 
-	 * @param array
-	 *            the array
-	 * @param index
-	 *            the index
-	 * @return the requested element
-	 * @throws java.lang.NullPointerException
-	 *                if the array is null
-	 * @throws java.lang.IllegalArgumentException
-	 *                if the array is not an array or the element cannot be
-	 *                converted to the requested type by a widening conversion
-	 * @throws java.lang.ArrayIndexOutOfBoundsException
-	 *                if the index is out of bounds -- negative or greater than
-	 *                or equal to the array length
-	 */
-	public static native short getShort(Object array, int index)
-			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
-
-	/**
-	 * Return a new multidimensional array of the specified component type and
-	 * dimensions. This reproduces the effect of
-	 * <code>new componentType[d0][d1]...[dn]</code> for a dimensions array of {
-	 * d0, d1, ... , dn }
-	 * 
-	 * @param componentType
-	 *            the component type of the new array
-	 * @param dimensions
-	 *            the dimensions of the new array
-	 * @return the new array
-	 * @throws java.lang.NullPointerException
-	 *                if the component type is null
-	 * @throws java.lang.NegativeArraySizeException
-	 *                if any of the dimensions are negative
-	 * @throws java.lang.IllegalArgumentException
-	 *                if the array of dimensions is of size zero, or exceeds the
-	 *                limit of the number of dimension for an array (currently
-	 *                255)
-	 */
-	public static Object newInstance(Class<?> componentType, int[] dimensions)
-			throws NegativeArraySizeException, IllegalArgumentException {
-		return null;
-	}
-
-	/**
-	 * Return a new array of the specified component type and length. This
-	 * reproduces the effect of <code>new componentType[size]</code>
-	 * 
-	 * @param componentType
-	 *            the component type of the new array
-	 * @param size
-	 *            the length of the new array
-	 * @return the new array
-	 * @throws java.lang.NullPointerException
-	 *                if the component type is null
-	 * @throws java.lang.NegativeArraySizeException
-	 *                if the size if negative
-	 */
-	public static Object newInstance(Class<?> componentType, int size)
-			throws NegativeArraySizeException {
-		return null;
-	}
-
-	/**
-	 * Set the element of the array at the specified index to the value. This
-	 * reproduces the effect of <code>array[index] = value</code> If the array
-	 * component is a base type, the value is automatically unwrapped
-	 * 
-	 * @param array
-	 *            the array
-	 * @param index
-	 *            the index
-	 * @param value
-	 *            the new value
-	 * @throws java.lang.NullPointerException
-	 *                if the array is null
-	 * @throws java.lang.IllegalArgumentException
-	 *                if the array is not an array or the value cannot be
-	 *                converted to the array type by a widening conversion
-	 * @throws java.lang.ArrayIndexOutOfBoundsException
-	 *                if the index is out of bounds -- negative or greater than
-	 *                or equal to the array length
-	 */
-	public static native void set(Object array, int index, Object value)
-			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
-
-	/**
-	 * Set the element of the array at the specified index to the boolean value.
-	 * This reproduces the effect of <code>array[index] = value</code>
-	 * 
-	 * @param array
-	 *            the array
-	 * @param index
-	 *            the index
-	 * @param value
-	 *            the new value
-	 * @throws java.lang.NullPointerException
-	 *                if the array is null
-	 * @throws java.lang.IllegalArgumentException
-	 *                if the array is not an array or the value cannot be
-	 *                converted to the array type by a widening conversion
-	 * @throws java.lang.ArrayIndexOutOfBoundsException
-	 *                if the index is out of bounds -- negative or greater than
-	 *                or equal to the array length
-	 */
-	public static native void setBoolean(Object array, int index, boolean value)
-			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
-
-	/**
-	 * Set the element of the array at the specified index to the byte value.
-	 * This reproduces the effect of <code>array[index] = value</code>
-	 * 
-	 * @param array
-	 *            the array
-	 * @param index
-	 *            the index
-	 * @param value
-	 *            the new value
-	 * @throws java.lang.NullPointerException
-	 *                if the array is null
-	 * @throws java.lang.IllegalArgumentException
-	 *                if the array is not an array or the value cannot be
-	 *                converted to the array type by a widening conversion
-	 * @throws java.lang.ArrayIndexOutOfBoundsException
-	 *                if the index is out of bounds -- negative or greater than
-	 *                or equal to the array length
-	 */
-	public static native void setByte(Object array, int index, byte value)
-			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
-
-	/**
-	 * Set the element of the array at the specified index to the char value.
-	 * This reproduces the effect of <code>array[index] = value</code>
-	 * 
-	 * @param array
-	 *            the array
-	 * @param index
-	 *            the index
-	 * @param value
-	 *            the new value
-	 * @throws java.lang.NullPointerException
-	 *                if the array is null
-	 * @throws java.lang.IllegalArgumentException
-	 *                if the array is not an array or the value cannot be
-	 *                converted to the array type by a widening conversion
-	 * @throws java.lang.ArrayIndexOutOfBoundsException
-	 *                if the index is out of bounds -- negative or greater than
-	 *                or equal to the array length
-	 */
-	public static native void setChar(Object array, int index, char value)
-			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
-
-	/**
-	 * Set the element of the array at the specified index to the double value.
-	 * This reproduces the effect of <code>array[index] = value</code>
-	 * 
-	 * @param array
-	 *            the array
-	 * @param index
-	 *            the index
-	 * @param value
-	 *            the new value
-	 * @throws java.lang.NullPointerException
-	 *                if the array is null
-	 * @throws java.lang.IllegalArgumentException
-	 *                if the array is not an array or the value cannot be
-	 *                converted to the array type by a widening conversion
-	 * @throws java.lang.ArrayIndexOutOfBoundsException
-	 *                if the index is out of bounds -- negative or greater than
-	 *                or equal to the array length
-	 */
-	public static native void setDouble(Object array, int index, double value)
-			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
-
-	/**
-	 * Set the element of the array at the specified index to the float value.
-	 * This reproduces the effect of <code>array[index] = value</code>
-	 * 
-	 * @param array
-	 *            the array
-	 * @param index
-	 *            the index
-	 * @param value
-	 *            the new value
-	 * @throws java.lang.NullPointerException
-	 *                if the array is null
-	 * @throws java.lang.IllegalArgumentException
-	 *                if the array is not an array or the value cannot be
-	 *                converted to the array type by a widening conversion
-	 * @throws java.lang.ArrayIndexOutOfBoundsException
-	 *                if the index is out of bounds -- negative or greater than
-	 *                or equal to the array length
-	 */
-	public static native void setFloat(Object array, int index, float value)
-			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
-
-	/**
-	 * Set the element of the array at the specified index to the int value.
-	 * This reproduces the effect of <code>array[index] = value</code>
-	 * 
-	 * @param array
-	 *            the array
-	 * @param index
-	 *            the index
-	 * @param value
-	 *            the new value
-	 * @throws java.lang.NullPointerException
-	 *                if the array is null
-	 * @throws java.lang.IllegalArgumentException
-	 *                if the array is not an array or the value cannot be
-	 *                converted to the array type by a widening conversion
-	 * @throws java.lang.ArrayIndexOutOfBoundsException
-	 *                if the index is out of bounds -- negative or greater than
-	 *                or equal to the array length
-	 */
-	public static native void setInt(Object array, int index, int value)
-			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
-
-	/**
-	 * Set the element of the array at the specified index to the long value.
-	 * This reproduces the effect of <code>array[index] = value</code>
-	 * 
-	 * @param array
-	 *            the array
-	 * @param index
-	 *            the index
-	 * @param value
-	 *            the new value
-	 * @throws java.lang.NullPointerException
-	 *                if the array is null
-	 * @throws java.lang.IllegalArgumentException
-	 *                if the array is not an array or the value cannot be
-	 *                converted to the array type by a widening conversion
-	 * @throws java.lang.ArrayIndexOutOfBoundsException
-	 *                if the index is out of bounds -- negative or greater than
-	 *                or equal to the array length
-	 */
-	public static native void setLong(Object array, int index, long value)
-			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
-
-	/**
-	 * Set the element of the array at the specified index to the short value.
-	 * This reproduces the effect of <code>array[index] = value</code>
-	 * 
-	 * @param array
-	 *            the array
-	 * @param index
-	 *            the index
-	 * @param value
-	 *            the new value
-	 * @throws java.lang.NullPointerException
-	 *                if the array is null
-	 * @throws java.lang.IllegalArgumentException
-	 *                if the array is not an array or the value cannot be
-	 *                converted to the array type by a widening conversion
-	 * @throws java.lang.ArrayIndexOutOfBoundsException
-	 *                if the index is out of bounds -- negative or greater than
-	 *                or equal to the array length
-	 */
-	public static native void setShort(Object array, int index, short value)
-			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
-
-}
+/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang.reflect;
+
+/**
+ * This class must be implemented by the VM vendor. This class provides methods
+ * to dynamically create and access arrays.
+ */
+public final class Array {
+    /**
+     * <p>TODO Document this method. Is it actually used?</p>
+     * @param componentType
+     * @param dimensions
+     * @param dimensionsArray
+     * @return
+     */
+    @SuppressWarnings("unused")
+    private static native Object multiNewArrayImpl(Class<?> componentType,
+            int dimensions, int[] dimensionsArray);
+
+    /**
+     * <p>TODO Document this method. Is it actually used?</p>
+     * @param componentType
+     * @param dimension
+     * @return
+     */
+    @SuppressWarnings("unused")
+    private static native Object newArrayImpl(Class<?> componentType, int dimension);
+    
+	/**
+	 * Return the element of the array at the specified index. This reproduces
+	 * the effect of <code>array[index]</code> If the array component is a
+	 * base type, the result is automatically wrapped.
+	 * 
+	 * @param array
+	 *            the array
+	 * @param index
+	 *            the index
+	 * @return the requested element, possibly wrapped
+	 * @throws java.lang.NullPointerException
+	 *                if the array is null
+	 * @throws java.lang.IllegalArgumentException
+	 *                if the array is not an array
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
+	 *                if the index is out of bounds -- negative or greater than
+	 *                or equal to the array length
+	 */
+	public static native Object get(Object array, int index)
+			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
+
+	/**
+	 * Return the element of the array at the specified index, converted to a
+	 * boolean if possible. This reproduces the effect of
+	 * <code>array[index]</code>
+	 * 
+	 * @param array
+	 *            the array
+	 * @param index
+	 *            the index
+	 * @return the requested element
+	 * @throws java.lang.NullPointerException
+	 *                if the array is null
+	 * @throws java.lang.IllegalArgumentException
+	 *                if the array is not an array or the element cannot be
+	 *                converted to the requested type by a widening conversion
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
+	 *                if the index is out of bounds -- negative or greater than
+	 *                or equal to the array length
+	 */
+	public static native boolean getBoolean(Object array, int index)
+			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
+
+	/**
+	 * Return the element of the array at the specified index, converted to a
+	 * byte if possible. This reproduces the effect of <code>array[index]</code>
+	 * 
+	 * @param array
+	 *            the array
+	 * @param index
+	 *            the index
+	 * @return the requested element
+	 * @throws java.lang.NullPointerException
+	 *                if the array is null
+	 * @throws java.lang.IllegalArgumentException
+	 *                if the array is not an array or the element cannot be
+	 *                converted to the requested type by a widening conversion
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
+	 *                if the index is out of bounds -- negative or greater than
+	 *                or equal to the array length
+	 */
+	public static native byte getByte(Object array, int index)
+			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
+
+	/**
+	 * Return the element of the array at the specified index, converted to a
+	 * char if possible. This reproduces the effect of <code>array[index]</code>
+	 * 
+	 * @param array
+	 *            the array
+	 * @param index
+	 *            the index
+	 * @return the requested element
+	 * @throws java.lang.NullPointerException
+	 *                if the array is null
+	 * @throws java.lang.IllegalArgumentException
+	 *                if the array is not an array or the element cannot be
+	 *                converted to the requested type by a widening conversion
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
+	 *                if the index is out of bounds -- negative or greater than
+	 *                or equal to the array length
+	 */
+	public static native char getChar(Object array, int index)
+			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
+
+	/**
+	 * Return the element of the array at the specified index, converted to a
+	 * double if possible. This reproduces the effect of
+	 * <code>array[index]</code>
+	 * 
+	 * @param array
+	 *            the array
+	 * @param index
+	 *            the index
+	 * @return the requested element
+	 * @throws java.lang.NullPointerException
+	 *                if the array is null
+	 * @throws java.lang.IllegalArgumentException
+	 *                if the array is not an array or the element cannot be
+	 *                converted to the requested type by a widening conversion
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
+	 *                if the index is out of bounds -- negative or greater than
+	 *                or equal to the array length
+	 */
+	public static native double getDouble(Object array, int index)
+			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
+
+	/**
+	 * Return the element of the array at the specified index, converted to a
+	 * float if possible. This reproduces the effect of
+	 * <code>array[index]</code>
+	 * 
+	 * @param array
+	 *            the array
+	 * @param index
+	 *            the index
+	 * @return the requested element
+	 * @throws java.lang.NullPointerException
+	 *                if the array is null
+	 * @throws java.lang.IllegalArgumentException
+	 *                if the array is not an array or the element cannot be
+	 *                converted to the requested type by a widening conversion
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
+	 *                if the index is out of bounds -- negative or greater than
+	 *                or equal to the array length
+	 */
+	public static native float getFloat(Object array, int index)
+			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
+
+	/**
+	 * Return the element of the array at the specified index, converted to an
+	 * int if possible. This reproduces the effect of <code>array[index]</code>
+	 * 
+	 * @param array
+	 *            the array
+	 * @param index
+	 *            the index
+	 * @return the requested element
+	 * @throws java.lang.NullPointerException
+	 *                if the array is null
+	 * @throws java.lang.IllegalArgumentException
+	 *                if the array is not an array or the element cannot be
+	 *                converted to the requested type by a widening conversion
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
+	 *                if the index is out of bounds -- negative or greater than
+	 *                or equal to the array length
+	 */
+	public static native int getInt(Object array, int index)
+			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
+
+	/**
+	 * Return the length of the array. This reproduces the effect of
+	 * <code>array.length</code>
+	 * 
+	 * @param array
+	 *            the array
+	 * @return the length
+	 * @throws java.lang.NullPointerException
+	 *                if the array is null
+	 * @throws java.lang.IllegalArgumentException
+	 *                if the array is not an array
+	 */
+	public static native int getLength(Object array)
+			throws IllegalArgumentException;
+
+	/**
+	 * Return the element of the array at the specified index, converted to a
+	 * long if possible. This reproduces the effect of <code>array[index]</code>
+	 * 
+	 * @param array
+	 *            the array
+	 * @param index
+	 *            the index
+	 * @return the requested element
+	 * @throws java.lang.NullPointerException
+	 *                if the array is null
+	 * @throws java.lang.IllegalArgumentException
+	 *                if the array is not an array or the element cannot be
+	 *                converted to the requested type by a widening conversion
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
+	 *                if the index is out of bounds -- negative or greater than
+	 *                or equal to the array length
+	 */
+	public static native long getLong(Object array, int index)
+			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
+
+	/**
+	 * Return the element of the array at the specified index, converted to a
+	 * short if possible. This reproduces the effect of
+	 * <code>array[index]</code>
+	 * 
+	 * @param array
+	 *            the array
+	 * @param index
+	 *            the index
+	 * @return the requested element
+	 * @throws java.lang.NullPointerException
+	 *                if the array is null
+	 * @throws java.lang.IllegalArgumentException
+	 *                if the array is not an array or the element cannot be
+	 *                converted to the requested type by a widening conversion
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
+	 *                if the index is out of bounds -- negative or greater than
+	 *                or equal to the array length
+	 */
+	public static native short getShort(Object array, int index)
+			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
+
+	/**
+	 * Return a new multidimensional array of the specified component type and
+	 * dimensions. This reproduces the effect of
+	 * <code>new componentType[d0][d1]...[dn]</code> for a dimensions array of {
+	 * d0, d1, ... , dn }
+	 * 
+	 * @param componentType
+	 *            the component type of the new array
+	 * @param dimensions
+	 *            the dimensions of the new array
+	 * @return the new array
+	 * @throws java.lang.NullPointerException
+	 *                if the component type is null
+	 * @throws java.lang.NegativeArraySizeException
+	 *                if any of the dimensions are negative
+	 * @throws java.lang.IllegalArgumentException
+	 *                if the array of dimensions is of size zero, or exceeds the
+	 *                limit of the number of dimension for an array (currently
+	 *                255)
+	 */
+	public static Object newInstance(Class<?> componentType, int[] dimensions)
+			throws NegativeArraySizeException, IllegalArgumentException {
+		return null;
+	}
+
+	/**
+	 * Return a new array of the specified component type and length. This
+	 * reproduces the effect of <code>new componentType[size]</code>
+	 * 
+	 * @param componentType
+	 *            the component type of the new array
+	 * @param size
+	 *            the length of the new array
+	 * @return the new array
+	 * @throws java.lang.NullPointerException
+	 *                if the component type is null
+	 * @throws java.lang.NegativeArraySizeException
+	 *                if the size if negative
+	 */
+	public static Object newInstance(Class<?> componentType, int size)
+			throws NegativeArraySizeException {
+		return null;
+	}
+
+	/**
+	 * Set the element of the array at the specified index to the value. This
+	 * reproduces the effect of <code>array[index] = value</code> If the array
+	 * component is a base type, the value is automatically unwrapped
+	 * 
+	 * @param array
+	 *            the array
+	 * @param index
+	 *            the index
+	 * @param value
+	 *            the new value
+	 * @throws java.lang.NullPointerException
+	 *                if the array is null
+	 * @throws java.lang.IllegalArgumentException
+	 *                if the array is not an array or the value cannot be
+	 *                converted to the array type by a widening conversion
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
+	 *                if the index is out of bounds -- negative or greater than
+	 *                or equal to the array length
+	 */
+	public static native void set(Object array, int index, Object value)
+			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
+
+	/**
+	 * Set the element of the array at the specified index to the boolean value.
+	 * This reproduces the effect of <code>array[index] = value</code>
+	 * 
+	 * @param array
+	 *            the array
+	 * @param index
+	 *            the index
+	 * @param value
+	 *            the new value
+	 * @throws java.lang.NullPointerException
+	 *                if the array is null
+	 * @throws java.lang.IllegalArgumentException
+	 *                if the array is not an array or the value cannot be
+	 *                converted to the array type by a widening conversion
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
+	 *                if the index is out of bounds -- negative or greater than
+	 *                or equal to the array length
+	 */
+	public static native void setBoolean(Object array, int index, boolean value)
+			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
+
+	/**
+	 * Set the element of the array at the specified index to the byte value.
+	 * This reproduces the effect of <code>array[index] = value</code>
+	 * 
+	 * @param array
+	 *            the array
+	 * @param index
+	 *            the index
+	 * @param value
+	 *            the new value
+	 * @throws java.lang.NullPointerException
+	 *                if the array is null
+	 * @throws java.lang.IllegalArgumentException
+	 *                if the array is not an array or the value cannot be
+	 *                converted to the array type by a widening conversion
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
+	 *                if the index is out of bounds -- negative or greater than
+	 *                or equal to the array length
+	 */
+	public static native void setByte(Object array, int index, byte value)
+			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
+
+	/**
+	 * Set the element of the array at the specified index to the char value.
+	 * This reproduces the effect of <code>array[index] = value</code>
+	 * 
+	 * @param array
+	 *            the array
+	 * @param index
+	 *            the index
+	 * @param value
+	 *            the new value
+	 * @throws java.lang.NullPointerException
+	 *                if the array is null
+	 * @throws java.lang.IllegalArgumentException
+	 *                if the array is not an array or the value cannot be
+	 *                converted to the array type by a widening conversion
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
+	 *                if the index is out of bounds -- negative or greater than
+	 *                or equal to the array length
+	 */
+	public static native void setChar(Object array, int index, char value)
+			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
+
+	/**
+	 * Set the element of the array at the specified index to the double value.
+	 * This reproduces the effect of <code>array[index] = value</code>
+	 * 
+	 * @param array
+	 *            the array
+	 * @param index
+	 *            the index
+	 * @param value
+	 *            the new value
+	 * @throws java.lang.NullPointerException
+	 *                if the array is null
+	 * @throws java.lang.IllegalArgumentException
+	 *                if the array is not an array or the value cannot be
+	 *                converted to the array type by a widening conversion
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
+	 *                if the index is out of bounds -- negative or greater than
+	 *                or equal to the array length
+	 */
+	public static native void setDouble(Object array, int index, double value)
+			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
+
+	/**
+	 * Set the element of the array at the specified index to the float value.
+	 * This reproduces the effect of <code>array[index] = value</code>
+	 * 
+	 * @param array
+	 *            the array
+	 * @param index
+	 *            the index
+	 * @param value
+	 *            the new value
+	 * @throws java.lang.NullPointerException
+	 *                if the array is null
+	 * @throws java.lang.IllegalArgumentException
+	 *                if the array is not an array or the value cannot be
+	 *                converted to the array type by a widening conversion
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
+	 *                if the index is out of bounds -- negative or greater than
+	 *                or equal to the array length
+	 */
+	public static native void setFloat(Object array, int index, float value)
+			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
+
+	/**
+	 * Set the element of the array at the specified index to the int value.
+	 * This reproduces the effect of <code>array[index] = value</code>
+	 * 
+	 * @param array
+	 *            the array
+	 * @param index
+	 *            the index
+	 * @param value
+	 *            the new value
+	 * @throws java.lang.NullPointerException
+	 *                if the array is null
+	 * @throws java.lang.IllegalArgumentException
+	 *                if the array is not an array or the value cannot be
+	 *                converted to the array type by a widening conversion
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
+	 *                if the index is out of bounds -- negative or greater than
+	 *                or equal to the array length
+	 */
+	public static native void setInt(Object array, int index, int value)
+			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
+
+	/**
+	 * Set the element of the array at the specified index to the long value.
+	 * This reproduces the effect of <code>array[index] = value</code>
+	 * 
+	 * @param array
+	 *            the array
+	 * @param index
+	 *            the index
+	 * @param value
+	 *            the new value
+	 * @throws java.lang.NullPointerException
+	 *                if the array is null
+	 * @throws java.lang.IllegalArgumentException
+	 *                if the array is not an array or the value cannot be
+	 *                converted to the array type by a widening conversion
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
+	 *                if the index is out of bounds -- negative or greater than
+	 *                or equal to the array length
+	 */
+	public static native void setLong(Object array, int index, long value)
+			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
+
+	/**
+	 * Set the element of the array at the specified index to the short value.
+	 * This reproduces the effect of <code>array[index] = value</code>
+	 * 
+	 * @param array
+	 *            the array
+	 * @param index
+	 *            the index
+	 * @param value
+	 *            the new value
+	 * @throws java.lang.NullPointerException
+	 *                if the array is null
+	 * @throws java.lang.IllegalArgumentException
+	 *                if the array is not an array or the value cannot be
+	 *                converted to the array type by a widening conversion
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
+	 *                if the index is out of bounds -- negative or greater than
+	 *                or equal to the array length
+	 */
+	public static native void setShort(Object array, int index, short value)
+			throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
+
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/reflect/Array.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message