harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r441313 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/reflect: AccessibleObject.java Array.java Constructor.java Field.java Method.java
Date Fri, 08 Sep 2006 01:03:35 GMT
Author: ndbeyer
Date: Thu Sep  7 18:03:34 2006
New Revision: 441313

URL: http://svn.apache.org/viewvc?view=rev&rev=441313
Log:
Code cleanup; add braces, compiler warnings, documentation, etc

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/reflect/AccessibleObject.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/reflect/Array.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/reflect/Constructor.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/reflect/Field.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/reflect/Method.java

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=441313&r1=441312&r2=441313
==============================================================================
--- 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  7 18:03:34 2006
@@ -36,130 +36,235 @@
  * @since 1.2
  */
 public class AccessibleObject implements AnnotatedElement {
-	static final Object[] emptyArgs = new Object[0];
+    /**
+     * 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;
+    }
 
-	/**
-	 * AccessibleObject constructor. AccessibleObjects can only be created by
-	 * the Virtual Machine.
-	 */
-	protected AccessibleObject() {
-		super();
-	}
-
-	/**
-	 * 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 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;
-	}
-
-	/**
-	 * 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;
     }
 
-	static Object[] marshallArguments(Class[] parameterTypes, Object[] args)
-			throws IllegalArgumentException {
-		return null;
-	}
-
-	void invokeV(Object receiver, Object args[])
-			throws InvocationTargetException {
-		return;
-	}
-
-	Object invokeL(Object receiver, Object args[])
-			throws InvocationTargetException {
-		return null;
-	}
-
-	int invokeI(Object receiver, Object args[])
-			throws InvocationTargetException {
-		return 0;
-	}
-
-	long invokeJ(Object receiver, Object args[])
-			throws InvocationTargetException {
-		return 0L;
-	}
-
-	float invokeF(Object receiver, Object args[])
-			throws InvocationTargetException {
-		return 0.0F;
-	}
-
-	double invokeD(Object receiver, Object args[])
-			throws InvocationTargetException {
-		return 0.0D;
-	}
-
-	native Class[] getParameterTypesImpl();
-
-	native int getModifiers();
-
-	native Class[] getExceptionTypesImpl();
-
-	native String getSignature();
-
-	native boolean checkAccessibility(Class senderClass, Object receiver);
-
-	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);
+    /**
+     * <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;
+    }
 }

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=441313&r1=441312&r2=441313
==============================================================================
--- 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  7 18:03:34 2006
@@ -16,12 +16,30 @@
 package java.lang.reflect;
 
 /**
- * This class must be implemented by the vm vendor. This class provides methods
+ * 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
@@ -32,11 +50,11 @@
 	 * @param index
 	 *            the index
 	 * @return the requested element, possibly wrapped
-	 * @exception java.lang.NullPointerException
+	 * @throws java.lang.NullPointerException
 	 *                if the array is null
-	 * @exception java.lang.IllegalArgumentException
+	 * @throws java.lang.IllegalArgumentException
 	 *                if the array is not an array
-	 * @exception java.lang.ArrayIndexOutOfBoundsException
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
 	 *                if the index is out of bounds -- negative or greater than
 	 *                or equal to the array length
 	 */
@@ -53,12 +71,12 @@
 	 * @param index
 	 *            the index
 	 * @return the requested element
-	 * @exception java.lang.NullPointerException
+	 * @throws java.lang.NullPointerException
 	 *                if the array is null
-	 * @exception java.lang.IllegalArgumentException
+	 * @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
-	 * @exception java.lang.ArrayIndexOutOfBoundsException
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
 	 *                if the index is out of bounds -- negative or greater than
 	 *                or equal to the array length
 	 */
@@ -74,12 +92,12 @@
 	 * @param index
 	 *            the index
 	 * @return the requested element
-	 * @exception java.lang.NullPointerException
+	 * @throws java.lang.NullPointerException
 	 *                if the array is null
-	 * @exception java.lang.IllegalArgumentException
+	 * @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
-	 * @exception java.lang.ArrayIndexOutOfBoundsException
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
 	 *                if the index is out of bounds -- negative or greater than
 	 *                or equal to the array length
 	 */
@@ -95,12 +113,12 @@
 	 * @param index
 	 *            the index
 	 * @return the requested element
-	 * @exception java.lang.NullPointerException
+	 * @throws java.lang.NullPointerException
 	 *                if the array is null
-	 * @exception java.lang.IllegalArgumentException
+	 * @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
-	 * @exception java.lang.ArrayIndexOutOfBoundsException
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
 	 *                if the index is out of bounds -- negative or greater than
 	 *                or equal to the array length
 	 */
@@ -117,12 +135,12 @@
 	 * @param index
 	 *            the index
 	 * @return the requested element
-	 * @exception java.lang.NullPointerException
+	 * @throws java.lang.NullPointerException
 	 *                if the array is null
-	 * @exception java.lang.IllegalArgumentException
+	 * @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
-	 * @exception java.lang.ArrayIndexOutOfBoundsException
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
 	 *                if the index is out of bounds -- negative or greater than
 	 *                or equal to the array length
 	 */
@@ -139,12 +157,12 @@
 	 * @param index
 	 *            the index
 	 * @return the requested element
-	 * @exception java.lang.NullPointerException
+	 * @throws java.lang.NullPointerException
 	 *                if the array is null
-	 * @exception java.lang.IllegalArgumentException
+	 * @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
-	 * @exception java.lang.ArrayIndexOutOfBoundsException
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
 	 *                if the index is out of bounds -- negative or greater than
 	 *                or equal to the array length
 	 */
@@ -160,12 +178,12 @@
 	 * @param index
 	 *            the index
 	 * @return the requested element
-	 * @exception java.lang.NullPointerException
+	 * @throws java.lang.NullPointerException
 	 *                if the array is null
-	 * @exception java.lang.IllegalArgumentException
+	 * @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
-	 * @exception java.lang.ArrayIndexOutOfBoundsException
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
 	 *                if the index is out of bounds -- negative or greater than
 	 *                or equal to the array length
 	 */
@@ -179,9 +197,9 @@
 	 * @param array
 	 *            the array
 	 * @return the length
-	 * @exception java.lang.NullPointerException
+	 * @throws java.lang.NullPointerException
 	 *                if the array is null
-	 * @exception java.lang.IllegalArgumentException
+	 * @throws java.lang.IllegalArgumentException
 	 *                if the array is not an array
 	 */
 	public static native int getLength(Object array)
@@ -196,12 +214,12 @@
 	 * @param index
 	 *            the index
 	 * @return the requested element
-	 * @exception java.lang.NullPointerException
+	 * @throws java.lang.NullPointerException
 	 *                if the array is null
-	 * @exception java.lang.IllegalArgumentException
+	 * @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
-	 * @exception java.lang.ArrayIndexOutOfBoundsException
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
 	 *                if the index is out of bounds -- negative or greater than
 	 *                or equal to the array length
 	 */
@@ -218,23 +236,18 @@
 	 * @param index
 	 *            the index
 	 * @return the requested element
-	 * @exception java.lang.NullPointerException
+	 * @throws java.lang.NullPointerException
 	 *                if the array is null
-	 * @exception java.lang.IllegalArgumentException
+	 * @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
-	 * @exception java.lang.ArrayIndexOutOfBoundsException
+	 * @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;
 
-	private static native Object multiNewArrayImpl(Class<?> componentType,
-			int dimensions, int[] dimensionsArray);
-
-	private static native Object newArrayImpl(Class<?> componentType, int dimension);
-
 	/**
 	 * Return a new multidimensional array of the specified component type and
 	 * dimensions. This reproduces the effect of
@@ -246,11 +259,11 @@
 	 * @param dimensions
 	 *            the dimensions of the new array
 	 * @return the new array
-	 * @exception java.lang.NullPointerException
+	 * @throws java.lang.NullPointerException
 	 *                if the component type is null
-	 * @exception java.lang.NegativeArraySizeException
+	 * @throws java.lang.NegativeArraySizeException
 	 *                if any of the dimensions are negative
-	 * @exception java.lang.IllegalArgumentException
+	 * @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)
@@ -269,9 +282,9 @@
 	 * @param size
 	 *            the length of the new array
 	 * @return the new array
-	 * @exception java.lang.NullPointerException
+	 * @throws java.lang.NullPointerException
 	 *                if the component type is null
-	 * @exception java.lang.NegativeArraySizeException
+	 * @throws java.lang.NegativeArraySizeException
 	 *                if the size if negative
 	 */
 	public static Object newInstance(Class<?> componentType, int size)
@@ -290,12 +303,12 @@
 	 *            the index
 	 * @param value
 	 *            the new value
-	 * @exception java.lang.NullPointerException
+	 * @throws java.lang.NullPointerException
 	 *                if the array is null
-	 * @exception java.lang.IllegalArgumentException
+	 * @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
-	 * @exception java.lang.ArrayIndexOutOfBoundsException
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
 	 *                if the index is out of bounds -- negative or greater than
 	 *                or equal to the array length
 	 */
@@ -312,12 +325,12 @@
 	 *            the index
 	 * @param value
 	 *            the new value
-	 * @exception java.lang.NullPointerException
+	 * @throws java.lang.NullPointerException
 	 *                if the array is null
-	 * @exception java.lang.IllegalArgumentException
+	 * @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
-	 * @exception java.lang.ArrayIndexOutOfBoundsException
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
 	 *                if the index is out of bounds -- negative or greater than
 	 *                or equal to the array length
 	 */
@@ -334,12 +347,12 @@
 	 *            the index
 	 * @param value
 	 *            the new value
-	 * @exception java.lang.NullPointerException
+	 * @throws java.lang.NullPointerException
 	 *                if the array is null
-	 * @exception java.lang.IllegalArgumentException
+	 * @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
-	 * @exception java.lang.ArrayIndexOutOfBoundsException
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
 	 *                if the index is out of bounds -- negative or greater than
 	 *                or equal to the array length
 	 */
@@ -356,12 +369,12 @@
 	 *            the index
 	 * @param value
 	 *            the new value
-	 * @exception java.lang.NullPointerException
+	 * @throws java.lang.NullPointerException
 	 *                if the array is null
-	 * @exception java.lang.IllegalArgumentException
+	 * @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
-	 * @exception java.lang.ArrayIndexOutOfBoundsException
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
 	 *                if the index is out of bounds -- negative or greater than
 	 *                or equal to the array length
 	 */
@@ -378,12 +391,12 @@
 	 *            the index
 	 * @param value
 	 *            the new value
-	 * @exception java.lang.NullPointerException
+	 * @throws java.lang.NullPointerException
 	 *                if the array is null
-	 * @exception java.lang.IllegalArgumentException
+	 * @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
-	 * @exception java.lang.ArrayIndexOutOfBoundsException
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
 	 *                if the index is out of bounds -- negative or greater than
 	 *                or equal to the array length
 	 */
@@ -400,12 +413,12 @@
 	 *            the index
 	 * @param value
 	 *            the new value
-	 * @exception java.lang.NullPointerException
+	 * @throws java.lang.NullPointerException
 	 *                if the array is null
-	 * @exception java.lang.IllegalArgumentException
+	 * @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
-	 * @exception java.lang.ArrayIndexOutOfBoundsException
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
 	 *                if the index is out of bounds -- negative or greater than
 	 *                or equal to the array length
 	 */
@@ -422,12 +435,12 @@
 	 *            the index
 	 * @param value
 	 *            the new value
-	 * @exception java.lang.NullPointerException
+	 * @throws java.lang.NullPointerException
 	 *                if the array is null
-	 * @exception java.lang.IllegalArgumentException
+	 * @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
-	 * @exception java.lang.ArrayIndexOutOfBoundsException
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
 	 *                if the index is out of bounds -- negative or greater than
 	 *                or equal to the array length
 	 */
@@ -444,12 +457,12 @@
 	 *            the index
 	 * @param value
 	 *            the new value
-	 * @exception java.lang.NullPointerException
+	 * @throws java.lang.NullPointerException
 	 *                if the array is null
-	 * @exception java.lang.IllegalArgumentException
+	 * @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
-	 * @exception java.lang.ArrayIndexOutOfBoundsException
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
 	 *                if the index is out of bounds -- negative or greater than
 	 *                or equal to the array length
 	 */
@@ -466,12 +479,12 @@
 	 *            the index
 	 * @param value
 	 *            the new value
-	 * @exception java.lang.NullPointerException
+	 * @throws java.lang.NullPointerException
 	 *                if the array is null
-	 * @exception java.lang.IllegalArgumentException
+	 * @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
-	 * @exception java.lang.ArrayIndexOutOfBoundsException
+	 * @throws java.lang.ArrayIndexOutOfBoundsException
 	 *                if the index is out of bounds -- negative or greater than
 	 *                or equal to the array length
 	 */

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/reflect/Constructor.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/reflect/Constructor.java?view=diff&rev=441313&r1=441312&r2=441313
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/reflect/Constructor.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/reflect/Constructor.java
Thu Sep  7 18:03:34 2006
@@ -23,12 +23,13 @@
  * constructor can be invoked dynamically.
  * 
  */
-public final class Constructor<T> extends AccessibleObject implements GenericDeclaration,
Member {
+public final class Constructor<T> extends AccessibleObject implements GenericDeclaration,
+        Member {
 
     public TypeVariable<Constructor<T>>[] getTypeParameters() {
         return null;
     }
-    
+
     /**
      * <p>
      * Returns the String representation of the constructor's declaration,
@@ -113,8 +114,8 @@
     public boolean isSynthetic() {
         return false;
     }
-    
-	/**
+
+    /**
      * Compares the specified object to this Constructor and answer if they are
      * equal. The object must be an instance of Constructor with the same
      * defining class and parameter types.
@@ -124,134 +125,135 @@
      *         otherwise
      * @see #hashCode
      */
-	public boolean equals(Object object) {
-		return false;
-	}
-
-	/**
-	 * Return the {@link Class} associated with the class that defined this
-	 * constructor.
-	 * 
-	 * @return the declaring class
-	 */
-	public Class<T> getDeclaringClass() {
-		return null;
-	}
-
-	/**
-	 * Return an array of the {@link Class} objects associated with the
-	 * exceptions declared to be thrown by this constructor. If the constructor
-	 * was not declared to throw any exceptions, the array returned will be
-	 * empty.
-	 * 
-	 * @return the declared exception classes
-	 */
-	public Class<?>[] getExceptionTypes() {
-		return null;
-	}
-
-	/**
-	 * Return the modifiers for the modelled constructor. The Modifier class
-	 * should be used to decode the result.
-	 * 
-	 * @return the modifiers
-	 * @see java.lang.reflect.Modifier
-	 */
-	public int getModifiers() {
-		return 0;
-	}
-
-	/**
-	 * Return the name of the modelled constructor. This is the name of the
-	 * declaring class.
-	 * 
-	 * @return the name
-	 */
-	public String getName() {
-		return null;
-	}
-
-	/**
-	 * Return an array of the {@link Class} objects associated with the
-	 * parameter types of this constructor. If the constructor was declared with
-	 * no parameters, the array returned will be empty.
-	 * 
-	 * @return the parameter types
-	 */
-	public Class<?>[] getParameterTypes() {
-		return null;
-	}
-
-	/**
-	 * Answers an integer hash code for the receiver. Objects which are equal
-	 * answer the same value for this method. The hash code for a Constructor is
-	 * the hash code of the declaring class' name.
-	 * 
-	 * @return the receiver's hash
-	 * @see #equals
-	 */
-	public int hashCode() {
-		return 0;
-	}
-
-	/**
-	 * Return a new instance of the declaring class, initialized by dynamically
-	 * invoking the modelled constructor. This reproduces the effect of
-	 * <code>new declaringClass(arg1, arg2, ... , argN)</code> This method
-	 * performs the following:
-	 * <ul>
-	 * <li>A new instance of the declaring class is created. If the declaring
-	 * class cannot be instantiated (i.e. abstract class, an interface, an array
-	 * type, or a base type) then an InstantiationException is thrown.</li>
-	 * <li>If this Constructor object is enforcing access control (see
-	 * AccessibleObject) and the modelled constructor is not accessible from the
-	 * current context, an IllegalAccessException is thrown.</li>
-	 * <li>If the number of arguments passed and the number of parameters do
-	 * not match, an IllegalArgumentException is thrown.</li>
-	 * <li>For each argument passed:
-	 * <ul>
-	 * <li>If the corresponding parameter type is a base type, the argument is
-	 * unwrapped. If the unwrapping fails, an IllegalArgumentException is
-	 * thrown.</li>
-	 * <li>If the resulting argument cannot be converted to the parameter type
-	 * via a widening conversion, an IllegalArgumentException is thrown.</li>
-	 * </ul>
-	 * <li>The modelled constructor is then invoked. If an exception is thrown
-	 * during the invocation, it is caught and wrapped in an
-	 * InvocationTargetException. This exception is then thrown. If the
-	 * invocation completes normally, the newly initialized object is returned.
-	 * </ul>
-	 * 
-	 * @param args
-	 *            the arguments to the constructor
-	 * @return the new, initialized, object
-	 * @exception java.lang.InstantiationException
-	 *                if the class cannot be instantiated
-	 * @exception java.lang.IllegalAccessException
-	 *                if the modelled constructor is not accessible
-	 * @exception java.lang.IllegalArgumentException
-	 *                if an incorrect number of arguments are passed, or an
-	 *                argument could not be converted by a widening conversion
-	 * @exception java.lang.reflect.InvocationTargetException
-	 *                if an exception was thrown by the invoked constructor
-	 * @see java.lang.reflect.AccessibleObject
-	 */
-	public T newInstance(Object... args) throws InstantiationException,
-			IllegalAccessException, IllegalArgumentException,
-			InvocationTargetException {
-		return null;
-	}
-
-	/**
-	 * Answers a string containing a concise, human-readable description of the
-	 * receiver. The format of the string is modifiers (if any) declaring class
-	 * name '(' parameter types, separated by ',' ')' If the constructor throws
-	 * exceptions, ' throws ' exception types, separated by ',' For example:
-	 * <code>public String(byte[],String) throws UnsupportedEncodingException</code>
-	 * 
-	 * @return a printable representation for the receiver
-	 */
-	public String toString() {
-		return null;
-	}
+    @Override
+    public boolean equals(Object object) {
+        return false;
+    }
+
+    /**
+     * Return the {@link Class} associated with the class that defined this
+     * constructor.
+     * 
+     * @return the declaring class
+     */
+    public Class<T> getDeclaringClass() {
+        return null;
+    }
+
+    /**
+     * Return an array of the {@link Class} objects associated with the
+     * exceptions declared to be thrown by this constructor. If the constructor
+     * was not declared to throw any exceptions, the array returned will be
+     * empty.
+     * 
+     * @return the declared exception classes
+     */
+    public Class<?>[] getExceptionTypes() {
+        return null;
+    }
+
+    /**
+     * Return the modifiers for the modelled constructor. The Modifier class
+     * should be used to decode the result.
+     * 
+     * @return the modifiers
+     * @see java.lang.reflect.Modifier
+     */
+    public int getModifiers() {
+        return 0;
+    }
+
+    /**
+     * Return the name of the modelled constructor. This is the name of the
+     * declaring class.
+     * 
+     * @return the name
+     */
+    public String getName() {
+        return null;
+    }
+
+    /**
+     * Return an array of the {@link Class} objects associated with the
+     * parameter types of this constructor. If the constructor was declared with
+     * no parameters, the array returned will be empty.
+     * 
+     * @return the parameter types
+     */
+    public Class<?>[] getParameterTypes() {
+        return null;
+    }
+
+    /**
+     * Answers an integer hash code for the receiver. Objects which are equal
+     * answer the same value for this method. The hash code for a Constructor is
+     * the hash code of the declaring class' name.
+     * 
+     * @return the receiver's hash
+     * @see #equals
+     */
+    @Override
+    public int hashCode() {
+        return 0;
+    }
+
+    /**
+     * Return a new instance of the declaring class, initialized by dynamically
+     * invoking the modelled constructor. This reproduces the effect of
+     * <code>new declaringClass(arg1, arg2, ... , argN)</code> This method
+     * performs the following:
+     * <ul>
+     * <li>A new instance of the declaring class is created. If the declaring
+     * class cannot be instantiated (i.e. abstract class, an interface, an array
+     * type, or a base type) then an InstantiationException is thrown.</li>
+     * <li>If this Constructor object is enforcing access control (see
+     * AccessibleObject) and the modelled constructor is not accessible from the
+     * current context, an IllegalAccessException is thrown.</li>
+     * <li>If the number of arguments passed and the number of parameters do
+     * not match, an IllegalArgumentException is thrown.</li>
+     * <li>For each argument passed:
+     * <ul>
+     * <li>If the corresponding parameter type is a base type, the argument is
+     * unwrapped. If the unwrapping fails, an IllegalArgumentException is
+     * thrown.</li>
+     * <li>If the resulting argument cannot be converted to the parameter type
+     * via a widening conversion, an IllegalArgumentException is thrown.</li>
+     * </ul>
+     * <li>The modelled constructor is then invoked. If an exception is thrown
+     * during the invocation, it is caught and wrapped in an
+     * InvocationTargetException. This exception is then thrown. If the
+     * invocation completes normally, the newly initialized object is returned.
+     * </ul>
+     * 
+     * @param args the arguments to the constructor
+     * @return the new, initialized, object
+     * @exception java.lang.InstantiationException if the class cannot be
+     *            instantiated
+     * @exception java.lang.IllegalAccessException if the modelled constructor
+     *            is not accessible
+     * @exception java.lang.IllegalArgumentException if an incorrect number of
+     *            arguments are passed, or an argument could not be converted by
+     *            a widening conversion
+     * @exception java.lang.reflect.InvocationTargetException if an exception
+     *            was thrown by the invoked constructor
+     * @see java.lang.reflect.AccessibleObject
+     */
+    public T newInstance(Object... args) throws InstantiationException, IllegalAccessException,
+            IllegalArgumentException, InvocationTargetException {
+        return null;
+    }
+
+    /**
+     * Answers a string containing a concise, human-readable description of the
+     * receiver. The format of the string is modifiers (if any) declaring class
+     * name '(' parameter types, separated by ',' ')' If the constructor throws
+     * exceptions, ' throws ' exception types, separated by ',' For example:
+     * <code>public String(byte[],String) throws UnsupportedEncodingException</code>
+     * 
+     * @return a printable representation for the receiver
+     */
+    @Override
+    public String toString() {
+        return null;
+    }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/reflect/Field.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/reflect/Field.java?view=diff&rev=441313&r1=441312&r2=441313
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/reflect/Field.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/reflect/Field.java
Thu Sep  7 18:03:34 2006
@@ -23,6 +23,13 @@
  */
 public final class Field extends AccessibleObject implements Member {
 
+    /**
+     * <p>TODO Document this method. Is it used?</p>
+     * @return
+     * @see java.lang.reflect.AccessibleObject#getSignature()
+     */
+    native String getSignature();
+    
     public boolean isSynthetic() {
         return false;
     }
@@ -81,7 +88,8 @@
      *         otherwise
      * @see #hashCode
      */
-	public boolean equals(Object object) {
+	@Override
+    public boolean equals(Object object) {
 		return false;
 	}
 
@@ -351,8 +359,6 @@
 	public native short getShort(Object object) throws IllegalAccessException,
 			IllegalArgumentException;
 
-	native String getSignature();
-
 	/**
 	 * Return the {@link Class} associated with the type of this field.
 	 * 
@@ -371,7 +377,8 @@
 	 * @return the receiver's hash
 	 * @see #equals
 	 */
-	public int hashCode() {
+	@Override
+    public int hashCode() {
 		return 0;
 	}
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/reflect/Method.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/reflect/Method.java?view=diff&rev=441313&r1=441312&r2=441313
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/reflect/Method.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/reflect/Method.java
Thu Sep  7 18:03:34 2006
@@ -167,7 +167,8 @@
 	 *         otherwise
 	 * @see #hashCode
 	 */
-	public boolean equals(Object object) {
+	@Override
+    public boolean equals(Object object) {
 		return false;
 	}
 
@@ -199,7 +200,7 @@
 	 * @return the modifiers
 	 * @see java.lang.reflect.Modifier
 	 */
-	public int getModifiers() {
+    public int getModifiers() {
 		return 0;
 	}
 
@@ -241,7 +242,8 @@
 	 * @return the receiver's hash
 	 * @see #equals
 	 */
-	public int hashCode() {
+	@Override
+    public int hashCode() {
 		return 0;
 	}
 
@@ -288,19 +290,19 @@
 	 * @param args
 	 *            the arguments to the method
 	 * @return the new, initialized, object
-	 * @exception java.lang.NullPointerException
+	 * @throws java.lang.NullPointerException
 	 *                if the receiver is null for a non-static method
-	 * @exception java.lang.IllegalAccessException
+	 * @throws java.lang.IllegalAccessException
 	 *                if the modelled method is not accessible
-	 * @exception java.lang.IllegalArgumentException
+	 * @throws java.lang.IllegalArgumentException
 	 *                if an incorrect number of arguments are passed, the
 	 *                receiver is incompatible with the declaring class, or an
 	 *                argument could not be converted by a widening conversion
-	 * @exception java.lang.reflect.InvocationTargetException
+	 * @throws java.lang.reflect.InvocationTargetException
 	 *                if an exception was thrown by the invoked method
 	 * @see java.lang.reflect.AccessibleObject
 	 */
-	public Object invoke(Object receiver, Object args[])
+	public Object invoke(Object receiver, Object... args)
 			throws IllegalAccessException, IllegalArgumentException,
 			InvocationTargetException {
 		return null;
@@ -316,7 +318,8 @@
 	 * 
 	 * @return a printable representation for the receiver
 	 */
-	public String toString() {
+	@Override
+    public String toString() {
 		return null;
 	}
 }



Mime
View raw message