This adds two missing methods in our VM reference implementation. These retrieve the annotations on parameters for methods and constructors, and are left for implementation by the VM.
ChangeLog: 2008-02-17 Andrew John Hughes <[EMAIL PROTECTED]> * vm/reference/java/lang/reflect/Constructor.java, * vm/reference/java/lang/reflect/Method.java: (getParameterAnnotations()): Added. -- Andrew :) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net
Index: NEWS =================================================================== RCS file: /sources/classpath/classpath/NEWS,v retrieving revision 1.189 diff -u -3 -p -u -r1.189 NEWS --- NEWS 12 Feb 2008 22:30:21 -0000 1.189 +++ NEWS 17 Feb 2008 23:46:54 -0000 @@ -11,6 +11,7 @@ JAVAC=<preferred javac> Runtime interface changes: * Removed VMFloat.floatToIntBits amd VMDouble.doubleToLongBits. +* Added new getParameterAnnotations() methods in Constructor and Method. New in release 0.96.1 (Oct 16, 2007) Index: vm/reference/java/lang/reflect/Constructor.java =================================================================== RCS file: /sources/classpath/classpath/vm/reference/java/lang/reflect/Constructor.java,v retrieving revision 1.20 diff -u -3 -p -u -r1.20 Constructor.java --- vm/reference/java/lang/reflect/Constructor.java 10 Dec 2006 20:25:50 -0000 1.20 +++ vm/reference/java/lang/reflect/Constructor.java 17 Feb 2008 23:46:55 -0000 @@ -393,4 +393,27 @@ public final class Constructor<T> MethodSignatureParser p = new MethodSignatureParser(this, sig); return p.getGenericParameterTypes(); } + + /** + * <p> + * Return an array of arrays representing the annotations on each + * of the constructor's parameters. The outer array is aligned against + * the parameters of the constructors and is thus equal in length to + * the number of parameters (thus having a length zero if there are none). + * Each array element in the outer array contains an inner array which + * holds the annotations. This array has a length of zero if the parameter + * has no annotations. + * </p> + * <p> + * The returned annotations are serialized. Changing the annotations has + * no affect on the return value of future calls to this method. + * </p> + * + * @return an array of arrays which represents the annotations used on the + * parameters of this constructor. The order of the array elements + * matches the declaration order of the parameters. + * @since 1.5 + */ + public native Annotation[][] getParameterAnnotations(); + } Index: vm/reference/java/lang/reflect/Method.java =================================================================== RCS file: /sources/classpath/classpath/vm/reference/java/lang/reflect/Method.java,v retrieving revision 1.21 diff -u -3 -p -u -r1.21 Method.java --- vm/reference/java/lang/reflect/Method.java 12 Feb 2007 17:20:06 -0000 1.21 +++ vm/reference/java/lang/reflect/Method.java 17 Feb 2008 23:46:55 -0000 @@ -462,4 +462,27 @@ extends AccessibleObject implements Memb * @since 1.5 */ public native Object getDefaultValue(); + + /** + * <p> + * Return an array of arrays representing the annotations on each + * of the method's parameters. The outer array is aligned against + * the parameters of the method and is thus equal in length to + * the number of parameters (thus having a length zero if there are none). + * Each array element in the outer array contains an inner array which + * holds the annotations. This array has a length of zero if the parameter + * has no annotations. + * </p> + * <p> + * The returned annotations are serialized. Changing the annotations has + * no affect on the return value of future calls to this method. + * </p> + * + * @return an array of arrays which represents the annotations used on the + * parameters of this method. The order of the array elements + * matches the declaration order of the parameters. + * @since 1.5 + */ + public native Annotation[][] getParameterAnnotations(); + }
signature.asc
Description: Digital signature