Index: libraryInterface/Common/src/java/lang/reflect/Method.java
===================================================================
--- libraryInterface/Common/src/java/lang/reflect/Method.java	(revision 14002)
+++ libraryInterface/Common/src/java/lang/reflect/Method.java	(working copy)
@@ -1,258 +0,0 @@
-/*
- *  This file is part of the Jikes RVM project (http://jikesrvm.org).
- *
- *  This file is licensed to You under the Common Public License (CPL);
- *  You may not use this file except in compliance with the License. You
- *  may obtain a copy of the License at
- *
- *      http://www.opensource.org/licenses/cpl1.0.php
- *
- *  See the COPYRIGHT.txt file distributed with this work for information
- *  regarding copyright ownership.
- */
-package java.lang.reflect;
-
-import gnu.java.lang.CPStringBuilder;
-
-import java.lang.annotation.Annotation;
-
-import org.jikesrvm.classloader.*;
-import org.jikesrvm.runtime.VM_Reflection;
-import org.jikesrvm.runtime.VM_Magic;
-import org.jikesrvm.runtime.VM_Runtime;
-
-/**
- * Implementation of java.lang.reflect.Field for JikesRVM.
- *
- * By convention, order methods in the same order
- * as they appear in the method summary list of Sun's 1.4 Javadoc API.
- */
-public final class Method extends AccessibleObject implements Member, GenericDeclaration {
-  final VM_Method method;
-
-   // Prevent this class from being instantiated.
-  @SuppressWarnings("unused")
-  private Method() {
-    method = null;
-  }
-
-  // For use by JikesRVMSupport
-  Method(VM_Method m) {
-    method = m;
-  }
-
-  public boolean equals(Object other) {
-    if (other instanceof Method) {
-      return method == ((Method)other).method;
-    } else {
-      return false;
-    }
-  }
-
-  public Class<?> getDeclaringClass() {
-    return method.getDeclaringClass().getClassForType();
-  }
-
-  public Class<?>[] getExceptionTypes() {
-    VM_TypeReference[] exceptionTypes = method.getExceptionTypes();
-    if (exceptionTypes == null) {
-      return new Class[0];
-    } else {
-      return JikesRVMSupport.typesToClasses(exceptionTypes);
-    }
-  }
-
-  public int getModifiers() {
-    return method.getModifiers();
-  }
-
-  public String getName() {
-    return method.getName().toString();
-  }
-
-  public Class<?>[] getParameterTypes() {
-    return JikesRVMSupport.typesToClasses(method.getParameterTypes());
-  }
-
-  public boolean isSynthetic() {
-    return method.isSynthetic();
-  }
-
-  public boolean isBridge() {
-    return method.isBridge();
-  }
-
-  public boolean isVarArgs() {
-    return method.isVarArgs();
-  }
-
-  public Class<?> getReturnType() {
-    return method.getReturnType().resolve().getClassForType();
-  }
-
-  public int hashCode() {
-    int code1 = getName().hashCode();
-    int code2 = method.getDeclaringClass().toString().hashCode();
-    return code1 ^ code2;
-  }
-
-  public Object invoke(Object receiver, Object[] args) throws IllegalAccessException,
-                                                              IllegalArgumentException,
-                                                              ExceptionInInitializerError,
-                                                              InvocationTargetException {
-    VM_Method method = this.method;
-    VM_Class declaringClass = method.getDeclaringClass();
-
-    // validate "this" argument
-    if (!method.isStatic()) {
-      if (receiver == null) throw new NullPointerException();
-      receiver = JikesRVMSupport.makeArgumentCompatible(declaringClass, receiver);
-    }
-
-    // validate number and types of remaining arguments
-    VM_TypeReference[] parameterTypes = method.getParameterTypes();
-    if (args == null) {
-      if (parameterTypes.length != 0) {
-        throw new IllegalArgumentException("argument count mismatch");
-      }
-    } else if (args.length != parameterTypes.length) {
-      throw new IllegalArgumentException("argument count mismatch");
-    }
-    for (int i = 0, n = parameterTypes.length; i < n; ++i) {
-      args[i] = JikesRVMSupport.makeArgumentCompatible(parameterTypes[i].resolve(), args[i]);
-    }
-
-    // Accessibility checks
-    if (!method.isPublic() && !isAccessible()) {
-      VM_Class accessingClass = VM_Class.getClassFromStackFrame(1);
-      JikesRVMSupport.checkAccess(method, accessingClass);
-    }
-
-    // find the right method to call
-    if (! method.isStatic()) {
-        VM_Class C = VM_Magic.getObjectType(receiver).asClass();
-        method = C.findVirtualMethod(method.getName(), method.getDescriptor());
-    }
-
-    // Forces initialization of declaring class
-    if (method.isStatic() && !declaringClass.isInitialized()) {
-      try {
-        VM_Runtime.initializeClassForDynamicLink(declaringClass);
-      } catch (Throwable e) {
-        ExceptionInInitializerError ex = new ExceptionInInitializerError();
-        ex.initCause(e);
-        throw ex;
-      }
-    }
-
-    // Invoke method
-    try {
-      return VM_Reflection.invoke(method, receiver, args);
-    } catch (Throwable t) {
-      throw new InvocationTargetException(t,
-                "While invoking the method:\n\t\"" + method + "\"\n" +
-                " on the object:\n\t\"" + receiver + "\"\n" +
-                " it threw the exception:\n\t\"" + t + "\"");
-     }
-  }
-
-  public String toString() {
-    CPStringBuilder sb = new CPStringBuilder(128);
-    Modifier.toString(getModifiers(), sb).append(' ');
-    sb.append(JikesRVMHelpers.getUserName(getReturnType())).append(' ');
-    sb.append(getDeclaringClass().getName()).append('.');
-    sb.append(getName()).append('(');
-    Class<?>[] c = getParameterTypes();
-    if (c.length > 0) {
-        sb.append(JikesRVMHelpers.getUserName(c[0]));
-        for (int i = 1; i < c.length; i++) {
-          sb.append(',').append(JikesRVMHelpers.getUserName(c[i]));
-        }
-      }
-    sb.append(')');
-    c = getExceptionTypes();
-    if (c.length > 0) {
-        sb.append(" throws ").append(c[0].getName());
-        for (int i = 1; i < c.length; i++)
-          sb.append(',').append(c[i].getName());
-      }
-    return sb.toString();
-  }
-
-  // AnnotatedElement interface
-
-  public Annotation[] getDeclaredAnnotations() {
-    return method.getDeclaredAnnotations();
-  }
-
-  public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
-    return method.getAnnotation(annotationClass);
-  }
-
-  public Object getDefaultValue() {
-    return null;
-  }
-
-  // Generics support
-
-  public TypeVariable<Method>[] getTypeParameters() {
-    VM_Atom sig = method.getSignature();
-    if (sig == null) {
-      return new TypeVariable[0];
-    } else {
-      return JikesRVMHelpers.getTypeParameters(this, sig);
-    }
-  }
-
-  public Type[] getGenericExceptionTypes() {
-    VM_Atom sig = method.getSignature();
-    if (sig == null) {
-      return getExceptionTypes();
-    } else {
-      return JikesRVMHelpers.getGenericExceptionTypes(this, sig);
-    }
-  }
-
-  public Type[] getGenericParameterTypes() {
-    VM_Atom sig = method.getSignature();
-    if (sig == null) {
-      return getParameterTypes();
-    } else {
-      return JikesRVMHelpers.getGenericParameterTypes(this, sig);
-    }
-  }
-
-  public Type getGenericReturnType() {
-    VM_Atom sig = method.getSignature();
-    if (sig == null) {
-      return getReturnType();
-    } else {
-      return JikesRVMHelpers.getGenericReturnType(this, sig);
-    }
-  }
-
-  public String toGenericString() {
-    CPStringBuilder sb = new CPStringBuilder(128);
-    Modifier.toString(getModifiers(), sb).append(' ');
-    Constructor.addTypeParameters(sb, getTypeParameters());
-    sb.append(getGenericReturnType()).append(' ');
-    sb.append(getDeclaringClass().getName()).append('.');
-    sb.append(getName()).append('(');
-    Type[] types = getGenericParameterTypes();
-    if (types.length > 0) {
-        sb.append(types[0]);
-        for (int i = 1; i < types.length; i++) {
-          sb.append(',').append(types[i]);
-        }
-      }
-    sb.append(')');
-    types = getGenericExceptionTypes();
-    if (types.length > 0) {
-        sb.append(" throws ").append(types[0]);
-        for (int i = 1; i < types.length; i++) {
-          sb.append(',').append(types[i]);
-        }
-      }
-    return sb.toString();
-  }
-}
Index: libraryInterface/Common/src/java/lang/reflect/Field.java
===================================================================
--- libraryInterface/Common/src/java/lang/reflect/Field.java	(revision 14002)
+++ libraryInterface/Common/src/java/lang/reflect/Field.java	(working copy)
@@ -1,556 +0,0 @@
-/*
- *  This file is part of the Jikes RVM project (http://jikesrvm.org).
- *
- *  This file is licensed to You under the Common Public License (CPL);
- *  You may not use this file except in compliance with the License. You
- *  may obtain a copy of the License at
- *
- *      http://www.opensource.org/licenses/cpl1.0.php
- *
- *  See the COPYRIGHT.txt file distributed with this work for information
- *  regarding copyright ownership.
- */
-package java.lang.reflect;
-
-import gnu.java.lang.CPStringBuilder;
-
-import java.lang.annotation.Annotation;
-
-import org.jikesrvm.classloader.VM_Class;
-import org.jikesrvm.classloader.VM_Field;
-import org.jikesrvm.classloader.VM_TypeReference;
-import org.jikesrvm.classloader.VM_Type;
-import org.jikesrvm.classloader.VM_Atom;
-
-import org.jikesrvm.objectmodel.VM_ObjectModel;
-import org.jikesrvm.VM;
-import org.jikesrvm.runtime.VM_Runtime;
-
-/**
- * Implementation of java.lang.reflect.Field for JikesRVM.
- *
- * By convention, order methods in the same order
- * as they appear in the method summary list of Sun's 1.4 Javadoc API.
- */
-public final class Field extends AccessibleObject implements Member {
-
-  final VM_Field field;
-
-  // Prevent this class from being instantiated.
-  @SuppressWarnings("unused")
-  private Field() {
-    field = null;
-  }
-
-  // For use by JikesRVMSupport
-  Field(VM_Field f) {
-    field = f;
-  }
-
-  public boolean equals(Object object) {
-    if (object instanceof Field) {
-      return field == ((Field)object).field;
-    } else {
-      return false;
-    }
-  }
-
-  public Object get(Object object) throws IllegalAccessException, IllegalArgumentException {
-    checkReadAccess(object);
-
-    if (field.isReferenceType()) {
-      return field.getObjectValueUnchecked(object);
-    }
-    VM_TypeReference type = field.getType();
-    if (type.isIntType()) {
-      return field.getIntValueUnchecked(object);
-    } else if (type.isCharType()) {
-      return field.getCharValueUnchecked(object);
-    } else if (type.isShortType()) {
-      return field.getShortValueUnchecked(object);
-    } else if (type.isLongType()) {
-      return field.getLongValueUnchecked(object);
-    } else if (type.isByteType()) {
-      return field.getByteValueUnchecked(object);
-    } else if (type.isBooleanType()) {
-      return field.getBooleanValueUnchecked(object);
-    } else if (type.isDoubleType()) {
-      return field.getDoubleValueUnchecked(object);
-    } else {
-      if (VM.VerifyAssertions) VM._assert(type.isFloatType());
-      return field.getFloatValueUnchecked(object);
-    }
-  }
-
-  public boolean getBoolean(Object object) throws IllegalAccessException, IllegalArgumentException {
-    checkReadAccess(object);
-    return getBooleanInternal(object);
-  }
-
-  public byte getByte(Object object) throws IllegalAccessException, IllegalArgumentException {
-    checkReadAccess(object);
-    return getByteInternal(object);
-  }
-
-  public char getChar(Object object) throws IllegalAccessException, IllegalArgumentException {
-    checkReadAccess(object);
-    return getCharInternal(object);
-  }
-
-  public Class<?> getDeclaringClass() {
-    return field.getDeclaringClass().getClassForType();
-  }
-
-  public double getDouble(Object object) throws IllegalAccessException, IllegalArgumentException {
-    checkReadAccess(object);
-    return getDoubleInternal(object);
-  }
-
-  public float getFloat(Object object) throws IllegalAccessException, IllegalArgumentException {
-    checkReadAccess(object);
-    return getFloatInternal(object);
-  }
-
-  public int getInt(Object object) throws IllegalAccessException, IllegalArgumentException {
-    checkReadAccess(object);
-    return getIntInternal(object);
-  }
-
-  public long getLong(Object object) throws IllegalAccessException, IllegalArgumentException {
-    checkReadAccess(object);
-    return getLongInternal(object);
-  }
-
-  public int getModifiers() {
-    return field.getModifiers();
-  }
-
-  public String getName() {
-    return field.getName().toString();
-  }
-
-  public short getShort(Object object) throws IllegalAccessException, IllegalArgumentException {
-    checkReadAccess(object);
-    return getShortInternal(object);
-  }
-
-  public Class<?> getType() {
-    return field.getType().resolve().getClassForType();
-  }
-
-  public int hashCode() {
-    int code1 = getName().hashCode();
-    int code2 = field.getDeclaringClass().toString().hashCode();
-    return code1 ^ code2;
-  }
-
-  public boolean isSynthetic() {
-    return field.isSynthetic();
-  }
-
-  public boolean isEnumConstant() {
-    return field.isEnumConstant();
-  }
-
-  public void set(Object object, Object value)
-    throws IllegalAccessException, IllegalArgumentException     {
-    checkWriteAccess(object);
-
-    if (field.isReferenceType()) {
-      if (value != null) {
-        VM_Type valueType = VM_ObjectModel.getObjectType(value);
-        VM_Type fieldType;
-        try {
-          fieldType = field.getType().resolve();
-        } catch (NoClassDefFoundError e) {
-          throw new IllegalArgumentException("field type mismatch");
-        }
-        if (fieldType != valueType &&
-            !VM_Runtime.isAssignableWith(fieldType, valueType)) {
-          throw new IllegalArgumentException("field type mismatch");
-        }
-      }
-      field.setObjectValueUnchecked(object, value);
-    } else if (value instanceof Character) {
-      setCharInternal(object, (Character) value);
-    } else if (value instanceof Double) {
-      setDoubleInternal(object, (Double) value);
-    } else if (value instanceof Float) {
-      setFloatInternal(object, (Float) value);
-    } else if (value instanceof Long) {
-      setLongInternal(object, (Long) value);
-    } else if (value instanceof Integer) {
-      setIntInternal(object, (Integer) value);
-    } else if (value instanceof Short) {
-      setShortInternal(object, (Short) value);
-    } else if (value instanceof Byte) {
-      setByteInternal(object, (Byte) value);
-    } else if (value instanceof Boolean) {
-      setBooleanInternal(object, (Boolean) value);
-    } else {
-      throw new IllegalArgumentException("field type mismatch");
-    }
-  }
-
-  public void setBoolean(Object object, boolean value)
-    throws IllegalAccessException, IllegalArgumentException    {
-    checkWriteAccess(object);
-    setBooleanInternal(object, value);
-  }
-
-  public void setByte(Object object, byte value)
-    throws IllegalAccessException, IllegalArgumentException    {
-    checkWriteAccess(object);
-    setByteInternal(object, value);
-  }
-
-  public void setChar(Object object, char value)
-    throws IllegalAccessException, IllegalArgumentException    {
-    checkWriteAccess(object);
-    setCharInternal(object, value);
-  }
-
-  public void setDouble(Object object, double value)
-    throws IllegalAccessException, IllegalArgumentException    {
-    checkWriteAccess(object);
-    setDoubleInternal(object, value);
-  }
-
-  public void setFloat(Object object, float value)
-    throws IllegalAccessException, IllegalArgumentException    {
-    checkWriteAccess(object);
-    setFloatInternal(object, value);
-  }
-
-  public void setInt(Object object, int value)
-    throws IllegalAccessException, IllegalArgumentException    {
-    checkWriteAccess(object);
-    setIntInternal(object, value);
-  }
-
-  public void setLong(Object object, long value)
-    throws IllegalAccessException, IllegalArgumentException    {
-    checkWriteAccess(object);
-    setLongInternal(object, value);
-  }
-
-  public void setShort(Object object, short value)
-    throws IllegalAccessException, IllegalArgumentException   {
-    checkWriteAccess(object);
-    setShortInternal(object, value);
-  }
-
-  public String toString() {
-    CPStringBuilder sb = new CPStringBuilder(64);
-    Modifier.toString(getModifiers(), sb).append(' ');
-    sb.append(JikesRVMHelpers.getUserName(getType())).append(' ');
-    sb.append(getDeclaringClass().getName()).append('.');
-    sb.append(getName());
-    return sb.toString();
-  }
-
-  private void checkReadAccess(Object obj) throws IllegalAccessException,
-                                                  IllegalArgumentException,
-                                                  ExceptionInInitializerError {
-
-    VM_Class declaringClass = field.getDeclaringClass();
-    if (!field.isStatic()) {
-      if (obj == null) {
-        throw new NullPointerException();
-      }
-
-      VM_Type objType = VM_ObjectModel.getObjectType(obj);
-      if (objType != declaringClass && !VM_Runtime.isAssignableWith(declaringClass, objType)) {
-        throw new IllegalArgumentException();
-      }
-    }
-
-    if (!field.isPublic() && !isAccessible()) {
-      VM_Class accessingClass = VM_Class.getClassFromStackFrame(2);
-      JikesRVMSupport.checkAccess(field, accessingClass);
-    }
-
-    if (field.isStatic() && !declaringClass.isInitialized()) {
-      try {
-        VM_Runtime.initializeClassForDynamicLink(declaringClass);
-      } catch (Throwable e) {
-        ExceptionInInitializerError ex = new ExceptionInInitializerError();
-        ex.initCause(e);
-        throw ex;
-      }
-    }
-  }
-
-  private void checkWriteAccess(Object obj) throws IllegalAccessException,
-                                                   IllegalArgumentException,
-                                                   ExceptionInInitializerError {
-
-    VM_Class declaringClass = field.getDeclaringClass();
-    if (!field.isStatic()) {
-      if (obj == null) {
-        throw new NullPointerException();
-      }
-
-      VM_Type objType = VM_ObjectModel.getObjectType(obj);
-      if (objType != declaringClass && !VM_Runtime.isAssignableWith(declaringClass, objType)) {
-        throw new IllegalArgumentException();
-      }
-    }
-
-    if (!field.isPublic() && !isAccessible()) {
-      VM_Class accessingClass = VM_Class.getClassFromStackFrame(2);
-      JikesRVMSupport.checkAccess(field, accessingClass);
-    }
-
-    if (field.isFinal())
-      throw new IllegalAccessException();
-
-    if (field.isStatic() && !declaringClass.isInitialized()) {
-      try {
-        VM_Runtime.initializeClassForDynamicLink(declaringClass);
-      } catch (Throwable e) {
-        ExceptionInInitializerError ex = new ExceptionInInitializerError();
-        ex.initCause(e);
-        throw ex;
-      }
-    }
-  }
-
-  public boolean getBooleanInternal(Object object) throws IllegalArgumentException {
-    VM_TypeReference type = field.getType();
-    if (!type.isBooleanType()) throw new IllegalArgumentException("field type mismatch");
-    return field.getBooleanValueUnchecked(object);
-  }
-
-  private byte getByteInternal(Object object) throws IllegalArgumentException {
-    VM_TypeReference type = field.getType();
-    if (!type.isByteType()) throw new IllegalArgumentException("field type mismatch");
-    return field.getByteValueUnchecked(object);
-  }
-
-  private char getCharInternal(Object object) throws IllegalArgumentException {
-    VM_TypeReference type = field.getType();
-    if (!type.isCharType()) throw new IllegalArgumentException("field type mismatch");
-    return field.getCharValueUnchecked(object);
-  }
-
-  private double getDoubleInternal(Object object) throws IllegalArgumentException {
-    VM_TypeReference type = field.getType();
-    if (type.isDoubleType()) {
-      return field.getDoubleValueUnchecked(object);
-    } else if (type.isFloatType()) {
-      return (double)field.getFloatValueUnchecked(object);
-    } else if (type.isLongType()) {
-      return (double)field.getLongValueUnchecked(object);
-    } else if (type.isIntType()) {
-      return (double)field.getIntValueUnchecked(object);
-    } else if (type.isShortType()) {
-      return (double)field.getShortValueUnchecked(object);
-    } else if (type.isCharType()) {
-      return (double)field.getCharValueUnchecked(object);
-    } else if (type.isByteType()) {
-      return (double)field.getByteValueUnchecked(object);
-    } else {
-      throw new IllegalArgumentException("field type mismatch");
-    }
-  }
-
-  private float getFloatInternal(Object object) throws IllegalArgumentException {
-    VM_TypeReference type = field.getType();
-    if (type.isFloatType()) {
-      return field.getFloatValueUnchecked(object);
-    } else if (type.isLongType()) {
-      return (float)field.getLongValueUnchecked(object);
-    } else if (type.isIntType()) {
-      return (float)field.getIntValueUnchecked(object);
-    } else if (type.isShortType()) {
-      return (float)field.getShortValueUnchecked(object);
-    } else if (type.isCharType()) {
-      return (float)field.getCharValueUnchecked(object);
-    } else if (type.isByteType()) {
-      return (float)field.getByteValueUnchecked(object);
-    } else {
-      throw new IllegalArgumentException("field type mismatch");
-    }
-  }
-
-  private int getIntInternal(Object object) throws IllegalArgumentException {
-    VM_TypeReference type = field.getType();
-    if (type.isIntType()) {
-      return field.getIntValueUnchecked(object);
-    } else if (type.isShortType()) {
-      return (int)field.getShortValueUnchecked(object);
-    } else if (type.isCharType()) {
-      return (int)field.getCharValueUnchecked(object);
-    } else if (type.isByteType()) {
-      return (int)field.getByteValueUnchecked(object);
-    } else {
-      throw new IllegalArgumentException("field type mismatch");
-    }
-  }
-
-  private long getLongInternal(Object object) throws IllegalArgumentException {
-    VM_TypeReference type = field.getType();
-    if (type.isLongType()) {
-      return field.getLongValueUnchecked(object);
-    } else if (type.isIntType()) {
-      return (long)field.getIntValueUnchecked(object);
-    } else if (type.isShortType()) {
-      return (long)field.getShortValueUnchecked(object);
-    } else if (type.isCharType()) {
-      return (long)field.getCharValueUnchecked(object);
-    } else if (type.isByteType()) {
-      return (long)field.getByteValueUnchecked(object);
-    } else {
-      throw new IllegalArgumentException("field type mismatch");
-    }
-  }
-
-  private short getShortInternal(Object object) throws IllegalArgumentException {
-    VM_TypeReference type = field.getType();
-    if (type.isShortType()) {
-      return field.getShortValueUnchecked(object);
-    } else if (type.isByteType()) {
-      return (short)field.getByteValueUnchecked(object);
-    } else {
-      throw new IllegalArgumentException("field type mismatch");
-    }
-  }
-
-  private void setBooleanInternal(Object object, boolean value)
-    throws IllegalArgumentException {
-    VM_TypeReference type = field.getType();
-    if (type.isBooleanType())
-      field.setBooleanValueUnchecked(object, value);
-    else
-      throw new IllegalArgumentException("field type mismatch");
-  }
-
-  private void setByteInternal(Object object, byte value) throws IllegalArgumentException {
-    VM_TypeReference type = field.getType();
-    if (type.isByteType())
-      field.setByteValueUnchecked(object, value);
-    else if (type.isLongType())
-      field.setLongValueUnchecked(object, (long)value);
-    else if (type.isIntType())
-      field.setIntValueUnchecked(object, (int)value);
-    else if (type.isShortType())
-      field.setShortValueUnchecked(object, (short)value);
-    else if (type.isCharType())
-      field.setCharValueUnchecked(object, (char)value);
-    else if (type.isDoubleType())
-      field.setDoubleValueUnchecked(object, (double)value);
-    else if (type.isFloatType())
-      field.setFloatValueUnchecked(object, (float)value);
-    else
-      throw new IllegalArgumentException("field type mismatch");
-  }
-
-  private void setCharInternal(Object object, char value) throws IllegalArgumentException {
-    VM_TypeReference type = field.getType();
-    if (type.isCharType())
-      field.setCharValueUnchecked(object, value);
-    else if (type.isLongType())
-      field.setLongValueUnchecked(object, (long)value);
-    else if (type.isIntType())
-      field.setIntValueUnchecked(object, (int)value);
-    else if (type.isShortType())
-      field.setShortValueUnchecked(object, (short)value);
-    else if (type.isDoubleType())
-      field.setDoubleValueUnchecked(object, (double)value);
-    else if (type.isFloatType())
-      field.setFloatValueUnchecked(object, (float)value);
-    else
-      throw new IllegalArgumentException("field type mismatch");
-  }
-
-  private void setDoubleInternal(Object object, double value) throws IllegalArgumentException {
-    VM_TypeReference type = field.getType();
-    if (type.isDoubleType())
-      field.setDoubleValueUnchecked(object, value);
-    else
-      throw new IllegalArgumentException("field type mismatch");
-  }
-
-  private void setFloatInternal(Object object, float value) throws IllegalArgumentException {
-    VM_TypeReference type = field.getType();
-    if (type.isFloatType())
-      field.setFloatValueUnchecked(object, value);
-    else if (type.isDoubleType())
-      field.setDoubleValueUnchecked(object, (double)value);
-    else
-      throw new IllegalArgumentException("field type mismatch");
-  }
-
-  private void setIntInternal(Object object, int value) throws IllegalArgumentException {
-    VM_TypeReference type = field.getType();
-    if (type.isIntType())
-      field.setIntValueUnchecked(object, value);
-    else if (type.isLongType())
-      field.setLongValueUnchecked(object, (long) value);
-    else if (type.isDoubleType())
-      field.setDoubleValueUnchecked(object, (double)value);
-    else if (type.isFloatType())
-      field.setFloatValueUnchecked(object, (float)value);
-    else
-      throw new IllegalArgumentException("field type mismatch");
-  }
-
-  private void setLongInternal(Object object, long value) throws IllegalArgumentException {
-    VM_TypeReference type = field.getType();
-    if (type.isLongType())
-      field.setLongValueUnchecked(object, value);
-    else if (type.isDoubleType())
-      field.setDoubleValueUnchecked(object, (double)value);
-    else if (type.isFloatType())
-      field.setFloatValueUnchecked(object, (float)value);
-    else
-      throw new IllegalArgumentException("field type mismatch");
-  }
-
-  private void setShortInternal(Object object, short value) throws IllegalArgumentException {
-    VM_TypeReference type = field.getType();
-    if (type.isShortType())
-      field.setShortValueUnchecked(object, value);
-    else if (type.isLongType())
-      field.setLongValueUnchecked(object, (long)value);
-    else if (type.isIntType())
-      field.setIntValueUnchecked(object, (int)value);
-    else if (type.isDoubleType())
-      field.setDoubleValueUnchecked(object, (double)value);
-    else if (type.isFloatType())
-      field.setFloatValueUnchecked(object, (float)value);
-    else
-      throw new IllegalArgumentException("field type mismatch");
-  }
-
-  // AnnotatedElement interface
-
-  public Annotation[] getDeclaredAnnotations() {
-    return field.getDeclaredAnnotations();
-  }
-
-  public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
-    return field.getAnnotation(annotationClass);
-  }
-
-  // Generics support
-
-  public Type getGenericType() {
-    VM_Atom signature = field.getSignature();
-    if (signature == null) {
-      return getType();
-    } else {
-      return JikesRVMHelpers.getFieldType(this, signature);
-    }
-  }
-
-  public String toGenericString() {
-    CPStringBuilder sb = new CPStringBuilder(64);
-    Modifier.toString(getModifiers(), sb).append(' ');
-    sb.append(getGenericType()).append(' ');
-    sb.append(getDeclaringClass().getName()).append('.');
-    sb.append(getName());
-    return sb.toString();
-  }
-}
Index: libraryInterface/Common/src/java/lang/reflect/VMMethod.java
===================================================================
--- libraryInterface/Common/src/java/lang/reflect/VMMethod.java	(revision 0)
+++ libraryInterface/Common/src/java/lang/reflect/VMMethod.java	(revision 0)
@@ -0,0 +1,165 @@
+/*
+ *  This file is part of the Jikes RVM project (http://jikesrvm.org).
+ *
+ *  This file is licensed to You under the Common Public License (CPL);
+ *  You may not use this file except in compliance with the License. You
+ *  may obtain a copy of the License at
+ *
+ *      http://www.opensource.org/licenses/cpl1.0.php
+ *
+ *  See the COPYRIGHT.txt file distributed with this work for information
+ *  regarding copyright ownership.
+ */
+package java.lang.reflect;
+
+import gnu.java.lang.CPStringBuilder;
+
+import java.lang.annotation.Annotation;
+
+import org.jikesrvm.classloader.*;
+import org.jikesrvm.runtime.VM_Reflection;
+import org.jikesrvm.runtime.VM_Magic;
+import org.jikesrvm.runtime.VM_Runtime;
+
+/**
+ * Implementation of java.lang.reflect.Field for JikesRVM.
+ *
+ * By convention, order methods in the same order
+ * as they appear in the method summary list of Sun's 1.4 Javadoc API.
+ */
+final class VMMethod {
+  final VM_Method method;
+  Method m;
+
+   // Prevent this class from being instantiated.
+  @SuppressWarnings("unused")
+  private VMMethod() {
+    method = null;
+  }
+
+  // For use by JikesRVMSupport
+  VMMethod(VM_Method m) {
+    method = m;
+  }
+
+  public boolean equals(Object other) {
+    if (other instanceof Method) {
+      return method == ((Method)other).m.method;
+    } else {
+      return false;
+    }
+  }
+
+  public Class<?> getDeclaringClass() {
+    return method.getDeclaringClass().getClassForType();
+  }
+
+  Class<?>[] getExceptionTypes() {
+    VM_TypeReference[] exceptionTypes = method.getExceptionTypes();
+    if (exceptionTypes == null) {
+      return new Class[0];
+    } else {
+      return JikesRVMSupport.typesToClasses(exceptionTypes);
+    }
+  }
+
+  int getModifiersInternal() {
+    return method.getModifiers();
+  }
+
+  public String getName() {
+    return method.getName().toString();
+  }
+
+  Class<?>[] getParameterTypes() {
+    return JikesRVMSupport.typesToClasses(method.getParameterTypes());
+  }
+
+  Class<?> getReturnType() {
+    return method.getReturnType().resolve().getClassForType();
+  }
+
+  Object invoke(Object receiver, Object[] args) throws IllegalAccessException,
+						       IllegalArgumentException,
+						       ExceptionInInitializerError,
+						       InvocationTargetException {
+    VM_Method method = this.method;
+    VM_Class declaringClass = method.getDeclaringClass();
+
+    // validate "this" argument
+    if (!method.isStatic()) {
+      if (receiver == null) throw new NullPointerException();
+      receiver = JikesRVMSupport.makeArgumentCompatible(declaringClass, receiver);
+    }
+
+    // validate number and types of remaining arguments
+    VM_TypeReference[] parameterTypes = method.getParameterTypes();
+    if (args == null) {
+      if (parameterTypes.length != 0) {
+        throw new IllegalArgumentException("argument count mismatch");
+      }
+    } else if (args.length != parameterTypes.length) {
+      throw new IllegalArgumentException("argument count mismatch");
+    }
+    for (int i = 0, n = parameterTypes.length; i < n; ++i) {
+      args[i] = JikesRVMSupport.makeArgumentCompatible(parameterTypes[i].resolve(), args[i]);
+    }
+
+    // Accessibility checks
+    if (!method.isPublic() && !m.isAccessible()) {
+      VM_Class accessingClass = VM_Class.getClassFromStackFrame(1);
+      JikesRVMSupport.checkAccess(method, accessingClass);
+    }
+
+    // find the right method to call
+    if (! method.isStatic()) {
+        VM_Class C = VM_Magic.getObjectType(receiver).asClass();
+        method = C.findVirtualMethod(method.getName(), method.getDescriptor());
+    }
+
+    // Forces initialization of declaring class
+    if (method.isStatic() && !declaringClass.isInitialized()) {
+      try {
+        VM_Runtime.initializeClassForDynamicLink(declaringClass);
+      } catch (Throwable e) {
+        ExceptionInInitializerError ex = new ExceptionInInitializerError();
+        ex.initCause(e);
+        throw ex;
+      }
+    }
+
+    // Invoke method
+    try {
+      return VM_Reflection.invoke(method, receiver, args);
+    } catch (Throwable t) {
+      throw new InvocationTargetException(t,
+                "While invoking the method:\n\t\"" + method + "\"\n" +
+                " on the object:\n\t\"" + receiver + "\"\n" +
+                " it threw the exception:\n\t\"" + t + "\"");
+     }
+  }
+
+  // AnnotatedElement interface
+
+  Annotation[] getDeclaredAnnotations() {
+    return method.getDeclaredAnnotations();
+  }
+
+  <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
+    return method.getAnnotation(annotationClass);
+  }
+
+  Object getDefaultValue() {
+    /* FIXME: This should handle the case where this is an annotation method */
+    return null;
+  }
+
+  String getSignature() {
+    return method.getSignature().toString();
+  }
+
+  Annotation[][] getParameterAnnotations() {
+    return method.getDeclaredParameterAnnotations();
+  }
+
+}

Property changes on: libraryInterface/Common/src/java/lang/reflect/VMMethod.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Index: libraryInterface/Common/src/java/lang/reflect/Constructor.java
===================================================================
--- libraryInterface/Common/src/java/lang/reflect/Constructor.java	(revision 14002)
+++ libraryInterface/Common/src/java/lang/reflect/Constructor.java	(working copy)
@@ -1,227 +0,0 @@
-/*
- *  This file is part of the Jikes RVM project (http://jikesrvm.org).
- *
- *  This file is licensed to You under the Common Public License (CPL);
- *  You may not use this file except in compliance with the License. You
- *  may obtain a copy of the License at
- *
- *      http://www.opensource.org/licenses/cpl1.0.php
- *
- *  See the COPYRIGHT.txt file distributed with this work for information
- *  regarding copyright ownership.
- */
-package java.lang.reflect;
-
-import gnu.java.lang.CPStringBuilder;
-
-import org.jikesrvm.classloader.*;
-import org.jikesrvm.runtime.VM_Reflection;
-import org.jikesrvm.runtime.VM_Runtime;
-
-/**
- * Implementation of java.lang.reflect.Constructor for JikesRVM.
- *
- * By convention, order methods in the same order
- * as they appear in the method summary list of Sun's 1.4 Javadoc API.
- */
-public final class Constructor<T> extends AccessibleObject
-  implements GenericDeclaration, Member {
-  final VM_Method constructor;
-
-  // Prevent this class from being instantiated.
-  @SuppressWarnings("unused")
-  private Constructor() {
-    constructor = null;
-  }
-
-  // For use by JikesRVMSupport
-  Constructor(VM_Method m) {
-    constructor = m;
-  }
-
-  public boolean equals(Object other) {
-    if (other instanceof Constructor) {
-      return constructor == ((Constructor<?>)other).constructor;
-    } else {
-      return false;
-    }
-  }
-
-  @SuppressWarnings("unchecked")  // Type system needs to be bent a bit here
-  public Class<T> getDeclaringClass() {
-    return (Class<T>)constructor.getDeclaringClass().getClassForType();
-  }
-
-  public Class<?>[] getExceptionTypes() {
-    VM_TypeReference[] exceptionTypes = constructor.getExceptionTypes();
-    if (exceptionTypes == null) {
-      return new Class[0];
-    } else {
-      return JikesRVMSupport.typesToClasses(exceptionTypes);
-    }
-  }
-
-  public int getModifiers() {
-    return constructor.getModifiers();
-  }
-
-  public String getName() {
-    return getDeclaringClass().getName();
-  }
-
-  public Class<?>[] getParameterTypes() {
-    return JikesRVMSupport.typesToClasses(constructor.getParameterTypes());
-  }
-
-  public int hashCode() {
-    return getName().hashCode();
-  }
-
-  public boolean isSynthetic() {
-    return constructor.isSynthetic();
-  }
-
-  public boolean isVarArgs() {
-    return constructor.isVarArgs();
-  }
-
-  public T newInstance(Object[] args) throws InstantiationException,
-                                             IllegalAccessException,
-                                             IllegalArgumentException,
-                                             InvocationTargetException {
-    // Check accessibility
-    if (!constructor.isPublic() && !isAccessible()) {
-      VM_Class accessingClass = VM_Class.getClassFromStackFrame(1);
-      JikesRVMSupport.checkAccess(constructor, accessingClass);
-    }
-
-    // validate number and types of arguments to constructor
-    VM_TypeReference[] parameterTypes = constructor.getParameterTypes();
-    if (args == null) {
-      if (parameterTypes.length != 0) {
-        throw new IllegalArgumentException("argument count mismatch");
-      }
-    } else {
-      if (args.length != parameterTypes.length) {
-        throw new IllegalArgumentException("argument count mismatch");
-      }
-      for (int i = 0; i < parameterTypes.length; i++) {
-        args[i] = JikesRVMSupport.makeArgumentCompatible(parameterTypes[i].resolve(), args[i]);
-      }
-    }
-
-    VM_Class cls = constructor.getDeclaringClass();
-    if (cls.isAbstract()) {
-      throw new InstantiationException("Abstract class");
-    }
-
-    // Ensure that the class is initialized
-    if (!cls.isInitialized()) {
-      try {
-        VM_Runtime.initializeClassForDynamicLink(cls);
-      } catch (Throwable e) {
-        ExceptionInInitializerError ex = new ExceptionInInitializerError();
-        ex.initCause(e);
-        throw ex;
-      }
-    }
-
-    // Allocate an uninitialized instance;
-    T obj = (T)VM_Runtime.resolvedNewScalar(cls);
-
-    // Run the constructor on the instance.
-    try {
-      VM_Reflection.invoke(constructor, obj, args);
-    } catch (Throwable e) {
-      throw new InvocationTargetException(e);
-    }
-    return obj;
-  }
-
-  public String toString() {
-    CPStringBuilder sb = new CPStringBuilder(128);
-    Modifier.toString(getModifiers(), sb).append(' ');
-    sb.append(getDeclaringClass().getName()).append('(');
-    Class<?>[] c = getParameterTypes();
-    if (c.length > 0) {
-        sb.append(JikesRVMHelpers.getUserName(c[0]));
-        for (int i = 1; i < c.length; i++) {
-          sb.append(',').append(JikesRVMHelpers.getUserName(c[i]));
-        }
-      }
-    sb.append(')');
-    c = getExceptionTypes();
-    if (c.length > 0) {
-        sb.append(" throws ").append(c[0].getName());
-        for (int i = 1; i < c.length; i++) {
-          sb.append(',').append(c[i].getName());
-        }
-      }
-    return sb.toString();
-  }
-
-  // Generics support
-
-  public TypeVariable<Constructor<T>>[] getTypeParameters() {
-    VM_Atom sig = constructor.getSignature();
-    if (sig == null) {
-      return new TypeVariable[0];
-    } else {
-      return JikesRVMHelpers.getTypeParameters(this, sig);
-    }
-  }
-
-  public Type[] getGenericExceptionTypes() {
-    VM_Atom sig = constructor.getSignature();
-    if (sig == null) {
-      return getExceptionTypes();
-    } else {
-      return JikesRVMHelpers.getGenericExceptionTypes(this, sig);
-    }
-  }
-
-  public Type[] getGenericParameterTypes() {
-    VM_Atom sig = constructor.getSignature();
-    if (sig == null) {
-      return getParameterTypes();
-    } else {
-      return JikesRVMHelpers.getGenericParameterTypes(this, sig);
-    }
-  }
-
-  public String toGenericString() {
-    CPStringBuilder sb = new CPStringBuilder(128);
-    Modifier.toString(getModifiers(), sb).append(' ');
-    addTypeParameters(sb, getTypeParameters());
-    sb.append(getDeclaringClass().getName()).append('(');
-    Type[] types = getGenericParameterTypes();
-    if (types.length > 0) {
-        sb.append(types[0]);
-        for (int i = 1; i < types.length; ++i) {
-          sb.append(',').append(types[i]);
-        }
-      }
-    sb.append(')');
-    types = getGenericExceptionTypes();
-    if (types.length > 0) {
-        sb.append(" throws ").append(types[0]);
-        for (int i = 1; i < types.length; i++) {
-          sb.append(',').append(types[i]);
-        }
-      }
-    return sb.toString();
-  }
-
-  static void addTypeParameters(CPStringBuilder sb, TypeVariable<?>[] typeArgs) {
-    if (typeArgs.length == 0)
-      return;
-    sb.append('<');
-    for (int i = 0; i < typeArgs.length; ++i) {
-        if (i > 0) {
-          sb.append(',');
-        }
-        sb.append(typeArgs[i]);
-      }
-    sb.append("> ");
-  }
-}
Index: libraryInterface/Common/src/java/lang/reflect/VMField.java
===================================================================
--- libraryInterface/Common/src/java/lang/reflect/VMField.java	(revision 13987)
+++ libraryInterface/Common/src/java/lang/reflect/VMField.java	(working copy)
@@ -32,30 +32,31 @@ import org.jikesrvm.runtime.VM_Runtime;
  * By convention, order methods in the same order
  * as they appear in the method summary list of Sun's 1.4 Javadoc API.
  */
-public final class Field extends AccessibleObject implements Member {
+public final class VMField {
 
   final VM_Field field;
+  Field f;
 
   // Prevent this class from being instantiated.
   @SuppressWarnings("unused")
-  private Field() {
+  private VMField() {
     field = null;
   }
 
   // For use by JikesRVMSupport
-  Field(VM_Field f) {
+  VMField(VM_Field f) {
     field = f;
   }
 
   public boolean equals(Object object) {
     if (object instanceof Field) {
-      return field == ((Field)object).field;
+      return field == ((Field)object).f.field;
     } else {
       return false;
     }
   }
 
-  public Object get(Object object) throws IllegalAccessException, IllegalArgumentException {
+  Object get(Object object) throws IllegalAccessException, IllegalArgumentException {
     checkReadAccess(object);
 
     if (field.isReferenceType()) {
@@ -82,17 +83,17 @@ public final class Field extends Accessi
     }
   }
 
-  public boolean getBoolean(Object object) throws IllegalAccessException, IllegalArgumentException {
+  boolean getBoolean(Object object) throws IllegalAccessException, IllegalArgumentException {
     checkReadAccess(object);
     return getBooleanInternal(object);
   }
 
-  public byte getByte(Object object) throws IllegalAccessException, IllegalArgumentException {
+  byte getByte(Object object) throws IllegalAccessException, IllegalArgumentException {
     checkReadAccess(object);
     return getByteInternal(object);
   }
 
-  public char getChar(Object object) throws IllegalAccessException, IllegalArgumentException {
+  char getChar(Object object) throws IllegalAccessException, IllegalArgumentException {
     checkReadAccess(object);
     return getCharInternal(object);
   }
@@ -101,27 +102,27 @@ public final class Field extends Accessi
     return field.getDeclaringClass().getClassForType();
   }
 
-  public double getDouble(Object object) throws IllegalAccessException, IllegalArgumentException {
+  double getDouble(Object object) throws IllegalAccessException, IllegalArgumentException {
     checkReadAccess(object);
     return getDoubleInternal(object);
   }
 
-  public float getFloat(Object object) throws IllegalAccessException, IllegalArgumentException {
+  float getFloat(Object object) throws IllegalAccessException, IllegalArgumentException {
     checkReadAccess(object);
     return getFloatInternal(object);
   }
 
-  public int getInt(Object object) throws IllegalAccessException, IllegalArgumentException {
+  int getInt(Object object) throws IllegalAccessException, IllegalArgumentException {
     checkReadAccess(object);
     return getIntInternal(object);
   }
 
-  public long getLong(Object object) throws IllegalAccessException, IllegalArgumentException {
+  long getLong(Object object) throws IllegalAccessException, IllegalArgumentException {
     checkReadAccess(object);
     return getLongInternal(object);
   }
 
-  public int getModifiers() {
+  int getModifiersInternal() {
     return field.getModifiers();
   }
 
@@ -134,25 +135,11 @@ public final class Field extends Accessi
     return getShortInternal(object);
   }
 
-  public Class<?> getType() {
+  Class<?> getType() {
     return field.getType().resolve().getClassForType();
   }
 
-  public int hashCode() {
-    int code1 = getName().hashCode();
-    int code2 = field.getDeclaringClass().toString().hashCode();
-    return code1 ^ code2;
-  }
-
-  public boolean isSynthetic() {
-    return field.isSynthetic();
-  }
-
-  public boolean isEnumConstant() {
-    return field.isEnumConstant();
-  }
-
-  public void set(Object object, Object value)
+  void set(Object object, Object value)
     throws IllegalAccessException, IllegalArgumentException     {
     checkWriteAccess(object);
 
@@ -192,63 +179,54 @@ public final class Field extends Accessi
     }
   }
 
-  public void setBoolean(Object object, boolean value)
+  void setBoolean(Object object, boolean value)
     throws IllegalAccessException, IllegalArgumentException    {
     checkWriteAccess(object);
     setBooleanInternal(object, value);
   }
 
-  public void setByte(Object object, byte value)
+   void setByte(Object object, byte value)
     throws IllegalAccessException, IllegalArgumentException    {
     checkWriteAccess(object);
     setByteInternal(object, value);
   }
 
-  public void setChar(Object object, char value)
+  void setChar(Object object, char value)
     throws IllegalAccessException, IllegalArgumentException    {
     checkWriteAccess(object);
     setCharInternal(object, value);
   }
 
-  public void setDouble(Object object, double value)
+  void setDouble(Object object, double value)
     throws IllegalAccessException, IllegalArgumentException    {
     checkWriteAccess(object);
     setDoubleInternal(object, value);
   }
 
-  public void setFloat(Object object, float value)
+  void setFloat(Object object, float value)
     throws IllegalAccessException, IllegalArgumentException    {
     checkWriteAccess(object);
     setFloatInternal(object, value);
   }
 
-  public void setInt(Object object, int value)
+  void setInt(Object object, int value)
     throws IllegalAccessException, IllegalArgumentException    {
     checkWriteAccess(object);
     setIntInternal(object, value);
   }
 
-  public void setLong(Object object, long value)
+  void setLong(Object object, long value)
     throws IllegalAccessException, IllegalArgumentException    {
     checkWriteAccess(object);
     setLongInternal(object, value);
   }
 
-  public void setShort(Object object, short value)
+  void setShort(Object object, short value)
     throws IllegalAccessException, IllegalArgumentException   {
     checkWriteAccess(object);
     setShortInternal(object, value);
   }
 
-  public String toString() {
-    CPStringBuilder sb = new CPStringBuilder(64);
-    Modifier.toString(getModifiers(), sb).append(' ');
-    sb.append(JikesRVMHelpers.getUserName(getType())).append(' ');
-    sb.append(getDeclaringClass().getName()).append('.');
-    sb.append(getName());
-    return sb.toString();
-  }
-
   private void checkReadAccess(Object obj) throws IllegalAccessException,
                                                   IllegalArgumentException,
                                                   ExceptionInInitializerError {
@@ -265,7 +243,7 @@ public final class Field extends Accessi
       }
     }
 
-    if (!field.isPublic() && !isAccessible()) {
+    if (!field.isPublic() && !f.isAccessible()) {
       VM_Class accessingClass = VM_Class.getClassFromStackFrame(2);
       JikesRVMSupport.checkAccess(field, accessingClass);
     }
@@ -297,7 +275,7 @@ public final class Field extends Accessi
       }
     }
 
-    if (!field.isPublic() && !isAccessible()) {
+    if (!field.isPublic() && !f.isAccessible()) {
       VM_Class accessingClass = VM_Class.getClassFromStackFrame(2);
       JikesRVMSupport.checkAccess(field, accessingClass);
     }
@@ -525,32 +503,17 @@ public final class Field extends Accessi
   }
 
   // AnnotatedElement interface
-
-  public Annotation[] getDeclaredAnnotations() {
+  
+  Annotation[] getDeclaredAnnotations() {
     return field.getDeclaredAnnotations();
   }
-
-  public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
+   
+  <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
     return field.getAnnotation(annotationClass);
   }
 
-  // Generics support
-
-  public Type getGenericType() {
-    VM_Atom signature = field.getSignature();
-    if (signature == null) {
-      return getType();
-    } else {
-      return JikesRVMHelpers.getFieldType(this, signature);
-    }
+  String getSignature() {
+    return field.getSignature().toString();
   }
 
-  public String toGenericString() {
-    CPStringBuilder sb = new CPStringBuilder(64);
-    Modifier.toString(getModifiers(), sb).append(' ');
-    sb.append(getGenericType()).append(' ');
-    sb.append(getDeclaringClass().getName()).append('.');
-    sb.append(getName());
-    return sb.toString();
-  }
 }
Index: libraryInterface/Common/src/java/lang/reflect/JikesRVMSupport.java
===================================================================
--- libraryInterface/Common/src/java/lang/reflect/JikesRVMSupport.java	(revision 14002)
+++ libraryInterface/Common/src/java/lang/reflect/JikesRVMSupport.java	(working copy)
@@ -78,29 +78,41 @@ public class JikesRVMSupport {
     throw new IllegalArgumentException();
   }
 
-  public static Field createField(VM_Field m) {
-    return new Field(m);
+  public static Field createField(VM_Field f) {
+    return new Field(new VMField(f));
   }
 
   public static Method createMethod(VM_Method m) {
-    return new Method(m);
+    return new Method(new VMMethod(m));
   }
 
   @SuppressWarnings("unchecked") // Can't type-check this without <T> type<T>, which breaks javac
   public static <T> Constructor<T> createConstructor(VM_Method m) {
-    return new Constructor(m);
+    return new Constructor(new VMConstructor(m));
   }
 
   public static VM_Field getFieldOf(Field f) {
+    return f.f.field;
+  }
+
+  public static VM_Method getMethodOf(Method m) {
+    return m.m.method;
+  }
+
+  public static VM_Method getMethodOf(Constructor cons) {
+    return cons.cons.constructor;
+  }
+
+  public static VM_Field getFieldOf(VMField f) {
     return f.field;
   }
 
-  public static VM_Method getMethodOf(Method f) {
-    return f.method;
+  public static VM_Method getMethodOf(VMMethod m) {
+    return m.method;
   }
 
-  public static VM_Method getMethodOf(Constructor<?> f) {
-    return f.constructor;
+  public static VM_Method getMethodOf(VMConstructor cons) {
+    return cons.constructor;
   }
 
 
Index: libraryInterface/Common/src/java/lang/reflect/VMConstructor.java
===================================================================
--- libraryInterface/Common/src/java/lang/reflect/VMConstructor.java	(revision 13987)
+++ libraryInterface/Common/src/java/lang/reflect/VMConstructor.java	(working copy)
@@ -14,45 +14,46 @@ package java.lang.reflect;
 
 import gnu.java.lang.CPStringBuilder;
 
+import java.lang.annotation.Annotation;
+
 import org.jikesrvm.classloader.*;
 import org.jikesrvm.runtime.VM_Reflection;
 import org.jikesrvm.runtime.VM_Runtime;
 
 /**
- * Implementation of java.lang.reflect.Constructor for JikesRVM.
+ * Implementation of java.lang.reflect.VMConstructor for JikesRVM.
  *
  * By convention, order methods in the same order
  * as they appear in the method summary list of Sun's 1.4 Javadoc API.
  */
-public final class Constructor<T> extends AccessibleObject
-  implements GenericDeclaration, Member {
+final class VMConstructor {
   final VM_Method constructor;
+  Constructor cons;
 
   // Prevent this class from being instantiated.
   @SuppressWarnings("unused")
-  private Constructor() {
+  private VMConstructor() {
     constructor = null;
   }
 
   // For use by JikesRVMSupport
-  Constructor(VM_Method m) {
+  VMConstructor(VM_Method m) {
     constructor = m;
   }
 
   public boolean equals(Object other) {
     if (other instanceof Constructor) {
-      return constructor == ((Constructor<?>)other).constructor;
+      return constructor == ((Constructor)other).cons.constructor;
     } else {
       return false;
     }
   }
 
-  @SuppressWarnings("unchecked")  // Type system needs to be bent a bit here
-  public Class<T> getDeclaringClass() {
-    return (Class<T>)constructor.getDeclaringClass().getClassForType();
+  Class getDeclaringClass() {
+    return constructor.getDeclaringClass().getClassForType();
   }
 
-  public Class<?>[] getExceptionTypes() {
+  Class[] getExceptionTypes() {
     VM_TypeReference[] exceptionTypes = constructor.getExceptionTypes();
     if (exceptionTypes == null) {
       return new Class[0];
@@ -61,36 +62,24 @@ public final class Constructor<T> extend
     }
   }
 
-  public int getModifiers() {
+  int getModifiersInternal() {
     return constructor.getModifiers();
   }
 
-  public String getName() {
+  String getName() {
     return getDeclaringClass().getName();
   }
 
-  public Class<?>[] getParameterTypes() {
+  Class[] getParameterTypes() {
     return JikesRVMSupport.typesToClasses(constructor.getParameterTypes());
   }
 
-  public int hashCode() {
-    return getName().hashCode();
-  }
-
-  public boolean isSynthetic() {
-    return constructor.isSynthetic();
-  }
-
-  public boolean isVarArgs() {
-    return constructor.isVarArgs();
-  }
-
-  public T newInstance(Object[] args) throws InstantiationException,
-                                             IllegalAccessException,
-                                             IllegalArgumentException,
-                                             InvocationTargetException {
+  Object construct(Object[] args) throws InstantiationException,
+					 IllegalAccessException,
+					 IllegalArgumentException,
+					 InvocationTargetException {
     // Check accessibility
-    if (!constructor.isPublic() && !isAccessible()) {
+    if (!constructor.isPublic() && !cons.isAccessible()) {
       VM_Class accessingClass = VM_Class.getClassFromStackFrame(1);
       JikesRVMSupport.checkAccess(constructor, accessingClass);
     }
@@ -127,7 +116,7 @@ public final class Constructor<T> extend
     }
 
     // Allocate an uninitialized instance;
-    T obj = (T)VM_Runtime.resolvedNewScalar(cls);
+    Object obj = VM_Runtime.resolvedNewScalar(cls);
 
     // Run the constructor on the instance.
     try {
@@ -138,90 +127,20 @@ public final class Constructor<T> extend
     return obj;
   }
 
-  public String toString() {
-    CPStringBuilder sb = new CPStringBuilder(128);
-    Modifier.toString(getModifiers(), sb).append(' ');
-    sb.append(getDeclaringClass().getName()).append('(');
-    Class<?>[] c = getParameterTypes();
-    if (c.length > 0) {
-        sb.append(JikesRVMHelpers.getUserName(c[0]));
-        for (int i = 1; i < c.length; i++) {
-          sb.append(',').append(JikesRVMHelpers.getUserName(c[i]));
-        }
-      }
-    sb.append(')');
-    c = getExceptionTypes();
-    if (c.length > 0) {
-        sb.append(" throws ").append(c[0].getName());
-        for (int i = 1; i < c.length; i++) {
-          sb.append(',').append(c[i].getName());
-        }
-      }
-    return sb.toString();
-  }
-
-  // Generics support
-
-  public TypeVariable<Constructor<T>>[] getTypeParameters() {
-    VM_Atom sig = constructor.getSignature();
-    if (sig == null) {
-      return new TypeVariable[0];
-    } else {
-      return JikesRVMHelpers.getTypeParameters(this, sig);
-    }
+  String getSignature() {
+    return constructor.getSignature().toString();
   }
 
-  public Type[] getGenericExceptionTypes() {
-    VM_Atom sig = constructor.getSignature();
-    if (sig == null) {
-      return getExceptionTypes();
-    } else {
-      return JikesRVMHelpers.getGenericExceptionTypes(this, sig);
-    }
+  Annotation[][] getParameterAnnotations() {
+    return constructor.getDeclaredParameterAnnotations();
   }
 
-  public Type[] getGenericParameterTypes() {
-    VM_Atom sig = constructor.getSignature();
-    if (sig == null) {
-      return getParameterTypes();
-    } else {
-      return JikesRVMHelpers.getGenericParameterTypes(this, sig);
-    }
+  Annotation[] getDeclaredAnnotations() {
+    return constructor.getDeclaredAnnotations();
   }
 
-  public String toGenericString() {
-    CPStringBuilder sb = new CPStringBuilder(128);
-    Modifier.toString(getModifiers(), sb).append(' ');
-    addTypeParameters(sb, getTypeParameters());
-    sb.append(getDeclaringClass().getName()).append('(');
-    Type[] types = getGenericParameterTypes();
-    if (types.length > 0) {
-        sb.append(types[0]);
-        for (int i = 1; i < types.length; ++i) {
-          sb.append(',').append(types[i]);
-        }
-      }
-    sb.append(')');
-    types = getGenericExceptionTypes();
-    if (types.length > 0) {
-        sb.append(" throws ").append(types[0]);
-        for (int i = 1; i < types.length; i++) {
-          sb.append(',').append(types[i]);
-        }
-      }
-    return sb.toString();
+  <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
+    return constructor.getAnnotation(annotationClass);
   }
 
-  static void addTypeParameters(CPStringBuilder sb, TypeVariable<?>[] typeArgs) {
-    if (typeArgs.length == 0)
-      return;
-    sb.append('<');
-    for (int i = 0; i < typeArgs.length; ++i) {
-        if (i > 0) {
-          sb.append(',');
-        }
-        sb.append(typeArgs[i]);
-      }
-    sb.append("> ");
-  }
 }
Index: build/components/classpath.xml
===================================================================
--- build/components/classpath.xml	(revision 14002)
+++ build/components/classpath.xml	(working copy)
@@ -19,7 +19,7 @@
   <!-- in target patch-classpath-web                                -->
   <property name="classpath.version" value="97"/>
   <!-- Change this whenever you alter the patches. It will let people know classpath has changed. -->
-  <property name="classpath.patchlevel" value="1"/>
+  <property name="classpath.patchlevel" value="2"/>
   <property name="classpath.description" value="GNU Classpath"/>
 
   <property name="classpath.component.dir" location="${components.dir}/classpath"/>
@@ -125,6 +125,14 @@
            dir="${classpath.package.dir}/classpath/" strip="0"/>
     <patch patchfile="${components.patch.dir}/classpath-web.RVM-266-04.patch"
            dir="${classpath.package.dir}/classpath/" strip="0"/>
+    <patch patchfile="${components.patch.dir}/classpath-web.RVM-385-01.patch"
+           dir="${classpath.package.dir}/classpath/" strip="0"/>
+    <patch patchfile="${components.patch.dir}/classpath-web.RVM-385-02.patch"
+           dir="${classpath.package.dir}/classpath/" strip="0"/>
+    <patch patchfile="${components.patch.dir}/classpath-web.RVM-385-03.patch"
+           dir="${classpath.package.dir}/classpath/" strip="0"/>
+    <patch patchfile="${components.patch.dir}/classpath-web.RVM-385-04.patch"
+           dir="${classpath.package.dir}/classpath/" strip="0"/>
   </target>
   <target name="patch" depends="patch-classpath-web,patch-classpath-cvs"/>
 
Index: build/components/patches/classpath-web.RVM-385-01.patch
===================================================================
--- build/components/patches/classpath-web.RVM-385-01.patch	(revision 0)
+++ build/components/patches/classpath-web.RVM-385-01.patch	(revision 0)
@@ -0,0 +1,4006 @@
+Index: java/lang/reflect/Constructor.java
+===================================================================
+RCS file: java/lang/reflect/Constructor.java
+diff -N java/lang/reflect/Constructor.java
+--- /dev/null	1 Jan 1970 00:00:00 -0000
++++ java/lang/reflect/Constructor.java	2 Mar 2008 02:03:57 -0000
+@@ -0,0 +1,426 @@
++/* java.lang.reflect.Constructor - reflection of Java constructors
++   Copyright (C) 1998, 2001, 2004, 2005 Free Software Foundation, Inc.
++
++This file is part of GNU Classpath.
++
++GNU Classpath is free software; you can redistribute it and/or modify
++it under the terms of the GNU General Public License as published by
++the Free Software Foundation; either version 2, or (at your option)
++any later version.
++ 
++GNU Classpath is distributed in the hope that it will be useful, but
++WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with GNU Classpath; see the file COPYING.  If not, write to the
++Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
++02110-1301 USA.
++
++Linking this library statically or dynamically with other modules is
++making a combined work based on this library.  Thus, the terms and
++conditions of the GNU General Public License cover the whole
++combination.
++
++As a special exception, the copyright holders of this library give you
++permission to link this library with independent modules to produce an
++executable, regardless of the license terms of these independent
++modules, and to copy and distribute the resulting executable under
++terms of your choice, provided that you also meet, for each linked
++independent module, the terms and conditions of the license of that
++module.  An independent module is a module which is not derived from
++or based on this library.  If you modify this library, you may extend
++this exception to your version of the library, but you are not
++obligated to do so.  If you do not wish to do so, delete this
++exception statement from your version. */
++
++
++package java.lang.reflect;
++
++import gnu.java.lang.ClassHelper;
++import gnu.java.lang.CPStringBuilder;
++
++import gnu.java.lang.reflect.MethodSignatureParser;
++
++import java.lang.annotation.Annotation;
++import java.util.Arrays;
++
++/**
++ * The Constructor class represents a constructor of a class. It also allows
++ * dynamic creation of an object, via reflection. Invocation on Constructor
++ * objects knows how to do widening conversions, but throws
++ * {@link IllegalArgumentException} if a narrowing conversion would be
++ * necessary. You can query for information on this Constructor regardless
++ * of location, but construction access may be limited by Java language
++ * access controls. If you can't do it in the compiler, you can't normally
++ * do it here either.<p>
++ *
++ * <B>Note:</B> This class returns and accepts types as Classes, even
++ * primitive types; there are Class types defined that represent each
++ * different primitive type.  They are <code>java.lang.Boolean.TYPE,
++ * java.lang.Byte.TYPE,</code>, also available as <code>boolean.class,
++ * byte.class</code>, etc.  These are not to be confused with the
++ * classes <code>java.lang.Boolean, java.lang.Byte</code>, etc., which are
++ * real classes.<p>
++ *
++ * Also note that this is not a serializable class.  It is entirely feasible
++ * to make it serializable using the Externalizable interface, but this is
++ * on Sun, not me.
++ *
++ * @author John Keiser
++ * @author Eric Blake <ebb9@email.byu.edu>
++ * @see Member
++ * @see Class
++ * @see java.lang.Class#getConstructor(Class[])
++ * @see java.lang.Class#getDeclaredConstructor(Class[])
++ * @see java.lang.Class#getConstructors()
++ * @see java.lang.Class#getDeclaredConstructors()
++ * @since 1.1
++ * @status updated to 1.4
++ */
++public final class Constructor<T>
++  extends AccessibleObject
++  implements GenericDeclaration, Member
++{
++  Class<T> clazz;
++  int slot;
++  
++  static final int CONSTRUCTOR_MODIFIERS
++    = Modifier.PRIVATE | Modifier.PROTECTED | Modifier.PUBLIC;
++
++  private MethodSignatureParser p;
++
++  /**
++   * This class is uninstantiable outside this package.
++   */
++  Constructor(Class<T> declaringClass,int slot)
++  {
++    this.clazz = declaringClass;
++    this.slot = slot;
++  }
++
++  private Constructor()
++  {
++  }
++
++  /**
++   * Gets the class that declared this constructor.
++   * @return the class that declared this member
++   */
++  public Class<T> getDeclaringClass()
++  {
++    return clazz;
++  }
++
++  /**
++   * Gets the name of this constructor (the non-qualified name of the class
++   * it was declared in).
++   * @return the name of this constructor
++   */
++  public String getName()
++  {
++    return getDeclaringClass().getName();
++  }
++
++  /**
++   * Gets the modifiers this constructor uses.  Use the <code>Modifier</code>
++   * class to interpret the values. A constructor can only have a subset of the
++   * following modifiers: public, private, protected.
++   *
++   * @return an integer representing the modifiers to this Member
++   * @see Modifier
++   */
++  public int getModifiers()
++  {
++    return VMConstructor.getModifiersInternal(this) & CONSTRUCTOR_MODIFIERS;
++  }
++
++  /**
++   * Return true if this constructor is synthetic, false otherwise.
++   * A synthetic member is one which is created by the compiler,
++   * and which does not appear in the user's source code.
++   * @since 1.5
++   */
++  public boolean isSynthetic()
++  {
++    return (VMConstructor.getModifiersInternal(this) & Modifier.SYNTHETIC) != 0;
++  }
++
++  /**
++   * Return true if this is a varargs constructor, that is if
++   * the constructor takes a variable number of arguments.
++   * @since 1.5
++   */
++  public boolean isVarArgs()
++  {
++    return (VMConstructor.getModifiersInternal(this) & Modifier.VARARGS) != 0;
++  }
++
++  /**
++   * Get the parameter list for this constructor, in declaration order. If the
++   * constructor takes no parameters, returns a 0-length array (not null).
++   *
++   * @return a list of the types of the constructor's parameters
++   */
++  @SuppressWarnings("unchecked")
++  public Class<?>[] getParameterTypes()
++  {
++    return (Class<?>[]) VMConstructor.getParameterTypes(this);
++  }
++
++  /**
++   * Get the exception types this constructor says it throws, in no particular
++   * order. If the constructor has no throws clause, returns a 0-length array
++   * (not null).
++   *
++   * @return a list of the types in the constructor's throws clause
++   */
++  @SuppressWarnings("unchecked")
++  public Class<?>[] getExceptionTypes()
++  {
++    return (Class<?>[]) VMConstructor.getExceptionTypes(this);
++  }
++
++  /**
++   * Compare two objects to see if they are semantically equivalent.
++   * Two Constructors are semantically equivalent if they have the same
++   * declaring class and the same parameter list.  This ignores different
++   * exception clauses, but since you can't create a Method except through the
++   * VM, this is just the == relation.
++   *
++   * @param o the object to compare to
++   * @return <code>true</code> if they are equal; <code>false</code> if not.
++   */
++  public boolean equals(Object o)
++  {
++    if (!(o instanceof Constructor))
++      return false;
++    Constructor that = (Constructor)o; 
++    if (this.getDeclaringClass() != that.getDeclaringClass())
++      return false;
++    if (!Arrays.equals(this.getParameterTypes(), that.getParameterTypes()))
++      return false;
++    return true;
++  }
++
++  /**
++   * Get the hash code for the Constructor. The Constructor hash code is the
++   * hash code of the declaring class's name.
++   *
++   * @return the hash code for the object
++   */
++  public int hashCode()
++  {
++    return getDeclaringClass().getName().hashCode();
++  }
++
++  /**
++   * Get a String representation of the Constructor. A Constructor's String
++   * representation is "&lt;modifier&gt; &lt;classname&gt;(&lt;paramtypes&gt;)
++   * throws &lt;exceptions&gt;", where everything after ')' is omitted if
++   * there are no exceptions.<br> Example:
++   * <code>public java.io.FileInputStream(java.lang.Runnable)
++   * throws java.io.FileNotFoundException</code>
++   *
++   * @return the String representation of the Constructor
++   */
++  public String toString()
++  {
++    // 128 is a reasonable buffer initial size for constructor
++    CPStringBuilder sb = new CPStringBuilder(128);
++    Modifier.toString(getModifiers(), sb).append(' ');
++    sb.append(getDeclaringClass().getName()).append('(');
++    Class[] c = getParameterTypes();
++    if (c.length > 0)
++      {
++        sb.append(ClassHelper.getUserName(c[0]));
++        for (int i = 1; i < c.length; i++)
++          sb.append(',').append(ClassHelper.getUserName(c[i]));
++      }
++    sb.append(')');
++    c = getExceptionTypes();
++    if (c.length > 0)
++      {
++        sb.append(" throws ").append(c[0].getName());
++        for (int i = 1; i < c.length; i++)
++          sb.append(',').append(c[i].getName());
++      }
++    return sb.toString();
++  }
++
++  static <X extends GenericDeclaration>
++  void addTypeParameters(CPStringBuilder sb, TypeVariable<X>[] typeArgs)
++  {
++    if (typeArgs.length == 0)
++      return;
++    sb.append('<');
++    for (int i = 0; i < typeArgs.length; ++i)
++      {
++        if (i > 0)
++          sb.append(',');
++        sb.append(typeArgs[i]);
++      }
++    sb.append("> ");
++  }
++
++  public String toGenericString()
++  {
++    CPStringBuilder sb = new CPStringBuilder(128);
++    Modifier.toString(getModifiers(), sb).append(' ');
++    addTypeParameters(sb, getTypeParameters());
++    sb.append(getDeclaringClass().getName()).append('(');
++    Type[] types = getGenericParameterTypes();
++    if (types.length > 0)
++      {
++        sb.append(types[0]);
++        for (int i = 1; i < types.length; ++i)
++          sb.append(',').append(types[i]);
++      }
++    sb.append(')');
++    types = getGenericExceptionTypes();
++    if (types.length > 0)
++      {
++        sb.append(" throws ").append(types[0]);
++        for (int i = 1; i < types.length; i++)
++          sb.append(',').append(types[i]);
++      }
++    return sb.toString();
++  }
++
++  /**
++   * Create a new instance by invoking the constructor. Arguments are
++   * automatically unwrapped and widened, if needed.<p>
++   *
++   * If this class is abstract, you will get an
++   * <code>InstantiationException</code>. If the constructor takes 0
++   * arguments, you may use null or a 0-length array for <code>args</code>.<p>
++   *
++   * If this Constructor enforces access control, your runtime context is
++   * evaluated, and you may have an <code>IllegalAccessException</code> if
++   * you could not create this object in similar compiled code. If the class
++   * is uninitialized, you trigger class initialization, which may end in a
++   * <code>ExceptionInInitializerError</code>.<p>
++   *
++   * Then, the constructor is invoked. If it completes normally, the return
++   * value will be the new object. If it completes abruptly, the exception is
++   * wrapped in an <code>InvocationTargetException</code>.
++   *
++   * @param args the arguments to the constructor
++   * @return the newly created object
++   * @throws IllegalAccessException if the constructor could not normally be
++   *         called by the Java code (i.e. it is not public)
++   * @throws IllegalArgumentException if the number of arguments is incorrect;
++   *         or if the arguments types are wrong even with a widening
++   *         conversion
++   * @throws InstantiationException if the class is abstract
++   * @throws InvocationTargetException if the constructor throws an exception
++   * @throws ExceptionInInitializerError if construction triggered class
++   *         initialization, which then failed
++   */
++  @SuppressWarnings("unchecked")
++  public T newInstance(Object... args)
++    throws InstantiationException, IllegalAccessException,
++           InvocationTargetException
++  {
++    return (T) VMConstructor.constructNative(args, clazz, slot);
++  }
++
++  /**
++   * Returns an array of <code>TypeVariable</code> objects that represents
++   * the type variables declared by this constructor, in declaration order.
++   * An array of size zero is returned if this constructor has no type
++   * variables.
++   *
++   * @return the type variables associated with this constructor.
++   * @throws GenericSignatureFormatError if the generic signature does
++   *         not conform to the format specified in the Virtual Machine
++   *         specification, version 3.
++   * @since 1.5
++   */
++  public TypeVariable<Constructor<T>>[] getTypeParameters()
++  {
++    if (p == null)
++      {
++	String sig = VMConstructor.getSignature(this);
++	if (sig == null)
++	  return new TypeVariable[0];
++	p = new MethodSignatureParser(this, sig);
++      }
++    return p.getTypeParameters();
++  }
++
++  /**
++   * Returns an array of <code>Type</code> objects that represents
++   * the exception types declared by this constructor, in declaration order.
++   * An array of size zero is returned if this constructor declares no
++   * exceptions.
++   *
++   * @return the exception types declared by this constructor. 
++   * @throws GenericSignatureFormatError if the generic signature does
++   *         not conform to the format specified in the Virtual Machine
++   *         specification, version 3.
++   * @since 1.5
++   */
++  public Type[] getGenericExceptionTypes()
++  {
++    if (p == null)
++      {
++	String sig = VMConstructor.getSignature(this);
++	if (sig == null)
++	  return getExceptionTypes();
++	p = new MethodSignatureParser(this, sig);
++      }
++    return p.getGenericExceptionTypes();
++  }
++
++  /**
++   * Returns an array of <code>Type</code> objects that represents
++   * the parameter list for this constructor, in declaration order.
++   * An array of size zero is returned if this constructor takes no
++   * parameters.
++   *
++   * @return a list of the types of the constructor's parameters
++   * @throws GenericSignatureFormatError if the generic signature does
++   *         not conform to the format specified in the Virtual Machine
++   *         specification, version 3.
++   * @since 1.5
++   */
++  public Type[] getGenericParameterTypes()
++  {
++    if (p == null)
++      {
++	String sig = VMConstructor.getSignature(this);
++	if (sig == null)
++	  return getParameterTypes();
++	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 Annotation[][] getParameterAnnotations()
++  {
++    return VMConstructor.getParameterAnnotations(this);
++  }
++
++}
+Index: java/lang/reflect/Field.java
+===================================================================
+RCS file: java/lang/reflect/Field.java
+diff -N java/lang/reflect/Field.java
+--- /dev/null	1 Jan 1970 00:00:00 -0000
++++ java/lang/reflect/Field.java	2 Mar 2008 02:03:57 -0000
+@@ -0,0 +1,713 @@
++/* java.lang.reflect.Field - reflection of Java fields
++   Copyright (C) 1998, 2001, 2005, 2008 Free Software Foundation, Inc.
++
++This file is part of GNU Classpath.
++
++GNU Classpath is free software; you can redistribute it and/or modify
++it under the terms of the GNU General Public License as published by
++the Free Software Foundation; either version 2, or (at your option)
++any later version.
++ 
++GNU Classpath is distributed in the hope that it will be useful, but
++WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with GNU Classpath; see the file COPYING.  If not, write to the
++Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
++02110-1301 USA.
++
++Linking this library statically or dynamically with other modules is
++making a combined work based on this library.  Thus, the terms and
++conditions of the GNU General Public License cover the whole
++combination.
++
++As a special exception, the copyright holders of this library give you
++permission to link this library with independent modules to produce an
++executable, regardless of the license terms of these independent
++modules, and to copy and distribute the resulting executable under
++terms of your choice, provided that you also meet, for each linked
++independent module, the terms and conditions of the license of that
++module.  An independent module is a module which is not derived from
++or based on this library.  If you modify this library, you may extend
++this exception to your version of the library, but you are not
++obligated to do so.  If you do not wish to do so, delete this
++exception statement from your version. */
++
++
++package java.lang.reflect;
++
++import gnu.java.lang.ClassHelper;
++import gnu.java.lang.CPStringBuilder;
++
++import gnu.java.lang.reflect.FieldSignatureParser;
++
++/**
++ * The Field class represents a member variable of a class. It also allows
++ * dynamic access to a member, via reflection. This works for both
++ * static and instance fields. Operations on Field objects know how to
++ * do widening conversions, but throw {@link IllegalArgumentException} if
++ * a narrowing conversion would be necessary. You can query for information
++ * on this Field regardless of location, but get and set access may be limited
++ * by Java language access controls. If you can't do it in the compiler, you
++ * can't normally do it here either.<p>
++ *
++ * <B>Note:</B> This class returns and accepts types as Classes, even
++ * primitive types; there are Class types defined that represent each
++ * different primitive type.  They are <code>java.lang.Boolean.TYPE,
++ * java.lang.Byte.TYPE,</code>, also available as <code>boolean.class,
++ * byte.class</code>, etc.  These are not to be confused with the
++ * classes <code>java.lang.Boolean, java.lang.Byte</code>, etc., which are
++ * real classes.<p>
++ *
++ * Also note that this is not a serializable class.  It is entirely feasible
++ * to make it serializable using the Externalizable interface, but this is
++ * on Sun, not me.
++ *
++ * @author John Keiser
++ * @author Eric Blake <ebb9@email.byu.edu>
++ * @see Member
++ * @see Class
++ * @see Class#getField(String)
++ * @see Class#getDeclaredField(String)
++ * @see Class#getFields()
++ * @see Class#getDeclaredFields()
++ * @since 1.1
++ * @status updated to 1.4
++ */
++public final class Field
++extends AccessibleObject implements Member
++{
++  Class declaringClass;
++  String name;
++  int slot;
++
++  static final int FIELD_MODIFIERS
++    = Modifier.FINAL | Modifier.PRIVATE | Modifier.PROTECTED
++      | Modifier.PUBLIC | Modifier.STATIC | Modifier.TRANSIENT
++      | Modifier.VOLATILE;
++
++  private FieldSignatureParser p;
++
++  /**
++   * This class is uninstantiable outside the package.
++   */
++  Field(Class declaringClass, String name, int slot)
++  {
++    this.declaringClass = declaringClass;
++    this.name = name;
++    this.slot = slot;
++  }
++
++  /**
++   * Gets the class that declared this field, or the class where this field
++   * is a non-inherited member.
++   * @return the class that declared this member
++   */
++  public Class<?> getDeclaringClass()
++  {
++    return declaringClass;
++  }
++
++  /**
++   * Gets the name of this field.
++   * @return the name of this field
++   */
++  public String getName()
++  {
++    return name;
++  }
++
++  /**
++   * Gets the modifiers this field uses.  Use the <code>Modifier</code>
++   * class to interpret the values.  A field can only have a subset of the
++   * following modifiers: public, private, protected, static, final,
++   * transient, and volatile.
++   *
++   * @return an integer representing the modifiers to this Member
++   * @see Modifier
++   */
++  public int getModifiers()
++  {
++    return VMField.getModifiersInternal(this) & FIELD_MODIFIERS;
++  }
++
++  /**
++   * Return true if this field is synthetic, false otherwise.
++   * @since 1.5
++   */
++  public boolean isSynthetic()
++  {
++    return (VMField.getModifiersInternal(this) & Modifier.SYNTHETIC) != 0;
++  }
++
++  /**
++   * Return true if this field represents an enum constant,
++   * false otherwise.
++   * @since 1.5
++   */
++  public boolean isEnumConstant()
++  {
++    return (VMField.getModifiersInternal(this) & Modifier.ENUM) != 0;
++  }
++
++  /**
++   * Gets the type of this field.
++   * @return the type of this field
++   */
++  public Class<?> getType()
++  {
++    return VMField.getType(this);
++  }
++
++  /**
++   * Compare two objects to see if they are semantically equivalent.
++   * Two Fields are semantically equivalent if they have the same declaring
++   * class, name, and type. Since you can't creat a Field except through
++   * the VM, this is just the == relation.
++   *
++   * @param o the object to compare to
++   * @return <code>true</code> if they are equal; <code>false</code> if not
++   */
++  public boolean equals(Object o)
++  {
++    if (!(o instanceof Field))
++      return false;
++    Field that = (Field)o; 
++    if (this.getDeclaringClass() != that.getDeclaringClass())
++      return false;
++    if (!this.getName().equals(that.getName()))
++      return false;
++    if (this.getType() != that.getType())
++      return false;
++    return true;
++  }
++
++  /**
++   * Get the hash code for the Field. The Field hash code is the hash code
++   * of its name XOR'd with the hash code of its class name.
++   *
++   * @return the hash code for the object.
++   */
++  public int hashCode()
++  {
++    return getDeclaringClass().getName().hashCode() ^ getName().hashCode();
++  }
++
++  /**
++   * Get a String representation of the Field. A Field's String
++   * representation is "&lt;modifiers&gt; &lt;type&gt;
++   * &lt;class&gt;.&lt;fieldname&gt;".<br> Example:
++   * <code>public transient boolean gnu.parse.Parser.parseComplete</code>
++   *
++   * @return the String representation of the Field
++   */
++  public String toString()
++  {
++    // 64 is a reasonable buffer initial size for field
++    CPStringBuilder sb = new CPStringBuilder(64);
++    Modifier.toString(getModifiers(), sb).append(' ');
++    sb.append(ClassHelper.getUserName(getType())).append(' ');
++    sb.append(getDeclaringClass().getName()).append('.');
++    sb.append(getName());
++    return sb.toString();
++  }
++
++  public String toGenericString()
++  {
++    CPStringBuilder sb = new CPStringBuilder(64);
++    Modifier.toString(getModifiers(), sb).append(' ');
++    sb.append(getGenericType()).append(' ');
++    sb.append(getDeclaringClass().getName()).append('.');
++    sb.append(getName());
++    return sb.toString();
++  }
++
++  /**
++   * Get the value of this Field.  If it is primitive, it will be wrapped
++   * in the appropriate wrapper type (boolean = java.lang.Boolean).<p>
++   *
++   * If the field is static, <code>o</code> will be ignored. Otherwise, if
++   * <code>o</code> is null, you get a <code>NullPointerException</code>,
++   * and if it is incompatible with the declaring class of the field, you
++   * get an <code>IllegalArgumentException</code>.<p>
++   *
++   * Next, if this Field enforces access control, your runtime context is
++   * evaluated, and you may have an <code>IllegalAccessException</code> if
++   * you could not access this field in similar compiled code. If the field
++   * is static, and its class is uninitialized, you trigger class
++   * initialization, which may end in a
++   * <code>ExceptionInInitializerError</code>.<p>
++   *
++   * Finally, the field is accessed, and primitives are wrapped (but not
++   * necessarily in new objects). This method accesses the field of the
++   * declaring class, even if the instance passed in belongs to a subclass
++   * which declares another field to hide this one.
++   *
++   * @param o the object to get the value of this Field from
++   * @return the value of the Field
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if <code>o</code> is not an instance of
++   *         the class or interface declaring this field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #getBoolean(Object)
++   * @see #getByte(Object)
++   * @see #getChar(Object)
++   * @see #getShort(Object)
++   * @see #getInt(Object)
++   * @see #getLong(Object)
++   * @see #getFloat(Object)
++   * @see #getDouble(Object)
++   */
++  public Object get(Object o)
++    throws IllegalAccessException
++  {
++    return VMField.get(this, o);
++  }
++
++  /**
++   * Get the value of this boolean Field. If the field is static,
++   * <code>o</code> will be ignored.
++   *
++   * @param o the object to get the value of this Field from
++   * @return the value of the Field
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if this is not a boolean field of
++   *         <code>o</code>, or if <code>o</code> is not an instance of the
++   *         declaring class of this field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #get(Object)
++   */
++  public boolean getBoolean(Object o)
++    throws IllegalAccessException
++  {
++    return VMField.getBoolean(this, o);
++  }
++
++  /**
++   * Get the value of this byte Field. If the field is static,
++   * <code>o</code> will be ignored.
++   *
++   * @param o the object to get the value of this Field from
++   * @return the value of the Field
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if this is not a byte field of
++   *         <code>o</code>, or if <code>o</code> is not an instance of the
++   *         declaring class of this field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #get(Object)
++   */
++  public byte getByte(Object o)
++    throws IllegalAccessException
++  {
++    return VMField.getByte(this, o);
++  }
++
++  /**
++   * Get the value of this Field as a char. If the field is static,
++   * <code>o</code> will be ignored.
++   *
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if this is not a char field of
++   *         <code>o</code>, or if <code>o</code> is not an instance
++   *         of the declaring class of this field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #get(Object)
++   */
++  public char getChar(Object o)
++    throws IllegalAccessException
++  {
++    return VMField.getChar(this, o);
++  }
++
++  /**
++   * Get the value of this Field as a short. If the field is static,
++   * <code>o</code> will be ignored.
++   *
++   * @param o the object to get the value of this Field from
++   * @return the value of the Field
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if this is not a byte or short
++   *         field of <code>o</code>, or if <code>o</code> is not an instance
++   *         of the declaring class of this field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #get(Object)
++   */
++  public short getShort(Object o)
++    throws IllegalAccessException
++  {
++    return VMField.getShort(this, o);
++  }
++
++  /**
++   * Get the value of this Field as an int. If the field is static,
++   * <code>o</code> will be ignored.
++   *
++   * @param o the object to get the value of this Field from
++   * @return the value of the Field
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if this is not a byte, short, char, or
++   *         int field of <code>o</code>, or if <code>o</code> is not an
++   *         instance of the declaring class of this field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #get(Object)
++   */
++  public int getInt(Object o)
++    throws IllegalAccessException
++  {
++    return VMField.getInt(this, o);
++  }
++
++  /**
++   * Get the value of this Field as a long. If the field is static,
++   * <code>o</code> will be ignored.
++   *
++   * @param o the object to get the value of this Field from
++   * @return the value of the Field
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if this is not a byte, short, char, int,
++   *         or long field of <code>o</code>, or if <code>o</code> is not an
++   *         instance of the declaring class of this field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #get(Object)
++   */
++  public long getLong(Object o)
++    throws IllegalAccessException
++  {
++    return VMField.getLong(this, o);
++  }
++
++  /**
++   * Get the value of this Field as a float. If the field is static,
++   * <code>o</code> will be ignored.
++   *
++   * @param o the object to get the value of this Field from
++   * @return the value of the Field
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if this is not a byte, short, char, int,
++   *         long, or float field of <code>o</code>, or if <code>o</code> is
++   *         not an instance of the declaring class of this field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #get(Object)
++   */
++  public float getFloat(Object o)
++    throws IllegalAccessException
++  {
++    return VMField.getFloat(this, o);
++  }
++
++  /**
++   * Get the value of this Field as a double. If the field is static,
++   * <code>o</code> will be ignored.
++   *
++   * @param o the object to get the value of this Field from
++   * @return the value of the Field
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if this is not a byte, short, char, int,
++   *         long, float, or double field of <code>o</code>, or if
++   *         <code>o</code> is not an instance of the declaring class of this
++   *         field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #get(Object)
++   */
++  public double getDouble(Object o)
++    throws IllegalAccessException
++  {
++    return VMField.getDouble(this, o);
++  }
++
++  /**
++   * Set the value of this Field.  If it is a primitive field, the value
++   * will be unwrapped from the passed object (boolean = java.lang.Boolean).<p>
++   *
++   * If the field is static, <code>o</code> will be ignored. Otherwise, if
++   * <code>o</code> is null, you get a <code>NullPointerException</code>,
++   * and if it is incompatible with the declaring class of the field, you
++   * get an <code>IllegalArgumentException</code>.<p>
++   *
++   * Next, if this Field enforces access control, your runtime context is
++   * evaluated, and you may have an <code>IllegalAccessException</code> if
++   * you could not access this field in similar compiled code. This also
++   * occurs whether or not there is access control if the field is final.
++   * If the field is primitive, and unwrapping your argument fails, you will
++   * get an <code>IllegalArgumentException</code>; likewise, this error
++   * happens if <code>value</code> cannot be cast to the correct object type.
++   * If the field is static, and its class is uninitialized, you trigger class
++   * initialization, which may end in a
++   * <code>ExceptionInInitializerError</code>.<p>
++   *
++   * Finally, the field is set with the widened value. This method accesses
++   * the field of the declaring class, even if the instance passed in belongs
++   * to a subclass which declares another field to hide this one.
++   *
++   * @param o the object to set this Field on
++   * @param value the value to set this Field to
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if <code>value</code> cannot be
++   *         converted by a widening conversion to the underlying type of
++   *         the Field, or if <code>o</code> is not an instance of the class
++   *         declaring this field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #setBoolean(Object, boolean)
++   * @see #setByte(Object, byte)
++   * @see #setChar(Object, char)
++   * @see #setShort(Object, short)
++   * @see #setInt(Object, int)
++   * @see #setLong(Object, long)
++   * @see #setFloat(Object, float)
++   * @see #setDouble(Object, double)
++   */
++  public void set(Object o, Object value)
++    throws IllegalAccessException
++  {
++    VMField.set(this, o, value);
++  }
++
++  /**
++   * Set this boolean Field. If the field is static, <code>o</code> will be
++   * ignored.
++   *
++   * @param o the object to set this Field on
++   * @param value the value to set this Field to
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if this is not a boolean field, or if
++   *         <code>o</code> is not an instance of the class declaring this
++   *         field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #set(Object, Object)
++   */
++  public void setBoolean(Object o, boolean value)
++    throws IllegalAccessException
++  {
++    VMField.setBoolean(this, o, value);
++  }
++
++  /**
++   * Set this byte Field. If the field is static, <code>o</code> will be
++   * ignored.
++   *
++   * @param o the object to set this Field on
++   * @param value the value to set this Field to
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if this is not a byte, short, int, long,
++   *         float, or double field, or if <code>o</code> is not an instance
++   *         of the class declaring this field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #set(Object, Object)
++   */
++  public void setByte(Object o, byte value)
++    throws IllegalAccessException
++  {
++    VMField.setByte(this, o, value);
++  }
++
++  /**
++   * Set this char Field. If the field is static, <code>o</code> will be
++   * ignored.
++   *
++   * @param o the object to set this Field on
++   * @param value the value to set this Field to
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if this is not a char, int, long,
++   *         float, or double field, or if <code>o</code> is not an instance
++   *         of the class declaring this field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #set(Object, Object)
++   */
++  public void setChar(Object o, char value)
++    throws IllegalAccessException
++  {
++    VMField.setChar(this, o, value);
++  }
++
++  /**
++   * Set this short Field. If the field is static, <code>o</code> will be
++   * ignored.
++   *
++   * @param o the object to set this Field on
++   * @param value the value to set this Field to
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if this is not a short, int, long,
++   *         float, or double field, or if <code>o</code> is not an instance
++   *         of the class declaring this field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #set(Object, Object)
++   */
++  public void setShort(Object o, short value)
++    throws IllegalAccessException
++  {
++    VMField.setShort(this, o, value);
++  }
++
++  /**
++   * Set this int Field. If the field is static, <code>o</code> will be
++   * ignored.
++   *
++   * @param o the object to set this Field on
++   * @param value the value to set this Field to
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if this is not an int, long, float, or
++   *         double field, or if <code>o</code> is not an instance of the
++   *         class declaring this field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #set(Object, Object)
++   */
++  public void setInt(Object o, int value)
++    throws IllegalAccessException
++  {
++    VMField.setInt(this, o, value);
++  }
++
++  /**
++   * Set this long Field. If the field is static, <code>o</code> will be
++   * ignored.
++   *
++   * @param o the object to set this Field on
++   * @param value the value to set this Field to
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if this is not a long, float, or double
++   *         field, or if <code>o</code> is not an instance of the class
++   *         declaring this field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #set(Object, Object)
++   */
++  public void setLong(Object o, long value)
++    throws IllegalAccessException
++  {
++    VMField.setLong(this, o, value);
++  }
++
++  /**
++   * Set this float Field. If the field is static, <code>o</code> will be
++   * ignored.
++   *
++   * @param o the object to set this Field on
++   * @param value the value to set this Field to
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if this is not a float or long field, or
++   *         if <code>o</code> is not an instance of the class declaring this
++   *         field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #set(Object, Object)
++   */
++  public void setFloat(Object o, float value)
++    throws IllegalAccessException
++  {
++    VMField.setFloat(this, o, value);
++  }
++
++  /**
++   * Set this double Field. If the field is static, <code>o</code> will be
++   * ignored.
++   *
++   * @param o the object to set this Field on
++   * @param value the value to set this Field to
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if this is not a double field, or if
++   *         <code>o</code> is not an instance of the class declaring this
++   *         field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #set(Object, Object)
++   */
++  public void setDouble(Object o, double value)
++    throws IllegalAccessException
++  {
++    VMField.setDouble(this, o, value);
++  }
++
++  /**
++   * Return the generic type of the field. If the field type is not a generic
++   * type, the method returns the same as <code>getType()</code>.
++   *
++   * @throws GenericSignatureFormatError if the generic signature does
++   *         not conform to the format specified in the Virtual Machine
++   *         specification, version 3.
++   * @since 1.5
++   */
++  public Type getGenericType()
++  {
++    if (p == null)
++      {
++	String signature = VMField.getSignature(this);
++	if (signature == null)
++	  return getType();
++	p = new FieldSignatureParser(getDeclaringClass(),
++				     signature);
++      }
++    return p.getFieldType();
++  }
++
++}
+Index: java/lang/reflect/Method.java
+===================================================================
+RCS file: java/lang/reflect/Method.java
+diff -N java/lang/reflect/Method.java
+--- /dev/null	1 Jan 1970 00:00:00 -0000
++++ java/lang/reflect/Method.java	2 Mar 2008 02:03:57 -0000
+@@ -0,0 +1,502 @@
++/* java.lang.reflect.Method - reflection of Java methods
++   Copyright (C) 1998, 2001, 2002, 2005, 2007, 2008 Free Software Foundation, Inc.
++
++This file is part of GNU Classpath.
++
++GNU Classpath is free software; you can redistribute it and/or modify
++it under the terms of the GNU General Public License as published by
++the Free Software Foundation; either version 2, or (at your option)
++any later version.
++ 
++GNU Classpath is distributed in the hope that it will be useful, but
++WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with GNU Classpath; see the file COPYING.  If not, write to the
++Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
++02110-1301 USA.
++
++Linking this library statically or dynamically with other modules is
++making a combined work based on this library.  Thus, the terms and
++conditions of the GNU General Public License cover the whole
++combination.
++
++As a special exception, the copyright holders of this library give you
++permission to link this library with independent modules to produce an
++executable, regardless of the license terms of these independent
++modules, and to copy and distribute the resulting executable under
++terms of your choice, provided that you also meet, for each linked
++independent module, the terms and conditions of the license of that
++module.  An independent module is a module which is not derived from
++or based on this library.  If you modify this library, you may extend
++this exception to your version of the library, but you are not
++obligated to do so.  If you do not wish to do so, delete this
++exception statement from your version. */
++
++
++package java.lang.reflect;
++
++import gnu.java.lang.ClassHelper;
++import gnu.java.lang.CPStringBuilder;
++
++import gnu.java.lang.reflect.MethodSignatureParser;
++
++import java.lang.annotation.Annotation;
++import java.util.Arrays;
++
++/**
++ * The Method class represents a member method of a class. It also allows
++ * dynamic invocation, via reflection. This works for both static and
++ * instance methods. Invocation on Method objects knows how to do
++ * widening conversions, but throws {@link IllegalArgumentException} if
++ * a narrowing conversion would be necessary. You can query for information
++ * on this Method regardless of location, but invocation access may be limited
++ * by Java language access controls. If you can't do it in the compiler, you
++ * can't normally do it here either.<p>
++ *
++ * <B>Note:</B> This class returns and accepts types as Classes, even
++ * primitive types; there are Class types defined that represent each
++ * different primitive type.  They are <code>java.lang.Boolean.TYPE,
++ * java.lang.Byte.TYPE,</code>, also available as <code>boolean.class,
++ * byte.class</code>, etc.  These are not to be confused with the
++ * classes <code>java.lang.Boolean, java.lang.Byte</code>, etc., which are
++ * real classes.<p>
++ *
++ * Also note that this is not a serializable class.  It is entirely feasible
++ * to make it serializable using the Externalizable interface, but this is
++ * on Sun, not me.
++ *
++ * @author John Keiser
++ * @author Eric Blake <ebb9@email.byu.edu>
++ * @see Member
++ * @see Class
++ * @see java.lang.Class#getMethod(String,Class[])
++ * @see java.lang.Class#getDeclaredMethod(String,Class[])
++ * @see java.lang.Class#getMethods()
++ * @see java.lang.Class#getDeclaredMethods()
++ * @since 1.1
++ * @status updated to 1.4
++ */
++public final class Method
++extends AccessibleObject implements Member, GenericDeclaration
++{
++  Class declaringClass;
++  String name;
++  int slot;
++
++  static final int METHOD_MODIFIERS
++    = Modifier.ABSTRACT | Modifier.FINAL | Modifier.NATIVE
++      | Modifier.PRIVATE | Modifier.PROTECTED | Modifier.PUBLIC
++      | Modifier.STATIC | Modifier.STRICT | Modifier.SYNCHRONIZED;
++
++  private MethodSignatureParser p;
++
++  /**
++   * This class is uninstantiable outside this package.
++   */
++  Method(Class declaringClass, String name, int slot)
++  {
++    this.declaringClass = declaringClass;
++    this.name = name;
++    this.slot = slot;
++  }
++
++  /**
++   * Gets the class that declared this method, or the class where this method
++   * is a non-inherited member.
++   * @return the class that declared this member
++   */
++  public Class<?> getDeclaringClass()
++  {
++    return declaringClass;
++  }
++
++  /**
++   * Gets the name of this method.
++   * @return the name of this method
++   */
++  public String getName()
++  {
++    return name;
++  }
++
++  /**
++   * Gets the modifiers this method uses.  Use the <code>Modifier</code>
++   * class to interpret the values.  A method can only have a subset of the
++   * following modifiers: public, private, protected, abstract, static,
++   * final, synchronized, native, and strictfp.
++   *
++   * @return an integer representing the modifiers to this Member
++   * @see Modifier
++   */
++  public int getModifiers()
++  {
++    return VMMethod.getModifiersInternal(this) & METHOD_MODIFIERS;
++  }
++
++  /**
++   * Return true if this method is a bridge method.  A bridge method
++   * is generated by the compiler in some situations involving
++   * generics and inheritance.
++   * @since 1.5
++   */
++  public boolean isBridge()
++  {
++    return (VMMethod.getModifiersInternal(this) & Modifier.BRIDGE) != 0;
++  }
++
++  /**
++   * Return true if this method is synthetic, false otherwise.
++   * @since 1.5
++   */
++  public boolean isSynthetic()
++  {
++    return (VMMethod.getModifiersInternal(this) & Modifier.SYNTHETIC) != 0;
++  }
++
++  /**
++   * Return true if this is a varargs method, that is if
++   * the method takes a variable number of arguments.
++   * @since 1.5
++   */
++  public boolean isVarArgs()
++  {
++    return (VMMethod.getModifiersInternal(this) & Modifier.VARARGS) != 0;
++  }
++
++  /**
++   * Gets the return type of this method.
++   * @return the type of this method
++   */
++  @SuppressWarnings("unchecked")
++  public Class<?> getReturnType()
++  {
++    return (Class<?>) VMMethod.getReturnType(this);
++  }
++
++  /**
++   * Get the parameter list for this method, in declaration order. If the
++   * method takes no parameters, returns a 0-length array (not null).
++   *
++   * @return a list of the types of the method's parameters
++   */
++  @SuppressWarnings("unchecked")
++  public Class<?>[] getParameterTypes()
++  {
++    return (Class<?>[]) VMMethod.getParameterTypes(this);
++  }
++
++  /**
++   * Get the exception types this method says it throws, in no particular
++   * order. If the method has no throws clause, returns a 0-length array
++   * (not null).
++   *
++   * @return a list of the types in the method's throws clause
++   */
++  @SuppressWarnings("unchecked")
++  public Class<?>[] getExceptionTypes()
++  {
++    return (Class<?>[]) VMMethod.getExceptionTypes(this);
++  }
++
++  /**
++   * Compare two objects to see if they are semantically equivalent.
++   * Two Methods are semantically equivalent if they have the same declaring
++   * class, name, parameter list, and return type.
++   *
++   * @param o the object to compare to
++   * @return <code>true</code> if they are equal; <code>false</code> if not
++   */
++  public boolean equals(Object o)
++  {
++      // Implementation note:
++      // The following is a correct but possibly slow implementation.
++      //
++      // This class has a private field 'slot' that could be used by
++      // the VM implementation to "link" a particular method to a Class.
++      // In that case equals could be simply implemented as:
++      //
++      // if (o instanceof Method)
++      // {
++      //    Method m = (Method)o;
++      //    return m.declaringClass == this.declaringClass
++      //           && m.slot == this.slot;
++      // }
++      // return false;
++      //
++      // If a VM uses the Method class as their native/internal representation
++      // then just using the following would be optimal:
++      //
++      // return this == o;
++      //
++    if (!(o instanceof Method))
++      return false;
++    Method that = (Method)o;
++    if (this.getDeclaringClass() != that.getDeclaringClass())
++      return false;
++    if (!this.getName().equals(that.getName()))
++      return false;
++    if (this.getReturnType() != that.getReturnType())
++      return false;
++    if (!Arrays.equals(this.getParameterTypes(), that.getParameterTypes()))
++      return false;
++    return true;
++  }
++
++  /**
++   * Get the hash code for the Method. The Method hash code is the hash code
++   * of its name XOR'd with the hash code of its class name.
++   *
++   * @return the hash code for the object
++   */
++  public int hashCode()
++  {
++    return getDeclaringClass().getName().hashCode() ^ getName().hashCode();
++  }
++
++  /**
++   * Get a String representation of the Method. A Method's String
++   * representation is "&lt;modifiers&gt; &lt;returntype&gt;
++   * &lt;methodname&gt;(&lt;paramtypes&gt;) throws &lt;exceptions&gt;", where
++   * everything after ')' is omitted if there are no exceptions.<br> Example:
++   * <code>public static int run(java.lang.Runnable,int)</code>
++   *
++   * @return the String representation of the Method
++   */
++  public String toString()
++  {
++    // 128 is a reasonable buffer initial size for constructor
++    CPStringBuilder sb = new CPStringBuilder(128);
++    Modifier.toString(getModifiers(), sb).append(' ');
++    sb.append(ClassHelper.getUserName(getReturnType())).append(' ');
++    sb.append(getDeclaringClass().getName()).append('.');
++    sb.append(getName()).append('(');
++    Class[] c = getParameterTypes();
++    if (c.length > 0)
++      {
++        sb.append(ClassHelper.getUserName(c[0]));
++        for (int i = 1; i < c.length; i++)
++          sb.append(',').append(ClassHelper.getUserName(c[i]));
++      }
++    sb.append(')');
++    c = getExceptionTypes();
++    if (c.length > 0)
++      {
++        sb.append(" throws ").append(c[0].getName());
++        for (int i = 1; i < c.length; i++)
++          sb.append(',').append(c[i].getName());
++      }
++    return sb.toString();
++  }
++
++  public String toGenericString()
++  {
++    // 128 is a reasonable buffer initial size for constructor
++    CPStringBuilder sb = new CPStringBuilder(128);
++    Modifier.toString(getModifiers(), sb).append(' ');
++    Constructor.addTypeParameters(sb, getTypeParameters());
++    sb.append(getGenericReturnType()).append(' ');
++    sb.append(getDeclaringClass().getName()).append('.');
++    sb.append(getName()).append('(');
++    Type[] types = getGenericParameterTypes();
++    if (types.length > 0)
++      {
++        sb.append(types[0]);
++        for (int i = 1; i < types.length; i++)
++          sb.append(',').append(types[i]);
++      }
++    sb.append(')');
++    types = getGenericExceptionTypes();
++    if (types.length > 0)
++      {
++        sb.append(" throws ").append(types[0]);
++        for (int i = 1; i < types.length; i++)
++          sb.append(',').append(types[i]);
++      }
++    return sb.toString();
++  }
++
++  /**
++   * Invoke the method. Arguments are automatically unwrapped and widened,
++   * and the result is automatically wrapped, if needed.<p>
++   *
++   * If the method is static, <code>o</code> will be ignored. Otherwise,
++   * the method uses dynamic lookup as described in JLS 15.12.4.4. You cannot
++   * mimic the behavior of nonvirtual lookup (as in super.foo()). This means
++   * you will get a <code>NullPointerException</code> if <code>o</code> is
++   * null, and an <code>IllegalArgumentException</code> if it is incompatible
++   * with the declaring class of the method. If the method takes 0 arguments,
++   * you may use null or a 0-length array for <code>args</code>.<p>
++   *
++   * Next, if this Method enforces access control, your runtime context is
++   * evaluated, and you may have an <code>IllegalAccessException</code> if
++   * you could not acces this method in similar compiled code. If the method
++   * is static, and its class is uninitialized, you trigger class
++   * initialization, which may end in a
++   * <code>ExceptionInInitializerError</code>.<p>
++   *
++   * Finally, the method is invoked. If it completes normally, the return value
++   * will be null for a void method, a wrapped object for a primitive return
++   * method, or the actual return of an Object method. If it completes
++   * abruptly, the exception is wrapped in an
++   * <code>InvocationTargetException</code>.
++   *
++   * @param o the object to invoke the method on
++   * @param args the arguments to the method
++   * @return the return value of the method, wrapped in the appropriate
++   *         wrapper if it is primitive
++   * @throws IllegalAccessException if the method could not normally be called
++   *         by the Java code (i.e. it is not public)
++   * @throws IllegalArgumentException if the number of arguments is incorrect;
++   *         if the arguments types are wrong even with a widening conversion;
++   *         or if <code>o</code> is not an instance of the class or interface
++   *         declaring this method
++   * @throws InvocationTargetException if the method throws an exception
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static method triggered
++   *         class initialization, which then failed
++   */
++  public Object invoke(Object o, Object... args)
++    throws IllegalAccessException, InvocationTargetException
++  {
++    return VMMethod.invokeNative(o, args, declaringClass, slot);
++  }
++
++  /**
++   * Returns an array of <code>TypeVariable</code> objects that represents
++   * the type variables declared by this constructor, in declaration order.
++   * An array of size zero is returned if this class has no type
++   * variables.
++   *
++   * @return the type variables associated with this class. 
++   * @throws GenericSignatureFormatError if the generic signature does
++   *         not conform to the format specified in the Virtual Machine
++   *         specification, version 3.
++   * @since 1.5
++   */
++  public TypeVariable<Method>[] getTypeParameters()
++  {
++    if (p == null)
++      {
++	String sig = VMMethod.getSignature(this);
++	if (sig == null)
++	  return (TypeVariable<Method>[]) new TypeVariable[0];
++	p = new MethodSignatureParser(this, sig);
++      }
++    return p.getTypeParameters();
++  }
++
++  /**
++   * Returns an array of <code>Type</code> objects that represents
++   * the exception types declared by this method, in declaration order.
++   * An array of size zero is returned if this method declares no
++   * exceptions.
++   *
++   * @return the exception types declared by this method. 
++   * @throws GenericSignatureFormatError if the generic signature does
++   *         not conform to the format specified in the Virtual Machine
++   *         specification, version 3.
++   * @since 1.5
++   */
++  public Type[] getGenericExceptionTypes()
++  {
++    if (p == null)
++      {
++	String sig = VMMethod.getSignature(this);
++	if (sig == null)
++	  return getExceptionTypes();
++	p = new MethodSignatureParser(this, sig);
++      }
++    return p.getGenericExceptionTypes();
++  }
++
++  /**
++   * Returns an array of <code>Type</code> objects that represents
++   * the parameter list for this method, in declaration order.
++   * An array of size zero is returned if this method takes no
++   * parameters.
++   *
++   * @return a list of the types of the method's parameters
++   * @throws GenericSignatureFormatError if the generic signature does
++   *         not conform to the format specified in the Virtual Machine
++   *         specification, version 3.
++   * @since 1.5
++   */
++  public Type[] getGenericParameterTypes()
++  {
++    if (p == null)
++      {
++	String sig = VMMethod.getSignature(this);
++	if (sig == null)
++	  return getParameterTypes();
++	p = new MethodSignatureParser(this, sig);
++      }
++    return p.getGenericParameterTypes();
++  }
++
++  /**
++   * Returns the return type of this method.
++   *
++   * @return the return type of this method
++   * @throws GenericSignatureFormatError if the generic signature does
++   *         not conform to the format specified in the Virtual Machine
++   *         specification, version 3.
++   * @since 1.5
++   */
++  public Type getGenericReturnType()
++  {
++    if (p == null)
++      {
++	String sig = VMMethod.getSignature(this);
++	if (sig == null)
++	  return getReturnType();
++	p = new MethodSignatureParser(this, sig);
++      }
++    return p.getGenericReturnType();
++  }
++
++  /**
++   * If this method is an annotation method, returns the default
++   * value for the method.  If there is no default value, or if the
++   * method is not a member of an annotation type, returns null.
++   * Primitive types are wrapped.
++   *
++   * @throws TypeNotPresentException if the method returns a Class,
++   * and the class cannot be found
++   *
++   * @since 1.5
++   */
++  public Object getDefaultValue()
++  {
++    return VMMethod.getDefaultValue(this);
++  }
++
++  /**
++   * <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 Annotation[][] getParameterAnnotations()
++  {
++    return VMMethod.getParameterAnnotations(this);
++  }
++
++}
+Index: vm/reference/java/lang/reflect/Constructor.java
+===================================================================
+RCS file: vm/reference/java/lang/reflect/Constructor.java
+diff -N vm/reference/java/lang/reflect/Constructor.java
+--- vm/reference/java/lang/reflect/Constructor.java	1 Mar 2008 10:13:32 -0000	1.24
++++ /dev/null	1 Jan 1970 00:00:00 -0000
+@@ -1,421 +0,0 @@
+-/* java.lang.reflect.Constructor - reflection of Java constructors
+-   Copyright (C) 1998, 2001, 2004, 2005 Free Software Foundation, Inc.
+-
+-This file is part of GNU Classpath.
+-
+-GNU Classpath is free software; you can redistribute it and/or modify
+-it under the terms of the GNU General Public License as published by
+-the Free Software Foundation; either version 2, or (at your option)
+-any later version.
+- 
+-GNU Classpath is distributed in the hope that it will be useful, but
+-WITHOUT ANY WARRANTY; without even the implied warranty of
+-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+-General Public License for more details.
+-
+-You should have received a copy of the GNU General Public License
+-along with GNU Classpath; see the file COPYING.  If not, write to the
+-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+-02110-1301 USA.
+-
+-Linking this library statically or dynamically with other modules is
+-making a combined work based on this library.  Thus, the terms and
+-conditions of the GNU General Public License cover the whole
+-combination.
+-
+-As a special exception, the copyright holders of this library give you
+-permission to link this library with independent modules to produce an
+-executable, regardless of the license terms of these independent
+-modules, and to copy and distribute the resulting executable under
+-terms of your choice, provided that you also meet, for each linked
+-independent module, the terms and conditions of the license of that
+-module.  An independent module is a module which is not derived from
+-or based on this library.  If you modify this library, you may extend
+-this exception to your version of the library, but you are not
+-obligated to do so.  If you do not wish to do so, delete this
+-exception statement from your version. */
+-
+-
+-package java.lang.reflect;
+-
+-import gnu.java.lang.ClassHelper;
+-import gnu.java.lang.CPStringBuilder;
+-
+-import gnu.java.lang.reflect.MethodSignatureParser;
+-
+-import java.lang.annotation.Annotation;
+-import java.util.Arrays;
+-
+-/**
+- * The Constructor class represents a constructor of a class. It also allows
+- * dynamic creation of an object, via reflection. Invocation on Constructor
+- * objects knows how to do widening conversions, but throws
+- * {@link IllegalArgumentException} if a narrowing conversion would be
+- * necessary. You can query for information on this Constructor regardless
+- * of location, but construction access may be limited by Java language
+- * access controls. If you can't do it in the compiler, you can't normally
+- * do it here either.<p>
+- *
+- * <B>Note:</B> This class returns and accepts types as Classes, even
+- * primitive types; there are Class types defined that represent each
+- * different primitive type.  They are <code>java.lang.Boolean.TYPE,
+- * java.lang.Byte.TYPE,</code>, also available as <code>boolean.class,
+- * byte.class</code>, etc.  These are not to be confused with the
+- * classes <code>java.lang.Boolean, java.lang.Byte</code>, etc., which are
+- * real classes.<p>
+- *
+- * Also note that this is not a serializable class.  It is entirely feasible
+- * to make it serializable using the Externalizable interface, but this is
+- * on Sun, not me.
+- *
+- * @author John Keiser
+- * @author Eric Blake <ebb9@email.byu.edu>
+- * @see Member
+- * @see Class
+- * @see java.lang.Class#getConstructor(Class[])
+- * @see java.lang.Class#getDeclaredConstructor(Class[])
+- * @see java.lang.Class#getConstructors()
+- * @see java.lang.Class#getDeclaredConstructors()
+- * @since 1.1
+- * @status updated to 1.4
+- */
+-public final class Constructor<T>
+-  extends AccessibleObject
+-  implements GenericDeclaration, Member
+-{
+-  private Class<T> clazz;
+-  private int slot;
+-  
+-  private static final int CONSTRUCTOR_MODIFIERS
+-    = Modifier.PRIVATE | Modifier.PROTECTED | Modifier.PUBLIC;
+-
+-  /**
+-   * This class is uninstantiable except from native code.
+-   */
+-  private Constructor(Class declaringClass,int slot)
+-  {
+-    this.clazz = declaringClass;
+-    this.slot = slot;
+-  }
+-
+-  private Constructor()
+-  {
+-  }
+-
+-  /**
+-   * Gets the class that declared this constructor.
+-   * @return the class that declared this member
+-   */
+-  public Class<T> getDeclaringClass()
+-  {
+-    return clazz;
+-  }
+-
+-  /**
+-   * Gets the name of this constructor (the non-qualified name of the class
+-   * it was declared in).
+-   * @return the name of this constructor
+-   */
+-  public String getName()
+-  {
+-    return getDeclaringClass().getName();
+-  }
+-
+-  /**
+-   * Return the raw modifiers for this constructor.  In particular
+-   * this will include the synthetic and varargs bits.
+-   * @return the constructor's modifiers
+-   */
+-  private native int getModifiersInternal();
+-
+-  /**
+-   * Gets the modifiers this constructor uses.  Use the <code>Modifier</code>
+-   * class to interpret the values. A constructor can only have a subset of the
+-   * following modifiers: public, private, protected.
+-   *
+-   * @return an integer representing the modifiers to this Member
+-   * @see Modifier
+-   */
+-  public int getModifiers()
+-  {
+-    return getModifiersInternal() & CONSTRUCTOR_MODIFIERS;
+-  }
+-
+-  /**
+-   * Return true if this constructor is synthetic, false otherwise.
+-   * A synthetic member is one which is created by the compiler,
+-   * and which does not appear in the user's source code.
+-   * @since 1.5
+-   */
+-  public boolean isSynthetic()
+-  {
+-    return (getModifiersInternal() & Modifier.SYNTHETIC) != 0;
+-  }
+-
+-  /**
+-   * Return true if this is a varargs constructor, that is if
+-   * the constructor takes a variable number of arguments.
+-   * @since 1.5
+-   */
+-  public boolean isVarArgs()
+-  {
+-    return (getModifiersInternal() & Modifier.VARARGS) != 0;
+-  }
+-
+-  /**
+-   * Get the parameter list for this constructor, in declaration order. If the
+-   * constructor takes no parameters, returns a 0-length array (not null).
+-   *
+-   * @return a list of the types of the constructor's parameters
+-   */
+-  public native Class<?>[] getParameterTypes();
+-
+-  /**
+-   * Get the exception types this constructor says it throws, in no particular
+-   * order. If the constructor has no throws clause, returns a 0-length array
+-   * (not null).
+-   *
+-   * @return a list of the types in the constructor's throws clause
+-   */
+-  public native Class<?>[] getExceptionTypes();
+-
+-  /**
+-   * Compare two objects to see if they are semantically equivalent.
+-   * Two Constructors are semantically equivalent if they have the same
+-   * declaring class and the same parameter list.  This ignores different
+-   * exception clauses, but since you can't create a Method except through the
+-   * VM, this is just the == relation.
+-   *
+-   * @param o the object to compare to
+-   * @return <code>true</code> if they are equal; <code>false</code> if not.
+-   */
+-  public boolean equals(Object o)
+-  {
+-    if (!(o instanceof Constructor))
+-      return false;
+-    Constructor that = (Constructor)o; 
+-    if (this.getDeclaringClass() != that.getDeclaringClass())
+-      return false;
+-    if (!Arrays.equals(this.getParameterTypes(), that.getParameterTypes()))
+-      return false;
+-    return true;
+-  }
+-
+-  /**
+-   * Get the hash code for the Constructor. The Constructor hash code is the
+-   * hash code of the declaring class's name.
+-   *
+-   * @return the hash code for the object
+-   */
+-  public int hashCode()
+-  {
+-    return getDeclaringClass().getName().hashCode();
+-  }
+-
+-  /**
+-   * Get a String representation of the Constructor. A Constructor's String
+-   * representation is "&lt;modifier&gt; &lt;classname&gt;(&lt;paramtypes&gt;)
+-   * throws &lt;exceptions&gt;", where everything after ')' is omitted if
+-   * there are no exceptions.<br> Example:
+-   * <code>public java.io.FileInputStream(java.lang.Runnable)
+-   * throws java.io.FileNotFoundException</code>
+-   *
+-   * @return the String representation of the Constructor
+-   */
+-  public String toString()
+-  {
+-    // 128 is a reasonable buffer initial size for constructor
+-    CPStringBuilder sb = new CPStringBuilder(128);
+-    Modifier.toString(getModifiers(), sb).append(' ');
+-    sb.append(getDeclaringClass().getName()).append('(');
+-    Class[] c = getParameterTypes();
+-    if (c.length > 0)
+-      {
+-        sb.append(ClassHelper.getUserName(c[0]));
+-        for (int i = 1; i < c.length; i++)
+-          sb.append(',').append(ClassHelper.getUserName(c[i]));
+-      }
+-    sb.append(')');
+-    c = getExceptionTypes();
+-    if (c.length > 0)
+-      {
+-        sb.append(" throws ").append(c[0].getName());
+-        for (int i = 1; i < c.length; i++)
+-          sb.append(',').append(c[i].getName());
+-      }
+-    return sb.toString();
+-  }
+-
+-  static <X extends GenericDeclaration>
+-  void addTypeParameters(CPStringBuilder sb, TypeVariable<X>[] typeArgs)
+-  {
+-    if (typeArgs.length == 0)
+-      return;
+-    sb.append('<');
+-    for (int i = 0; i < typeArgs.length; ++i)
+-      {
+-        if (i > 0)
+-          sb.append(',');
+-        sb.append(typeArgs[i]);
+-      }
+-    sb.append("> ");
+-  }
+-
+-  public String toGenericString()
+-  {
+-    CPStringBuilder sb = new CPStringBuilder(128);
+-    Modifier.toString(getModifiers(), sb).append(' ');
+-    addTypeParameters(sb, getTypeParameters());
+-    sb.append(getDeclaringClass().getName()).append('(');
+-    Type[] types = getGenericParameterTypes();
+-    if (types.length > 0)
+-      {
+-        sb.append(types[0]);
+-        for (int i = 1; i < types.length; ++i)
+-          sb.append(',').append(types[i]);
+-      }
+-    sb.append(')');
+-    types = getGenericExceptionTypes();
+-    if (types.length > 0)
+-      {
+-        sb.append(" throws ").append(types[0]);
+-        for (int i = 1; i < types.length; i++)
+-          sb.append(',').append(types[i]);
+-      }
+-    return sb.toString();
+-  }
+-
+-  /**
+-   * Create a new instance by invoking the constructor. Arguments are
+-   * automatically unwrapped and widened, if needed.<p>
+-   *
+-   * If this class is abstract, you will get an
+-   * <code>InstantiationException</code>. If the constructor takes 0
+-   * arguments, you may use null or a 0-length array for <code>args</code>.<p>
+-   *
+-   * If this Constructor enforces access control, your runtime context is
+-   * evaluated, and you may have an <code>IllegalAccessException</code> if
+-   * you could not create this object in similar compiled code. If the class
+-   * is uninitialized, you trigger class initialization, which may end in a
+-   * <code>ExceptionInInitializerError</code>.<p>
+-   *
+-   * Then, the constructor is invoked. If it completes normally, the return
+-   * value will be the new object. If it completes abruptly, the exception is
+-   * wrapped in an <code>InvocationTargetException</code>.
+-   *
+-   * @param args the arguments to the constructor
+-   * @return the newly created object
+-   * @throws IllegalAccessException if the constructor could not normally be
+-   *         called by the Java code (i.e. it is not public)
+-   * @throws IllegalArgumentException if the number of arguments is incorrect;
+-   *         or if the arguments types are wrong even with a widening
+-   *         conversion
+-   * @throws InstantiationException if the class is abstract
+-   * @throws InvocationTargetException if the constructor throws an exception
+-   * @throws ExceptionInInitializerError if construction triggered class
+-   *         initialization, which then failed
+-   */
+-  public T newInstance(Object... args)
+-    throws InstantiationException, IllegalAccessException,
+-           InvocationTargetException
+-  {
+-    return constructNative(args, clazz, slot);
+-  }
+-
+-  private native T constructNative(Object[] args, Class declaringClass,
+-				   int slot)
+-    throws InstantiationException, IllegalAccessException,
+-           InvocationTargetException;
+-
+-  /**
+-   * Returns an array of <code>TypeVariable</code> objects that represents
+-   * the type variables declared by this constructor, in declaration order.
+-   * An array of size zero is returned if this constructor has no type
+-   * variables.
+-   *
+-   * @return the type variables associated with this constructor.
+-   * @throws GenericSignatureFormatError if the generic signature does
+-   *         not conform to the format specified in the Virtual Machine
+-   *         specification, version 3.
+-   * @since 1.5
+-   */
+-  public TypeVariable<Constructor<T>>[] getTypeParameters()
+-  {
+-    String sig = getSignature();
+-    if (sig == null)
+-      return new TypeVariable[0];
+-    MethodSignatureParser p = new MethodSignatureParser(this, sig);
+-    return p.getTypeParameters();
+-  }
+-
+-  /**
+-   * Return the String in the Signature attribute for this constructor. If there
+-   * is no Signature attribute, return null.
+-   */
+-  private native String getSignature();
+-
+-  /**
+-   * Returns an array of <code>Type</code> objects that represents
+-   * the exception types declared by this constructor, in declaration order.
+-   * An array of size zero is returned if this constructor declares no
+-   * exceptions.
+-   *
+-   * @return the exception types declared by this constructor. 
+-   * @throws GenericSignatureFormatError if the generic signature does
+-   *         not conform to the format specified in the Virtual Machine
+-   *         specification, version 3.
+-   * @since 1.5
+-   */
+-  public Type[] getGenericExceptionTypes()
+-  {
+-    String sig = getSignature();
+-    if (sig == null)
+-      return getExceptionTypes();
+-    MethodSignatureParser p = new MethodSignatureParser(this, sig);
+-    return p.getGenericExceptionTypes();
+-  }
+-
+-  /**
+-   * Returns an array of <code>Type</code> objects that represents
+-   * the parameter list for this constructor, in declaration order.
+-   * An array of size zero is returned if this constructor takes no
+-   * parameters.
+-   *
+-   * @return a list of the types of the constructor's parameters
+-   * @throws GenericSignatureFormatError if the generic signature does
+-   *         not conform to the format specified in the Virtual Machine
+-   *         specification, version 3.
+-   * @since 1.5
+-   */
+-  public Type[] getGenericParameterTypes()
+-  {
+-    String sig = getSignature();
+-    if (sig == null)
+-      return getParameterTypes();
+-    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/Field.java
+===================================================================
+RCS file: vm/reference/java/lang/reflect/Field.java
+diff -N vm/reference/java/lang/reflect/Field.java
+--- vm/reference/java/lang/reflect/Field.java	1 Mar 2008 10:13:33 -0000	1.17
++++ /dev/null	1 Jan 1970 00:00:00 -0000
+@@ -1,662 +0,0 @@
+-/* java.lang.reflect.Field - reflection of Java fields
+-   Copyright (C) 1998, 2001, 2005, 2008 Free Software Foundation, Inc.
+-
+-This file is part of GNU Classpath.
+-
+-GNU Classpath is free software; you can redistribute it and/or modify
+-it under the terms of the GNU General Public License as published by
+-the Free Software Foundation; either version 2, or (at your option)
+-any later version.
+- 
+-GNU Classpath is distributed in the hope that it will be useful, but
+-WITHOUT ANY WARRANTY; without even the implied warranty of
+-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+-General Public License for more details.
+-
+-You should have received a copy of the GNU General Public License
+-along with GNU Classpath; see the file COPYING.  If not, write to the
+-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+-02110-1301 USA.
+-
+-Linking this library statically or dynamically with other modules is
+-making a combined work based on this library.  Thus, the terms and
+-conditions of the GNU General Public License cover the whole
+-combination.
+-
+-As a special exception, the copyright holders of this library give you
+-permission to link this library with independent modules to produce an
+-executable, regardless of the license terms of these independent
+-modules, and to copy and distribute the resulting executable under
+-terms of your choice, provided that you also meet, for each linked
+-independent module, the terms and conditions of the license of that
+-module.  An independent module is a module which is not derived from
+-or based on this library.  If you modify this library, you may extend
+-this exception to your version of the library, but you are not
+-obligated to do so.  If you do not wish to do so, delete this
+-exception statement from your version. */
+-
+-
+-package java.lang.reflect;
+-
+-import gnu.java.lang.ClassHelper;
+-import gnu.java.lang.CPStringBuilder;
+-
+-import gnu.java.lang.reflect.FieldSignatureParser;
+-
+-/**
+- * The Field class represents a member variable of a class. It also allows
+- * dynamic access to a member, via reflection. This works for both
+- * static and instance fields. Operations on Field objects know how to
+- * do widening conversions, but throw {@link IllegalArgumentException} if
+- * a narrowing conversion would be necessary. You can query for information
+- * on this Field regardless of location, but get and set access may be limited
+- * by Java language access controls. If you can't do it in the compiler, you
+- * can't normally do it here either.<p>
+- *
+- * <B>Note:</B> This class returns and accepts types as Classes, even
+- * primitive types; there are Class types defined that represent each
+- * different primitive type.  They are <code>java.lang.Boolean.TYPE,
+- * java.lang.Byte.TYPE,</code>, also available as <code>boolean.class,
+- * byte.class</code>, etc.  These are not to be confused with the
+- * classes <code>java.lang.Boolean, java.lang.Byte</code>, etc., which are
+- * real classes.<p>
+- *
+- * Also note that this is not a serializable class.  It is entirely feasible
+- * to make it serializable using the Externalizable interface, but this is
+- * on Sun, not me.
+- *
+- * @author John Keiser
+- * @author Eric Blake <ebb9@email.byu.edu>
+- * @see Member
+- * @see Class
+- * @see Class#getField(String)
+- * @see Class#getDeclaredField(String)
+- * @see Class#getFields()
+- * @see Class#getDeclaredFields()
+- * @since 1.1
+- * @status updated to 1.4
+- */
+-public final class Field
+-extends AccessibleObject implements Member
+-{
+-  private Class declaringClass;
+-  private String name;
+-  private int slot;
+-
+-  private static final int FIELD_MODIFIERS
+-    = Modifier.FINAL | Modifier.PRIVATE | Modifier.PROTECTED
+-      | Modifier.PUBLIC | Modifier.STATIC | Modifier.TRANSIENT
+-      | Modifier.VOLATILE;
+-
+-  /**
+-   * This class is uninstantiable except natively.
+-   */
+-  private Field(Class declaringClass, String name, int slot)
+-  {
+-    this.declaringClass = declaringClass;
+-    this.name = name;
+-    this.slot = slot;
+-  }
+-
+-  /**
+-   * Gets the class that declared this field, or the class where this field
+-   * is a non-inherited member.
+-   * @return the class that declared this member
+-   */
+-  public Class<?> getDeclaringClass()
+-  {
+-    return declaringClass;
+-  }
+-
+-  /**
+-   * Gets the name of this field.
+-   * @return the name of this field
+-   */
+-  public String getName()
+-  {
+-    return name;
+-  }
+-
+-  /**
+-   * Return the raw modifiers for this field.
+-   * @return the field's modifiers
+-   */
+-  private native int getModifiersInternal();
+-
+-  /**
+-   * Gets the modifiers this field uses.  Use the <code>Modifier</code>
+-   * class to interpret the values.  A field can only have a subset of the
+-   * following modifiers: public, private, protected, static, final,
+-   * transient, and volatile.
+-   *
+-   * @return an integer representing the modifiers to this Member
+-   * @see Modifier
+-   */
+-  public int getModifiers()
+-  {
+-    return getModifiersInternal() & FIELD_MODIFIERS;
+-  }
+-
+-  /**
+-   * Return true if this field is synthetic, false otherwise.
+-   * @since 1.5
+-   */
+-  public boolean isSynthetic()
+-  {
+-    return (getModifiersInternal() & Modifier.SYNTHETIC) != 0;
+-  }
+-
+-  /**
+-   * Return true if this field represents an enum constant,
+-   * false otherwise.
+-   * @since 1.5
+-   */
+-  public boolean isEnumConstant()
+-  {
+-    return (getModifiersInternal() & Modifier.ENUM) != 0;
+-  }
+-
+-  /**
+-   * Gets the type of this field.
+-   * @return the type of this field
+-   */
+-  public native Class<?> getType();
+-
+-  /**
+-   * Compare two objects to see if they are semantically equivalent.
+-   * Two Fields are semantically equivalent if they have the same declaring
+-   * class, name, and type. Since you can't creat a Field except through
+-   * the VM, this is just the == relation.
+-   *
+-   * @param o the object to compare to
+-   * @return <code>true</code> if they are equal; <code>false</code> if not
+-   */
+-  public boolean equals(Object o)
+-  {
+-    if (!(o instanceof Field))
+-      return false;
+-    Field that = (Field)o; 
+-    if (this.getDeclaringClass() != that.getDeclaringClass())
+-      return false;
+-    if (!this.getName().equals(that.getName()))
+-      return false;
+-    if (this.getType() != that.getType())
+-      return false;
+-    return true;
+-  }
+-
+-  /**
+-   * Get the hash code for the Field. The Field hash code is the hash code
+-   * of its name XOR'd with the hash code of its class name.
+-   *
+-   * @return the hash code for the object.
+-   */
+-  public int hashCode()
+-  {
+-    return getDeclaringClass().getName().hashCode() ^ getName().hashCode();
+-  }
+-
+-  /**
+-   * Get a String representation of the Field. A Field's String
+-   * representation is "&lt;modifiers&gt; &lt;type&gt;
+-   * &lt;class&gt;.&lt;fieldname&gt;".<br> Example:
+-   * <code>public transient boolean gnu.parse.Parser.parseComplete</code>
+-   *
+-   * @return the String representation of the Field
+-   */
+-  public String toString()
+-  {
+-    // 64 is a reasonable buffer initial size for field
+-    CPStringBuilder sb = new CPStringBuilder(64);
+-    Modifier.toString(getModifiers(), sb).append(' ');
+-    sb.append(ClassHelper.getUserName(getType())).append(' ');
+-    sb.append(getDeclaringClass().getName()).append('.');
+-    sb.append(getName());
+-    return sb.toString();
+-  }
+-
+-  public String toGenericString()
+-  {
+-    CPStringBuilder sb = new CPStringBuilder(64);
+-    Modifier.toString(getModifiers(), sb).append(' ');
+-    sb.append(getGenericType()).append(' ');
+-    sb.append(getDeclaringClass().getName()).append('.');
+-    sb.append(getName());
+-    return sb.toString();
+-  }
+-
+-  /**
+-   * Get the value of this Field.  If it is primitive, it will be wrapped
+-   * in the appropriate wrapper type (boolean = java.lang.Boolean).<p>
+-   *
+-   * If the field is static, <code>o</code> will be ignored. Otherwise, if
+-   * <code>o</code> is null, you get a <code>NullPointerException</code>,
+-   * and if it is incompatible with the declaring class of the field, you
+-   * get an <code>IllegalArgumentException</code>.<p>
+-   *
+-   * Next, if this Field enforces access control, your runtime context is
+-   * evaluated, and you may have an <code>IllegalAccessException</code> if
+-   * you could not access this field in similar compiled code. If the field
+-   * is static, and its class is uninitialized, you trigger class
+-   * initialization, which may end in a
+-   * <code>ExceptionInInitializerError</code>.<p>
+-   *
+-   * Finally, the field is accessed, and primitives are wrapped (but not
+-   * necessarily in new objects). This method accesses the field of the
+-   * declaring class, even if the instance passed in belongs to a subclass
+-   * which declares another field to hide this one.
+-   *
+-   * @param o the object to get the value of this Field from
+-   * @return the value of the Field
+-   * @throws IllegalAccessException if you could not normally access this field
+-   *         (i.e. it is not public)
+-   * @throws IllegalArgumentException if <code>o</code> is not an instance of
+-   *         the class or interface declaring this field
+-   * @throws NullPointerException if <code>o</code> is null and this field
+-   *         requires an instance
+-   * @throws ExceptionInInitializerError if accessing a static field triggered
+-   *         class initialization, which then failed
+-   * @see #getBoolean(Object)
+-   * @see #getByte(Object)
+-   * @see #getChar(Object)
+-   * @see #getShort(Object)
+-   * @see #getInt(Object)
+-   * @see #getLong(Object)
+-   * @see #getFloat(Object)
+-   * @see #getDouble(Object)
+-   */
+-  public native Object get(Object o)
+-    throws IllegalAccessException;
+-
+-  /**
+-   * Get the value of this boolean Field. If the field is static,
+-   * <code>o</code> will be ignored.
+-   *
+-   * @param o the object to get the value of this Field from
+-   * @return the value of the Field
+-   * @throws IllegalAccessException if you could not normally access this field
+-   *         (i.e. it is not public)
+-   * @throws IllegalArgumentException if this is not a boolean field of
+-   *         <code>o</code>, or if <code>o</code> is not an instance of the
+-   *         declaring class of this field
+-   * @throws NullPointerException if <code>o</code> is null and this field
+-   *         requires an instance
+-   * @throws ExceptionInInitializerError if accessing a static field triggered
+-   *         class initialization, which then failed
+-   * @see #get(Object)
+-   */
+-  public native boolean getBoolean(Object o)
+-    throws IllegalAccessException;
+-
+-  /**
+-   * Get the value of this byte Field. If the field is static,
+-   * <code>o</code> will be ignored.
+-   *
+-   * @param o the object to get the value of this Field from
+-   * @return the value of the Field
+-   * @throws IllegalAccessException if you could not normally access this field
+-   *         (i.e. it is not public)
+-   * @throws IllegalArgumentException if this is not a byte field of
+-   *         <code>o</code>, or if <code>o</code> is not an instance of the
+-   *         declaring class of this field
+-   * @throws NullPointerException if <code>o</code> is null and this field
+-   *         requires an instance
+-   * @throws ExceptionInInitializerError if accessing a static field triggered
+-   *         class initialization, which then failed
+-   * @see #get(Object)
+-   */
+-  public native byte getByte(Object o)
+-    throws IllegalAccessException;
+-
+-  /**
+-   * Get the value of this Field as a char. If the field is static,
+-   * <code>o</code> will be ignored.
+-   *
+-   * @throws IllegalAccessException if you could not normally access this field
+-   *         (i.e. it is not public)
+-   * @throws IllegalArgumentException if this is not a char field of
+-   *         <code>o</code>, or if <code>o</code> is not an instance
+-   *         of the declaring class of this field
+-   * @throws NullPointerException if <code>o</code> is null and this field
+-   *         requires an instance
+-   * @throws ExceptionInInitializerError if accessing a static field triggered
+-   *         class initialization, which then failed
+-   * @see #get(Object)
+-   */
+-  public native char getChar(Object o)
+-    throws IllegalAccessException;
+-
+-  /**
+-   * Get the value of this Field as a short. If the field is static,
+-   * <code>o</code> will be ignored.
+-   *
+-   * @param o the object to get the value of this Field from
+-   * @return the value of the Field
+-   * @throws IllegalAccessException if you could not normally access this field
+-   *         (i.e. it is not public)
+-   * @throws IllegalArgumentException if this is not a byte or short
+-   *         field of <code>o</code>, or if <code>o</code> is not an instance
+-   *         of the declaring class of this field
+-   * @throws NullPointerException if <code>o</code> is null and this field
+-   *         requires an instance
+-   * @throws ExceptionInInitializerError if accessing a static field triggered
+-   *         class initialization, which then failed
+-   * @see #get(Object)
+-   */
+-  public native short getShort(Object o)
+-    throws IllegalAccessException;
+-
+-  /**
+-   * Get the value of this Field as an int. If the field is static,
+-   * <code>o</code> will be ignored.
+-   *
+-   * @param o the object to get the value of this Field from
+-   * @return the value of the Field
+-   * @throws IllegalAccessException if you could not normally access this field
+-   *         (i.e. it is not public)
+-   * @throws IllegalArgumentException if this is not a byte, short, char, or
+-   *         int field of <code>o</code>, or if <code>o</code> is not an
+-   *         instance of the declaring class of this field
+-   * @throws NullPointerException if <code>o</code> is null and this field
+-   *         requires an instance
+-   * @throws ExceptionInInitializerError if accessing a static field triggered
+-   *         class initialization, which then failed
+-   * @see #get(Object)
+-   */
+-  public native int getInt(Object o)
+-    throws IllegalAccessException;
+-
+-  /**
+-   * Get the value of this Field as a long. If the field is static,
+-   * <code>o</code> will be ignored.
+-   *
+-   * @param o the object to get the value of this Field from
+-   * @return the value of the Field
+-   * @throws IllegalAccessException if you could not normally access this field
+-   *         (i.e. it is not public)
+-   * @throws IllegalArgumentException if this is not a byte, short, char, int,
+-   *         or long field of <code>o</code>, or if <code>o</code> is not an
+-   *         instance of the declaring class of this field
+-   * @throws NullPointerException if <code>o</code> is null and this field
+-   *         requires an instance
+-   * @throws ExceptionInInitializerError if accessing a static field triggered
+-   *         class initialization, which then failed
+-   * @see #get(Object)
+-   */
+-  public native long getLong(Object o)
+-    throws IllegalAccessException;
+-
+-  /**
+-   * Get the value of this Field as a float. If the field is static,
+-   * <code>o</code> will be ignored.
+-   *
+-   * @param o the object to get the value of this Field from
+-   * @return the value of the Field
+-   * @throws IllegalAccessException if you could not normally access this field
+-   *         (i.e. it is not public)
+-   * @throws IllegalArgumentException if this is not a byte, short, char, int,
+-   *         long, or float field of <code>o</code>, or if <code>o</code> is
+-   *         not an instance of the declaring class of this field
+-   * @throws NullPointerException if <code>o</code> is null and this field
+-   *         requires an instance
+-   * @throws ExceptionInInitializerError if accessing a static field triggered
+-   *         class initialization, which then failed
+-   * @see #get(Object)
+-   */
+-  public native float getFloat(Object o)
+-    throws IllegalAccessException;
+-
+-  /**
+-   * Get the value of this Field as a double. If the field is static,
+-   * <code>o</code> will be ignored.
+-   *
+-   * @param o the object to get the value of this Field from
+-   * @return the value of the Field
+-   * @throws IllegalAccessException if you could not normally access this field
+-   *         (i.e. it is not public)
+-   * @throws IllegalArgumentException if this is not a byte, short, char, int,
+-   *         long, float, or double field of <code>o</code>, or if
+-   *         <code>o</code> is not an instance of the declaring class of this
+-   *         field
+-   * @throws NullPointerException if <code>o</code> is null and this field
+-   *         requires an instance
+-   * @throws ExceptionInInitializerError if accessing a static field triggered
+-   *         class initialization, which then failed
+-   * @see #get(Object)
+-   */
+-  public native double getDouble(Object o)
+-    throws IllegalAccessException;
+-
+-  /**
+-   * Set the value of this Field.  If it is a primitive field, the value
+-   * will be unwrapped from the passed object (boolean = java.lang.Boolean).<p>
+-   *
+-   * If the field is static, <code>o</code> will be ignored. Otherwise, if
+-   * <code>o</code> is null, you get a <code>NullPointerException</code>,
+-   * and if it is incompatible with the declaring class of the field, you
+-   * get an <code>IllegalArgumentException</code>.<p>
+-   *
+-   * Next, if this Field enforces access control, your runtime context is
+-   * evaluated, and you may have an <code>IllegalAccessException</code> if
+-   * you could not access this field in similar compiled code. This also
+-   * occurs whether or not there is access control if the field is final.
+-   * If the field is primitive, and unwrapping your argument fails, you will
+-   * get an <code>IllegalArgumentException</code>; likewise, this error
+-   * happens if <code>value</code> cannot be cast to the correct object type.
+-   * If the field is static, and its class is uninitialized, you trigger class
+-   * initialization, which may end in a
+-   * <code>ExceptionInInitializerError</code>.<p>
+-   *
+-   * Finally, the field is set with the widened value. This method accesses
+-   * the field of the declaring class, even if the instance passed in belongs
+-   * to a subclass which declares another field to hide this one.
+-   *
+-   * @param o the object to set this Field on
+-   * @param value the value to set this Field to
+-   * @throws IllegalAccessException if you could not normally access this field
+-   *         (i.e. it is not public)
+-   * @throws IllegalArgumentException if <code>value</code> cannot be
+-   *         converted by a widening conversion to the underlying type of
+-   *         the Field, or if <code>o</code> is not an instance of the class
+-   *         declaring this field
+-   * @throws NullPointerException if <code>o</code> is null and this field
+-   *         requires an instance
+-   * @throws ExceptionInInitializerError if accessing a static field triggered
+-   *         class initialization, which then failed
+-   * @see #setBoolean(Object, boolean)
+-   * @see #setByte(Object, byte)
+-   * @see #setChar(Object, char)
+-   * @see #setShort(Object, short)
+-   * @see #setInt(Object, int)
+-   * @see #setLong(Object, long)
+-   * @see #setFloat(Object, float)
+-   * @see #setDouble(Object, double)
+-   */
+-  public native void set(Object o, Object value)
+-    throws IllegalAccessException;
+-
+-  /**
+-   * Set this boolean Field. If the field is static, <code>o</code> will be
+-   * ignored.
+-   *
+-   * @param o the object to set this Field on
+-   * @param value the value to set this Field to
+-   * @throws IllegalAccessException if you could not normally access this field
+-   *         (i.e. it is not public)
+-   * @throws IllegalArgumentException if this is not a boolean field, or if
+-   *         <code>o</code> is not an instance of the class declaring this
+-   *         field
+-   * @throws NullPointerException if <code>o</code> is null and this field
+-   *         requires an instance
+-   * @throws ExceptionInInitializerError if accessing a static field triggered
+-   *         class initialization, which then failed
+-   * @see #set(Object, Object)
+-   */
+-  public native void setBoolean(Object o, boolean value)
+-    throws IllegalAccessException;
+-
+-  /**
+-   * Set this byte Field. If the field is static, <code>o</code> will be
+-   * ignored.
+-   *
+-   * @param o the object to set this Field on
+-   * @param value the value to set this Field to
+-   * @throws IllegalAccessException if you could not normally access this field
+-   *         (i.e. it is not public)
+-   * @throws IllegalArgumentException if this is not a byte, short, int, long,
+-   *         float, or double field, or if <code>o</code> is not an instance
+-   *         of the class declaring this field
+-   * @throws NullPointerException if <code>o</code> is null and this field
+-   *         requires an instance
+-   * @throws ExceptionInInitializerError if accessing a static field triggered
+-   *         class initialization, which then failed
+-   * @see #set(Object, Object)
+-   */
+-  public native void setByte(Object o, byte value)
+-    throws IllegalAccessException;
+-
+-  /**
+-   * Set this char Field. If the field is static, <code>o</code> will be
+-   * ignored.
+-   *
+-   * @param o the object to set this Field on
+-   * @param value the value to set this Field to
+-   * @throws IllegalAccessException if you could not normally access this field
+-   *         (i.e. it is not public)
+-   * @throws IllegalArgumentException if this is not a char, int, long,
+-   *         float, or double field, or if <code>o</code> is not an instance
+-   *         of the class declaring this field
+-   * @throws NullPointerException if <code>o</code> is null and this field
+-   *         requires an instance
+-   * @throws ExceptionInInitializerError if accessing a static field triggered
+-   *         class initialization, which then failed
+-   * @see #set(Object, Object)
+-   */
+-  public native void setChar(Object o, char value)
+-    throws IllegalAccessException;
+-
+-  /**
+-   * Set this short Field. If the field is static, <code>o</code> will be
+-   * ignored.
+-   *
+-   * @param o the object to set this Field on
+-   * @param value the value to set this Field to
+-   * @throws IllegalAccessException if you could not normally access this field
+-   *         (i.e. it is not public)
+-   * @throws IllegalArgumentException if this is not a short, int, long,
+-   *         float, or double field, or if <code>o</code> is not an instance
+-   *         of the class declaring this field
+-   * @throws NullPointerException if <code>o</code> is null and this field
+-   *         requires an instance
+-   * @throws ExceptionInInitializerError if accessing a static field triggered
+-   *         class initialization, which then failed
+-   * @see #set(Object, Object)
+-   */
+-  public native void setShort(Object o, short value)
+-    throws IllegalAccessException;
+-
+-  /**
+-   * Set this int Field. If the field is static, <code>o</code> will be
+-   * ignored.
+-   *
+-   * @param o the object to set this Field on
+-   * @param value the value to set this Field to
+-   * @throws IllegalAccessException if you could not normally access this field
+-   *         (i.e. it is not public)
+-   * @throws IllegalArgumentException if this is not an int, long, float, or
+-   *         double field, or if <code>o</code> is not an instance of the
+-   *         class declaring this field
+-   * @throws NullPointerException if <code>o</code> is null and this field
+-   *         requires an instance
+-   * @throws ExceptionInInitializerError if accessing a static field triggered
+-   *         class initialization, which then failed
+-   * @see #set(Object, Object)
+-   */
+-  public native void setInt(Object o, int value)
+-    throws IllegalAccessException;
+-
+-  /**
+-   * Set this long Field. If the field is static, <code>o</code> will be
+-   * ignored.
+-   *
+-   * @param o the object to set this Field on
+-   * @param value the value to set this Field to
+-   * @throws IllegalAccessException if you could not normally access this field
+-   *         (i.e. it is not public)
+-   * @throws IllegalArgumentException if this is not a long, float, or double
+-   *         field, or if <code>o</code> is not an instance of the class
+-   *         declaring this field
+-   * @throws NullPointerException if <code>o</code> is null and this field
+-   *         requires an instance
+-   * @throws ExceptionInInitializerError if accessing a static field triggered
+-   *         class initialization, which then failed
+-   * @see #set(Object, Object)
+-   */
+-  public native void setLong(Object o, long value)
+-    throws IllegalAccessException;
+-
+-  /**
+-   * Set this float Field. If the field is static, <code>o</code> will be
+-   * ignored.
+-   *
+-   * @param o the object to set this Field on
+-   * @param value the value to set this Field to
+-   * @throws IllegalAccessException if you could not normally access this field
+-   *         (i.e. it is not public)
+-   * @throws IllegalArgumentException if this is not a float or long field, or
+-   *         if <code>o</code> is not an instance of the class declaring this
+-   *         field
+-   * @throws NullPointerException if <code>o</code> is null and this field
+-   *         requires an instance
+-   * @throws ExceptionInInitializerError if accessing a static field triggered
+-   *         class initialization, which then failed
+-   * @see #set(Object, Object)
+-   */
+-  public native void setFloat(Object o, float value)
+-    throws IllegalAccessException;
+-
+-  /**
+-   * Set this double Field. If the field is static, <code>o</code> will be
+-   * ignored.
+-   *
+-   * @param o the object to set this Field on
+-   * @param value the value to set this Field to
+-   * @throws IllegalAccessException if you could not normally access this field
+-   *         (i.e. it is not public)
+-   * @throws IllegalArgumentException if this is not a double field, or if
+-   *         <code>o</code> is not an instance of the class declaring this
+-   *         field
+-   * @throws NullPointerException if <code>o</code> is null and this field
+-   *         requires an instance
+-   * @throws ExceptionInInitializerError if accessing a static field triggered
+-   *         class initialization, which then failed
+-   * @see #set(Object, Object)
+-   */
+-  public native void setDouble(Object o, double value)
+-    throws IllegalAccessException;
+-
+-  /**
+-   * Return the generic type of the field. If the field type is not a generic
+-   * type, the method returns the same as <code>getType()</code>.
+-   *
+-   * @throws GenericSignatureFormatError if the generic signature does
+-   *         not conform to the format specified in the Virtual Machine
+-   *         specification, version 3.
+-   * @since 1.5
+-   */
+-  public Type getGenericType()
+-  {
+-    String signature = getSignature();
+-    if (signature == null)
+-      return getType();
+-    FieldSignatureParser p = new FieldSignatureParser(getDeclaringClass(),
+-                                                      signature);
+-    return p.getFieldType();
+-  }
+-
+-  /**
+-   * Return the String in the Signature attribute for this field. If there
+-   * is no Signature attribute, return null.
+-   */
+-  private native String getSignature();
+-}
+Index: vm/reference/java/lang/reflect/Method.java
+===================================================================
+RCS file: vm/reference/java/lang/reflect/Method.java
+diff -N vm/reference/java/lang/reflect/Method.java
+--- vm/reference/java/lang/reflect/Method.java	1 Mar 2008 10:13:33 -0000	1.25
++++ /dev/null	1 Jan 1970 00:00:00 -0000
+@@ -1,490 +0,0 @@
+-/* java.lang.reflect.Method - reflection of Java methods
+-   Copyright (C) 1998, 2001, 2002, 2005, 2007, 2008 Free Software Foundation, Inc.
+-
+-This file is part of GNU Classpath.
+-
+-GNU Classpath is free software; you can redistribute it and/or modify
+-it under the terms of the GNU General Public License as published by
+-the Free Software Foundation; either version 2, or (at your option)
+-any later version.
+- 
+-GNU Classpath is distributed in the hope that it will be useful, but
+-WITHOUT ANY WARRANTY; without even the implied warranty of
+-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+-General Public License for more details.
+-
+-You should have received a copy of the GNU General Public License
+-along with GNU Classpath; see the file COPYING.  If not, write to the
+-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+-02110-1301 USA.
+-
+-Linking this library statically or dynamically with other modules is
+-making a combined work based on this library.  Thus, the terms and
+-conditions of the GNU General Public License cover the whole
+-combination.
+-
+-As a special exception, the copyright holders of this library give you
+-permission to link this library with independent modules to produce an
+-executable, regardless of the license terms of these independent
+-modules, and to copy and distribute the resulting executable under
+-terms of your choice, provided that you also meet, for each linked
+-independent module, the terms and conditions of the license of that
+-module.  An independent module is a module which is not derived from
+-or based on this library.  If you modify this library, you may extend
+-this exception to your version of the library, but you are not
+-obligated to do so.  If you do not wish to do so, delete this
+-exception statement from your version. */
+-
+-
+-package java.lang.reflect;
+-
+-import gnu.java.lang.ClassHelper;
+-import gnu.java.lang.CPStringBuilder;
+-
+-import gnu.java.lang.reflect.MethodSignatureParser;
+-
+-import java.lang.annotation.Annotation;
+-import java.util.Arrays;
+-
+-/**
+- * The Method class represents a member method of a class. It also allows
+- * dynamic invocation, via reflection. This works for both static and
+- * instance methods. Invocation on Method objects knows how to do
+- * widening conversions, but throws {@link IllegalArgumentException} if
+- * a narrowing conversion would be necessary. You can query for information
+- * on this Method regardless of location, but invocation access may be limited
+- * by Java language access controls. If you can't do it in the compiler, you
+- * can't normally do it here either.<p>
+- *
+- * <B>Note:</B> This class returns and accepts types as Classes, even
+- * primitive types; there are Class types defined that represent each
+- * different primitive type.  They are <code>java.lang.Boolean.TYPE,
+- * java.lang.Byte.TYPE,</code>, also available as <code>boolean.class,
+- * byte.class</code>, etc.  These are not to be confused with the
+- * classes <code>java.lang.Boolean, java.lang.Byte</code>, etc., which are
+- * real classes.<p>
+- *
+- * Also note that this is not a serializable class.  It is entirely feasible
+- * to make it serializable using the Externalizable interface, but this is
+- * on Sun, not me.
+- *
+- * @author John Keiser
+- * @author Eric Blake <ebb9@email.byu.edu>
+- * @see Member
+- * @see Class
+- * @see java.lang.Class#getMethod(String,Class[])
+- * @see java.lang.Class#getDeclaredMethod(String,Class[])
+- * @see java.lang.Class#getMethods()
+- * @see java.lang.Class#getDeclaredMethods()
+- * @since 1.1
+- * @status updated to 1.4
+- */
+-public final class Method
+-extends AccessibleObject implements Member, GenericDeclaration
+-{
+-  Class declaringClass;
+-  String name;
+-  int slot;
+-
+-  private static final int METHOD_MODIFIERS
+-    = Modifier.ABSTRACT | Modifier.FINAL | Modifier.NATIVE
+-      | Modifier.PRIVATE | Modifier.PROTECTED | Modifier.PUBLIC
+-      | Modifier.STATIC | Modifier.STRICT | Modifier.SYNCHRONIZED;
+-
+-  /**
+-   * This class is uninstantiable.
+-   */
+-  private Method(Class declaringClass, String name, int slot)
+-  {
+-    this.declaringClass = declaringClass;
+-    this.name = name;
+-    this.slot = slot;
+-  }
+-
+-  /**
+-   * Gets the class that declared this method, or the class where this method
+-   * is a non-inherited member.
+-   * @return the class that declared this member
+-   */
+-  public Class<?> getDeclaringClass()
+-  {
+-    return declaringClass;
+-  }
+-
+-  /**
+-   * Gets the name of this method.
+-   * @return the name of this method
+-   */
+-  public String getName()
+-  {
+-    return name;
+-  }
+-
+-  /**
+-   * Return the raw modifiers for this method.
+-   * @return the method's modifiers
+-   */
+-  private native int getModifiersInternal();
+-
+-  /**
+-   * Gets the modifiers this method uses.  Use the <code>Modifier</code>
+-   * class to interpret the values.  A method can only have a subset of the
+-   * following modifiers: public, private, protected, abstract, static,
+-   * final, synchronized, native, and strictfp.
+-   *
+-   * @return an integer representing the modifiers to this Member
+-   * @see Modifier
+-   */
+-  public int getModifiers()
+-  {
+-    return getModifiersInternal() & METHOD_MODIFIERS;
+-  }
+-
+-  /**
+-   * Return true if this method is a bridge method.  A bridge method
+-   * is generated by the compiler in some situations involving
+-   * generics and inheritance.
+-   * @since 1.5
+-   */
+-  public boolean isBridge()
+-  {
+-    return (getModifiersInternal() & Modifier.BRIDGE) != 0;
+-  }
+-
+-  /**
+-   * Return true if this method is synthetic, false otherwise.
+-   * @since 1.5
+-   */
+-  public boolean isSynthetic()
+-  {
+-    return (getModifiersInternal() & Modifier.SYNTHETIC) != 0;
+-  }
+-
+-  /**
+-   * Return true if this is a varargs method, that is if
+-   * the method takes a variable number of arguments.
+-   * @since 1.5
+-   */
+-  public boolean isVarArgs()
+-  {
+-    return (getModifiersInternal() & Modifier.VARARGS) != 0;
+-  }
+-
+-  /**
+-   * Gets the return type of this method.
+-   * @return the type of this method
+-   */
+-  public native Class<?> getReturnType();
+-
+-  /**
+-   * Get the parameter list for this method, in declaration order. If the
+-   * method takes no parameters, returns a 0-length array (not null).
+-   *
+-   * @return a list of the types of the method's parameters
+-   */
+-  public native Class<?>[] getParameterTypes();
+-
+-  /**
+-   * Get the exception types this method says it throws, in no particular
+-   * order. If the method has no throws clause, returns a 0-length array
+-   * (not null).
+-   *
+-   * @return a list of the types in the method's throws clause
+-   */
+-  public native Class<?>[] getExceptionTypes();
+-
+-  /**
+-   * Compare two objects to see if they are semantically equivalent.
+-   * Two Methods are semantically equivalent if they have the same declaring
+-   * class, name, parameter list, and return type.
+-   *
+-   * @param o the object to compare to
+-   * @return <code>true</code> if they are equal; <code>false</code> if not
+-   */
+-  public boolean equals(Object o)
+-  {
+-      // Implementation note:
+-      // The following is a correct but possibly slow implementation.
+-      //
+-      // This class has a private field 'slot' that could be used by
+-      // the VM implementation to "link" a particular method to a Class.
+-      // In that case equals could be simply implemented as:
+-      //
+-      // if (o instanceof Method)
+-      // {
+-      //    Method m = (Method)o;
+-      //    return m.declaringClass == this.declaringClass
+-      //           && m.slot == this.slot;
+-      // }
+-      // return false;
+-      //
+-      // If a VM uses the Method class as their native/internal representation
+-      // then just using the following would be optimal:
+-      //
+-      // return this == o;
+-      //
+-    if (!(o instanceof Method))
+-      return false;
+-    Method that = (Method)o;
+-    if (this.getDeclaringClass() != that.getDeclaringClass())
+-      return false;
+-    if (!this.getName().equals(that.getName()))
+-      return false;
+-    if (this.getReturnType() != that.getReturnType())
+-      return false;
+-    if (!Arrays.equals(this.getParameterTypes(), that.getParameterTypes()))
+-      return false;
+-    return true;
+-  }
+-
+-  /**
+-   * Get the hash code for the Method. The Method hash code is the hash code
+-   * of its name XOR'd with the hash code of its class name.
+-   *
+-   * @return the hash code for the object
+-   */
+-  public int hashCode()
+-  {
+-    return getDeclaringClass().getName().hashCode() ^ getName().hashCode();
+-  }
+-
+-  /**
+-   * Get a String representation of the Method. A Method's String
+-   * representation is "&lt;modifiers&gt; &lt;returntype&gt;
+-   * &lt;methodname&gt;(&lt;paramtypes&gt;) throws &lt;exceptions&gt;", where
+-   * everything after ')' is omitted if there are no exceptions.<br> Example:
+-   * <code>public static int run(java.lang.Runnable,int)</code>
+-   *
+-   * @return the String representation of the Method
+-   */
+-  public String toString()
+-  {
+-    // 128 is a reasonable buffer initial size for constructor
+-    CPStringBuilder sb = new CPStringBuilder(128);
+-    Modifier.toString(getModifiers(), sb).append(' ');
+-    sb.append(ClassHelper.getUserName(getReturnType())).append(' ');
+-    sb.append(getDeclaringClass().getName()).append('.');
+-    sb.append(getName()).append('(');
+-    Class[] c = getParameterTypes();
+-    if (c.length > 0)
+-      {
+-        sb.append(ClassHelper.getUserName(c[0]));
+-        for (int i = 1; i < c.length; i++)
+-          sb.append(',').append(ClassHelper.getUserName(c[i]));
+-      }
+-    sb.append(')');
+-    c = getExceptionTypes();
+-    if (c.length > 0)
+-      {
+-        sb.append(" throws ").append(c[0].getName());
+-        for (int i = 1; i < c.length; i++)
+-          sb.append(',').append(c[i].getName());
+-      }
+-    return sb.toString();
+-  }
+-
+-  public String toGenericString()
+-  {
+-    // 128 is a reasonable buffer initial size for constructor
+-    CPStringBuilder sb = new CPStringBuilder(128);
+-    Modifier.toString(getModifiers(), sb).append(' ');
+-    Constructor.addTypeParameters(sb, getTypeParameters());
+-    sb.append(getGenericReturnType()).append(' ');
+-    sb.append(getDeclaringClass().getName()).append('.');
+-    sb.append(getName()).append('(');
+-    Type[] types = getGenericParameterTypes();
+-    if (types.length > 0)
+-      {
+-        sb.append(types[0]);
+-        for (int i = 1; i < types.length; i++)
+-          sb.append(',').append(types[i]);
+-      }
+-    sb.append(')');
+-    types = getGenericExceptionTypes();
+-    if (types.length > 0)
+-      {
+-        sb.append(" throws ").append(types[0]);
+-        for (int i = 1; i < types.length; i++)
+-          sb.append(',').append(types[i]);
+-      }
+-    return sb.toString();
+-  }
+-
+-  /**
+-   * Invoke the method. Arguments are automatically unwrapped and widened,
+-   * and the result is automatically wrapped, if needed.<p>
+-   *
+-   * If the method is static, <code>o</code> will be ignored. Otherwise,
+-   * the method uses dynamic lookup as described in JLS 15.12.4.4. You cannot
+-   * mimic the behavior of nonvirtual lookup (as in super.foo()). This means
+-   * you will get a <code>NullPointerException</code> if <code>o</code> is
+-   * null, and an <code>IllegalArgumentException</code> if it is incompatible
+-   * with the declaring class of the method. If the method takes 0 arguments,
+-   * you may use null or a 0-length array for <code>args</code>.<p>
+-   *
+-   * Next, if this Method enforces access control, your runtime context is
+-   * evaluated, and you may have an <code>IllegalAccessException</code> if
+-   * you could not acces this method in similar compiled code. If the method
+-   * is static, and its class is uninitialized, you trigger class
+-   * initialization, which may end in a
+-   * <code>ExceptionInInitializerError</code>.<p>
+-   *
+-   * Finally, the method is invoked. If it completes normally, the return value
+-   * will be null for a void method, a wrapped object for a primitive return
+-   * method, or the actual return of an Object method. If it completes
+-   * abruptly, the exception is wrapped in an
+-   * <code>InvocationTargetException</code>.
+-   *
+-   * @param o the object to invoke the method on
+-   * @param args the arguments to the method
+-   * @return the return value of the method, wrapped in the appropriate
+-   *         wrapper if it is primitive
+-   * @throws IllegalAccessException if the method could not normally be called
+-   *         by the Java code (i.e. it is not public)
+-   * @throws IllegalArgumentException if the number of arguments is incorrect;
+-   *         if the arguments types are wrong even with a widening conversion;
+-   *         or if <code>o</code> is not an instance of the class or interface
+-   *         declaring this method
+-   * @throws InvocationTargetException if the method throws an exception
+-   * @throws NullPointerException if <code>o</code> is null and this field
+-   *         requires an instance
+-   * @throws ExceptionInInitializerError if accessing a static method triggered
+-   *         class initialization, which then failed
+-   */
+-  public Object invoke(Object o, Object... args)
+-    throws IllegalAccessException, InvocationTargetException
+-  {
+-    return invokeNative(o, args, declaringClass, slot);
+-  }
+-
+-  /*
+-   * NATIVE HELPERS
+-   */
+-
+-  private native Object invokeNative(Object o, Object[] args,
+-                                     Class declaringClass, int slot)
+-    throws IllegalAccessException, InvocationTargetException;
+-
+-  /**
+-   * Returns an array of <code>TypeVariable</code> objects that represents
+-   * the type variables declared by this constructor, in declaration order.
+-   * An array of size zero is returned if this class has no type
+-   * variables.
+-   *
+-   * @return the type variables associated with this class. 
+-   * @throws GenericSignatureFormatError if the generic signature does
+-   *         not conform to the format specified in the Virtual Machine
+-   *         specification, version 3.
+-   * @since 1.5
+-   */
+-  public TypeVariable<Method>[] getTypeParameters()
+-  {
+-    String sig = getSignature();
+-    if (sig == null)
+-      return new TypeVariable[0];
+-    MethodSignatureParser p = new MethodSignatureParser(this, sig);
+-    return p.getTypeParameters();
+-  }
+-
+-  /**
+-   * Return the String in the Signature attribute for this method. If there
+-   * is no Signature attribute, return null.
+-   */
+-  private native String getSignature();
+-
+-  /**
+-   * Returns an array of <code>Type</code> objects that represents
+-   * the exception types declared by this method, in declaration order.
+-   * An array of size zero is returned if this method declares no
+-   * exceptions.
+-   *
+-   * @return the exception types declared by this method. 
+-   * @throws GenericSignatureFormatError if the generic signature does
+-   *         not conform to the format specified in the Virtual Machine
+-   *         specification, version 3.
+-   * @since 1.5
+-   */
+-  public Type[] getGenericExceptionTypes()
+-  {
+-    String sig = getSignature();
+-    if (sig == null)
+-      return getExceptionTypes();
+-    MethodSignatureParser p = new MethodSignatureParser(this, sig);
+-    return p.getGenericExceptionTypes();
+-  }
+-
+-  /**
+-   * Returns an array of <code>Type</code> objects that represents
+-   * the parameter list for this method, in declaration order.
+-   * An array of size zero is returned if this method takes no
+-   * parameters.
+-   *
+-   * @return a list of the types of the method's parameters
+-   * @throws GenericSignatureFormatError if the generic signature does
+-   *         not conform to the format specified in the Virtual Machine
+-   *         specification, version 3.
+-   * @since 1.5
+-   */
+-  public Type[] getGenericParameterTypes()
+-  {
+-    String sig = getSignature();
+-    if (sig == null)
+-      return getParameterTypes();
+-    MethodSignatureParser p = new MethodSignatureParser(this, sig);
+-    return p.getGenericParameterTypes();
+-  }
+-
+-  /**
+-   * Returns the return type of this method.
+-   *
+-   * @return the return type of this method
+-   * @throws GenericSignatureFormatError if the generic signature does
+-   *         not conform to the format specified in the Virtual Machine
+-   *         specification, version 3.
+-   * @since 1.5
+-   */
+-  public Type getGenericReturnType()
+-  {
+-    String sig = getSignature();
+-    if (sig == null)
+-      return getReturnType();
+-    MethodSignatureParser p = new MethodSignatureParser(this, sig);
+-    return p.getGenericReturnType();
+-  }
+-
+-  /**
+-   * If this method is an annotation method, returns the default
+-   * value for the method.  If there is no default value, or if the
+-   * method is not a member of an annotation type, returns null.
+-   * Primitive types are wrapped.
+-   *
+-   * @throws TypeNotPresentException if the method returns a Class,
+-   * and the class cannot be found
+-   *
+-   * @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();
+-
+-}
+Index: vm/reference/java/lang/reflect/VMConstructor.java
+===================================================================
+RCS file: vm/reference/java/lang/reflect/VMConstructor.java
+diff -N vm/reference/java/lang/reflect/VMConstructor.java
+--- /dev/null	1 Jan 1970 00:00:00 -0000
++++ vm/reference/java/lang/reflect/VMConstructor.java	2 Mar 2008 02:03:58 -0000
+@@ -0,0 +1,107 @@
++/* java.lang.reflect.VMConstructor - VM interface for reflection of Java constructors
++   Copyright (C) 1998, 2001, 2004, 2005 Free Software Foundation, Inc.
++
++This file is part of GNU Classpath.
++
++GNU Classpath is free software; you can redistribute it and/or modify
++it under the terms of the GNU General Public License as published by
++the Free Software Foundation; either version 2, or (at your option)
++any later version.
++ 
++GNU Classpath is distributed in the hope that it will be useful, but
++WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with GNU Classpath; see the file COPYING.  If not, write to the
++Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
++02110-1301 USA.
++
++Linking this library statically or dynamically with other modules is
++making a combined work based on this library.  Thus, the terms and
++conditions of the GNU General Public License cover the whole
++combination.
++
++As a special exception, the copyright holders of this library give you
++permission to link this library with independent modules to produce an
++executable, regardless of the license terms of these independent
++modules, and to copy and distribute the resulting executable under
++terms of your choice, provided that you also meet, for each linked
++independent module, the terms and conditions of the license of that
++module.  An independent module is a module which is not derived from
++or based on this library.  If you modify this library, you may extend
++this exception to your version of the library, but you are not
++obligated to do so.  If you do not wish to do so, delete this
++exception statement from your version. */
++
++
++package java.lang.reflect;
++
++import java.lang.annotation.Annotation;
++
++final class VMConstructor
++{
++  /**
++   * Return the raw modifiers for this constructor.  In particular
++   * this will include the synthetic and varargs bits.
++   * @param c the constructor concerned.
++   * @return the constructor's modifiers
++   */
++  static native int getModifiersInternal(Constructor c);
++
++  /**
++   * Get the parameter list for this constructor, in declaration order. If the
++   * constructor takes no parameters, returns a 0-length array (not null).
++   *
++   * @param c the constructor concerned.
++   * @return a list of the types of the constructor's parameters
++   */
++  static native Class[] getParameterTypes(Constructor c);
++
++  /**
++   * Get the exception types this constructor says it throws, in no particular
++   * order. If the constructor has no throws clause, returns a 0-length array
++   * (not null).
++   *
++   * @param c the constructor concerned.
++   * @return a list of the types in the constructor's throws clause
++   */
++  static native Class[] getExceptionTypes(Constructor c);
++
++  static native Object constructNative(Object[] args, Class declaringClass,
++				       int slot)
++    throws InstantiationException, IllegalAccessException,
++    InvocationTargetException;
++
++  /**
++   * Return the String in the Signature attribute for this constructor. If there
++   * is no Signature attribute, return null.
++   * @param c the constructor concerned.
++   */
++  static native String getSignature(Constructor c);
++  
++  /**
++   * <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>
++   * 
++   * @param c the constructor concerned.
++   * @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
++   */
++  static native Annotation[][] getParameterAnnotations(Constructor c);
++
++}
+Index: vm/reference/java/lang/reflect/VMField.java
+===================================================================
+RCS file: vm/reference/java/lang/reflect/VMField.java
+diff -N vm/reference/java/lang/reflect/VMField.java
+--- /dev/null	1 Jan 1970 00:00:00 -0000
++++ vm/reference/java/lang/reflect/VMField.java	2 Mar 2008 02:03:58 -0000
+@@ -0,0 +1,495 @@
++/* java.lang.reflect.Field - VM interface for reflection of Java fields
++   Copyright (C) 1998, 2001, 2005, 2008 Free Software Foundation, Inc.
++
++This file is part of GNU Classpath.
++
++GNU Classpath is free software; you can redistribute it and/or modify
++it under the terms of the GNU General Public License as published by
++the Free Software Foundation; either version 2, or (at your option)
++any later version.
++ 
++GNU Classpath is distributed in the hope that it will be useful, but
++WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with GNU Classpath; see the file COPYING.  If not, write to the
++Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
++02110-1301 USA.
++
++Linking this library statically or dynamically with other modules is
++making a combined work based on this library.  Thus, the terms and
++conditions of the GNU General Public License cover the whole
++combination.
++
++As a special exception, the copyright holders of this library give you
++permission to link this library with independent modules to produce an
++executable, regardless of the license terms of these independent
++modules, and to copy and distribute the resulting executable under
++terms of your choice, provided that you also meet, for each linked
++independent module, the terms and conditions of the license of that
++module.  An independent module is a module which is not derived from
++or based on this library.  If you modify this library, you may extend
++this exception to your version of the library, but you are not
++obligated to do so.  If you do not wish to do so, delete this
++exception statement from your version. */
++
++
++package java.lang.reflect;
++
++final class VMField
++{
++
++  /**
++   * Return the raw modifiers for this field.
++   * @param f the field concerned.
++   * @return the field's modifiers
++   */
++  static native int getModifiersInternal(Field f);
++
++  /**
++   * Gets the type of this field.
++   * @param f the field concerned.
++   * @return the type of this field
++   */
++  static native Class getType(Field f);
++
++  /**
++   * Get the value of this Field.  If it is primitive, it will be wrapped
++   * in the appropriate wrapper type (boolean = java.lang.Boolean).<p>
++   *
++   * If the field is static, <code>o</code> will be ignored. Otherwise, if
++   * <code>o</code> is null, you get a <code>NullPointerException</code>,
++   * and if it is incompatible with the declaring class of the field, you
++   * get an <code>IllegalArgumentException</code>.<p>
++   *
++   * Next, if this Field enforces access control, your runtime context is
++   * evaluated, and you may have an <code>IllegalAccessException</code> if
++   * you could not access this field in similar compiled code. If the field
++   * is static, and its class is uninitialized, you trigger class
++   * initialization, which may end in a
++   * <code>ExceptionInInitializerError</code>.<p>
++   *
++   * Finally, the field is accessed, and primitives are wrapped (but not
++   * necessarily in new objects). This method accesses the field of the
++   * declaring class, even if the instance passed in belongs to a subclass
++   * which declares another field to hide this one.
++   *
++   * @param f the field concerned.
++   * @param o the object to get the value of this Field from
++   * @return the value of the Field
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if <code>o</code> is not an instance of
++   *         the class or interface declaring this field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #getBoolean(Object)
++   * @see #getByte(Object)
++   * @see #getChar(Object)
++   * @see #getShort(Object)
++   * @see #getInt(Object)
++   * @see #getLong(Object)
++   * @see #getFloat(Object)
++   * @see #getDouble(Object)
++   */
++  static native Object get(Field f, Object o)
++    throws IllegalAccessException;
++
++  /**
++   * Get the value of this boolean Field. If the field is static,
++   * <code>o</code> will be ignored.
++   *
++   * @param f the field concerned.
++   * @param o the object to get the value of this Field from
++   * @return the value of the Field
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if this is not a boolean field of
++   *         <code>o</code>, or if <code>o</code> is not an instance of the
++   *         declaring class of this field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #get(Object)
++   */
++  static native boolean getBoolean(Field f, Object o)
++    throws IllegalAccessException;
++
++  /**
++   * Get the value of this byte Field. If the field is static,
++   * <code>o</code> will be ignored.
++   *
++   * @param f the field concerned.
++   * @param o the object to get the value of this Field from
++   * @return the value of the Field
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if this is not a byte field of
++   *         <code>o</code>, or if <code>o</code> is not an instance of the
++   *         declaring class of this field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #get(Object)
++   */
++  static native byte getByte(Field f, Object o)
++    throws IllegalAccessException;
++
++  /**
++   * Get the value of this Field as a char. If the field is static,
++   * <code>o</code> will be ignored.
++   *
++   * @param f the field concerned.
++   * @param o the object to get the value of this Field from
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if this is not a char field of
++   *         <code>o</code>, or if <code>o</code> is not an instance
++   *         of the declaring class of this field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #get(Object)
++   */
++  static native char getChar(Field f, Object o)
++    throws IllegalAccessException;
++
++  /**
++   * Get the value of this Field as a short. If the field is static,
++   * <code>o</code> will be ignored.
++   *
++   * @param f the field concerned.
++   * @param o the object to get the value of this Field from
++   * @return the value of the Field
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if this is not a byte or short
++   *         field of <code>o</code>, or if <code>o</code> is not an instance
++   *         of the declaring class of this field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #get(Object)
++   */
++  static native short getShort(Field f, Object o)
++    throws IllegalAccessException;
++
++  /**
++   * Get the value of this Field as an int. If the field is static,
++   * <code>o</code> will be ignored.
++   *
++   * @param f the field concerned.
++   * @param o the object to get the value of this Field from
++   * @return the value of the Field
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if this is not a byte, short, char, or
++   *         int field of <code>o</code>, or if <code>o</code> is not an
++   *         instance of the declaring class of this field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #get(Object)
++   */
++  static native int getInt(Field f, Object o)
++    throws IllegalAccessException;
++
++  /**
++   * Get the value of this Field as a long. If the field is static,
++   * <code>o</code> will be ignored.
++   *
++   * @param f the field concerned.
++   * @param o the object to get the value of this Field from
++   * @return the value of the Field
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if this is not a byte, short, char, int,
++   *         or long field of <code>o</code>, or if <code>o</code> is not an
++   *         instance of the declaring class of this field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #get(Object)
++   */
++  static native long getLong(Field f, Object o)
++    throws IllegalAccessException;
++
++  /**
++   * Get the value of this Field as a float. If the field is static,
++   * <code>o</code> will be ignored.
++   *
++   * @param f the field concerned.
++   * @param o the object to get the value of this Field from
++   * @return the value of the Field
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if this is not a byte, short, char, int,
++   *         long, or float field of <code>o</code>, or if <code>o</code> is
++   *         not an instance of the declaring class of this field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #get(Object)
++   */
++  static native float getFloat(Field f, Object o)
++    throws IllegalAccessException;
++
++  /**
++   * Get the value of this Field as a double. If the field is static,
++   * <code>o</code> will be ignored.
++   *
++   * @param f the field concerned.
++   * @param o the object to get the value of this Field from
++   * @return the value of the Field
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if this is not a byte, short, char, int,
++   *         long, float, or double field of <code>o</code>, or if
++   *         <code>o</code> is not an instance of the declaring class of this
++   *         field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #get(Object)
++   */
++  static native double getDouble(Field f, Object o)
++    throws IllegalAccessException;
++
++  /**
++   * Set the value of this Field.  If it is a primitive field, the value
++   * will be unwrapped from the passed object (boolean = java.lang.Boolean).<p>
++   *
++   * If the field is static, <code>o</code> will be ignored. Otherwise, if
++   * <code>o</code> is null, you get a <code>NullPointerException</code>,
++   * and if it is incompatible with the declaring class of the field, you
++   * get an <code>IllegalArgumentException</code>.<p>
++   *
++   * Next, if this Field enforces access control, your runtime context is
++   * evaluated, and you may have an <code>IllegalAccessException</code> if
++   * you could not access this field in similar compiled code. This also
++   * occurs whether or not there is access control if the field is final.
++   * If the field is primitive, and unwrapping your argument fails, you will
++   * get an <code>IllegalArgumentException</code>; likewise, this error
++   * happens if <code>value</code> cannot be cast to the correct object type.
++   * If the field is static, and its class is uninitialized, you trigger class
++   * initialization, which may end in a
++   * <code>ExceptionInInitializerError</code>.<p>
++   *
++   * Finally, the field is set with the widened value. This method accesses
++   * the field of the declaring class, even if the instance passed in belongs
++   * to a subclass which declares another field to hide this one.
++   *
++   * @param f the field concerned.
++   * @param o the object to set this Field on
++   * @param value the value to set this Field to
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if <code>value</code> cannot be
++   *         converted by a widening conversion to the underlying type of
++   *         the Field, or if <code>o</code> is not an instance of the class
++   *         declaring this field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #setBoolean(Object, boolean)
++   * @see #setByte(Object, byte)
++   * @see #setChar(Object, char)
++   * @see #setShort(Object, short)
++   * @see #setInt(Object, int)
++   * @see #setLong(Object, long)
++   * @see #setFloat(Object, float)
++   * @see #setDouble(Object, double)
++   */
++  static native void set(Field f, Object o, Object value)
++    throws IllegalAccessException;
++
++  /**
++   * Set this boolean Field. If the field is static, <code>o</code> will be
++   * ignored.
++   *
++   * @param f the field concerned.
++   * @param o the object to set this Field on
++   * @param value the value to set this Field to
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if this is not a boolean field, or if
++   *         <code>o</code> is not an instance of the class declaring this
++   *         field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #set(Object, Object)
++   */
++  static native void setBoolean(Field f, Object o, boolean value)
++    throws IllegalAccessException;
++
++  /**
++   * Set this byte Field. If the field is static, <code>o</code> will be
++   * ignored.
++   *
++   * @param f the field concerned.
++   * @param o the object to set this Field on
++   * @param value the value to set this Field to
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if this is not a byte, short, int, long,
++   *         float, or double field, or if <code>o</code> is not an instance
++   *         of the class declaring this field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #set(Object, Object)
++   */
++  static native void setByte(Field f, Object o, byte value)
++    throws IllegalAccessException;
++
++  /**
++   * Set this char Field. If the field is static, <code>o</code> will be
++   * ignored.
++   *
++   * @param f the field concerned.
++   * @param o the object to set this Field on
++   * @param value the value to set this Field to
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if this is not a char, int, long,
++   *         float, or double field, or if <code>o</code> is not an instance
++   *         of the class declaring this field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #set(Object, Object)
++   */
++  static native void setChar(Field f, Object o, char value)
++    throws IllegalAccessException;
++
++  /**
++   * Set this short Field. If the field is static, <code>o</code> will be
++   * ignored.
++   *
++   * @param f the field concerned.
++   * @param o the object to set this Field on
++   * @param value the value to set this Field to
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if this is not a short, int, long,
++   *         float, or double field, or if <code>o</code> is not an instance
++   *         of the class declaring this field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #set(Object, Object)
++   */
++  static native void setShort(Field f, Object o, short value)
++    throws IllegalAccessException;
++
++  /**
++   * Set this int Field. If the field is static, <code>o</code> will be
++   * ignored.
++   *
++   * @param f the field concerned.
++   * @param o the object to set this Field on
++   * @param value the value to set this Field to
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if this is not an int, long, float, or
++   *         double field, or if <code>o</code> is not an instance of the
++   *         class declaring this field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #set(Object, Object)
++   */
++  static native void setInt(Field f, Object o, int value)
++    throws IllegalAccessException;
++
++  /**
++   * Set this long Field. If the field is static, <code>o</code> will be
++   * ignored.
++   *
++   * @param f the field concerned.
++   * @param o the object to set this Field on
++   * @param value the value to set this Field to
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if this is not a long, float, or double
++   *         field, or if <code>o</code> is not an instance of the class
++   *         declaring this field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #set(Object, Object)
++   */
++  static native void setLong(Field f, Object o, long value)
++    throws IllegalAccessException;
++
++  /**
++   * Set this float Field. If the field is static, <code>o</code> will be
++   * ignored.
++   *
++   * @param f the field concerned.
++   * @param o the object to set this Field on
++   * @param value the value to set this Field to
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if this is not a float or long field, or
++   *         if <code>o</code> is not an instance of the class declaring this
++   *         field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #set(Object, Object)
++   */
++  static native void setFloat(Field f, Object o, float value)
++    throws IllegalAccessException;
++
++  /**
++   * Set this double Field. If the field is static, <code>o</code> will be
++   * ignored.
++   *
++   * @param f the field concerned.
++   * @param o the object to set this Field on
++   * @param value the value to set this Field to
++   * @throws IllegalAccessException if you could not normally access this field
++   *         (i.e. it is not public)
++   * @throws IllegalArgumentException if this is not a double field, or if
++   *         <code>o</code> is not an instance of the class declaring this
++   *         field
++   * @throws NullPointerException if <code>o</code> is null and this field
++   *         requires an instance
++   * @throws ExceptionInInitializerError if accessing a static field triggered
++   *         class initialization, which then failed
++   * @see #set(Object, Object)
++   */
++  static native void setDouble(Field f, Object o, double value)
++    throws IllegalAccessException;
++
++  /**
++   * Return the String in the Signature attribute for this field. If there
++   * is no Signature attribute, return null.
++   *
++   * @param f the field concerned.
++   */
++  static native String getSignature(Field f);
++
++}
+Index: vm/reference/java/lang/reflect/VMMethod.java
+===================================================================
+RCS file: vm/reference/java/lang/reflect/VMMethod.java
+diff -N vm/reference/java/lang/reflect/VMMethod.java
+--- /dev/null	1 Jan 1970 00:00:00 -0000
++++ vm/reference/java/lang/reflect/VMMethod.java	2 Mar 2008 02:03:58 -0000
+@@ -0,0 +1,127 @@
++/* java.lang.reflect.VMMethod - VM interface for reflection of Java methods
++   Copyright (C) 1998, 2001, 2002, 2005, 2007, 2008 Free Software Foundation, Inc.
++
++This file is part of GNU Classpath.
++
++GNU Classpath is free software; you can redistribute it and/or modify
++it under the terms of the GNU General Public License as published by
++the Free Software Foundation; either version 2, or (at your option)
++any later version.
++ 
++GNU Classpath is distributed in the hope that it will be useful, but
++WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with GNU Classpath; see the file COPYING.  If not, write to the
++Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
++02110-1301 USA.
++
++Linking this library statically or dynamically with other modules is
++making a combined work based on this library.  Thus, the terms and
++conditions of the GNU General Public License cover the whole
++combination.
++
++As a special exception, the copyright holders of this library give you
++permission to link this library with independent modules to produce an
++executable, regardless of the license terms of these independent
++modules, and to copy and distribute the resulting executable under
++terms of your choice, provided that you also meet, for each linked
++independent module, the terms and conditions of the license of that
++module.  An independent module is a module which is not derived from
++or based on this library.  If you modify this library, you may extend
++this exception to your version of the library, but you are not
++obligated to do so.  If you do not wish to do so, delete this
++exception statement from your version. */
++
++
++package java.lang.reflect;
++
++import java.lang.annotation.Annotation;
++
++final class VMMethod
++{
++  /**
++   * Return the raw modifiers for this method.
++   * @param m the method concerned.
++   * @return the method's modifiers
++   */
++  static native int getModifiersInternal(Method m);
++
++  /**
++   * Gets the return type of this method.
++   * @param m the method concerned.
++   * @return the type of this method
++   */
++  static native Class getReturnType(Method m);
++
++  /**
++   * Get the parameter list for this method, in declaration order. If the
++   * method takes no parameters, returns a 0-length array (not null).
++   *
++   * @param m the method concerned.
++   * @return a list of the types of the method's parameters
++   */
++  static native Class[] getParameterTypes(Method m);
++
++  /**
++   * Get the exception types this method says it throws, in no particular
++   * order. If the method has no throws clause, returns a 0-length array
++   * (not null).
++   *
++   * @param m the method concerned.
++   * @return a list of the types in the method's throws clause
++   */
++  static native Class[] getExceptionTypes(Method m);
++
++  static native Object invokeNative(Object o, Object[] args,
++				    Class declaringClass, int slot)
++    throws IllegalAccessException, InvocationTargetException;
++
++  /**
++   * Return the String in the Signature attribute for this method. If there
++   * is no Signature attribute, return null.
++   * @param m the method concerned.
++   */
++  static native String getSignature(Method m);
++
++  /**
++   * If this method is an annotation method, returns the default
++   * value for the method.  If there is no default value, or if the
++   * method is not a member of an annotation type, returns null.
++   * Primitive types are wrapped.
++   *
++   * @param m the method concerned.
++   * @throws TypeNotPresentException if the method returns a Class,
++   * and the class cannot be found
++   *
++   * @since 1.5
++   */
++  static native Object getDefaultValue(Method m);
++
++  /**
++   * <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>
++   * 
++   * @param m the method concerned.
++   * @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
++   */
++  static native Annotation[][] getParameterAnnotations(Method m);
++
++}
++
Index: build/components/patches/classpath-web.RVM-385-02.patch
===================================================================
--- build/components/patches/classpath-web.RVM-385-02.patch	(revision 0)
+++ build/components/patches/classpath-web.RVM-385-02.patch	(revision 0)
@@ -0,0 +1,1352 @@
+Index: java/lang/reflect/Constructor.java
+===================================================================
+RCS file: /sources/classpath/classpath/java/lang/reflect/Constructor.java,v
+retrieving revision 1.6
+diff -u -3 -p -u -r1.6 Constructor.java
+--- java/lang/reflect/Constructor.java	3 Mar 2008 18:59:10 -0000	1.6
++++ java/lang/reflect/Constructor.java	3 Mar 2008 21:15:40 -0000
+@@ -44,7 +44,6 @@ import gnu.java.lang.CPStringBuilder;
+ import gnu.java.lang.reflect.MethodSignatureParser;
+ 
+ import java.lang.annotation.Annotation;
+-import java.util.Arrays;
+ 
+ /**
+  * The Constructor class represents a constructor of a class. It also allows
+@@ -82,22 +81,20 @@ import java.util.Arrays;
+ public final class Constructor<T>
+   extends AccessibleObject
+   implements GenericDeclaration, Member
+-{
+-  Class<T> clazz;
+-  int slot;
+-  
+-  static final int CONSTRUCTOR_MODIFIERS
++{  
++  private static final int CONSTRUCTOR_MODIFIERS
+     = Modifier.PRIVATE | Modifier.PROTECTED | Modifier.PUBLIC;
+ 
+   private MethodSignatureParser p;
+ 
++  private VMConstructor cons;
++
+   /**
+    * This class is uninstantiable outside this package.
+    */
+-  Constructor(Class<T> declaringClass,int slot)
++  Constructor(VMConstructor cons)
+   {
+-    this.clazz = declaringClass;
+-    this.slot = slot;
++    this.cons = cons;
+   }
+ 
+   private Constructor()
+@@ -108,9 +105,10 @@ public final class Constructor<T>
+    * Gets the class that declared this constructor.
+    * @return the class that declared this member
+    */
++  @SuppressWarnings("unchecked")
+   public Class<T> getDeclaringClass()
+   {
+-    return clazz;
++    return (Class<T>) cons.getDeclaringClass();
+   }
+ 
+   /**
+@@ -120,7 +118,7 @@ public final class Constructor<T>
+    */
+   public String getName()
+   {
+-    return getDeclaringClass().getName();
++    return cons.getDeclaringClass().getName();
+   }
+ 
+   /**
+@@ -133,7 +131,7 @@ public final class Constructor<T>
+    */
+   public int getModifiers()
+   {
+-    return VMConstructor.getModifiersInternal(this) & CONSTRUCTOR_MODIFIERS;
++    return cons.getModifiersInternal() & CONSTRUCTOR_MODIFIERS;
+   }
+ 
+   /**
+@@ -144,7 +142,7 @@ public final class Constructor<T>
+    */
+   public boolean isSynthetic()
+   {
+-    return (VMConstructor.getModifiersInternal(this) & Modifier.SYNTHETIC) != 0;
++    return (cons.getModifiersInternal() & Modifier.SYNTHETIC) != 0;
+   }
+ 
+   /**
+@@ -154,7 +152,7 @@ public final class Constructor<T>
+    */
+   public boolean isVarArgs()
+   {
+-    return (VMConstructor.getModifiersInternal(this) & Modifier.VARARGS) != 0;
++    return (cons.getModifiersInternal() & Modifier.VARARGS) != 0;
+   }
+ 
+   /**
+@@ -166,7 +164,7 @@ public final class Constructor<T>
+   @SuppressWarnings("unchecked")
+   public Class<?>[] getParameterTypes()
+   {
+-    return (Class<?>[]) VMConstructor.getParameterTypes(this);
++    return (Class<?>[]) cons.getParameterTypes();
+   }
+ 
+   /**
+@@ -179,7 +177,7 @@ public final class Constructor<T>
+   @SuppressWarnings("unchecked")
+   public Class<?>[] getExceptionTypes()
+   {
+-    return (Class<?>[]) VMConstructor.getExceptionTypes(this);
++    return (Class<?>[]) cons.getExceptionTypes();
+   }
+ 
+   /**
+@@ -194,14 +192,7 @@ public final class Constructor<T>
+    */
+   public boolean equals(Object o)
+   {
+-    if (!(o instanceof Constructor))
+-      return false;
+-    Constructor that = (Constructor)o; 
+-    if (this.getDeclaringClass() != that.getDeclaringClass())
+-      return false;
+-    if (!Arrays.equals(this.getParameterTypes(), that.getParameterTypes()))
+-      return false;
+-    return true;
++    return cons.equals(o);
+   }
+ 
+   /**
+@@ -212,7 +203,7 @@ public final class Constructor<T>
+    */
+   public int hashCode()
+   {
+-    return getDeclaringClass().getName().hashCode();
++    return getName().hashCode();
+   }
+ 
+   /**
+@@ -323,7 +314,7 @@ public final class Constructor<T>
+     throws InstantiationException, IllegalAccessException,
+            InvocationTargetException
+   {
+-    return (T) VMConstructor.constructNative(args, clazz, slot);
++    return (T) cons.construct(args);
+   }
+ 
+   /**
+@@ -342,7 +333,7 @@ public final class Constructor<T>
+   {
+     if (p == null)
+       {
+-	String sig = VMConstructor.getSignature(this);
++	String sig = cons.getSignature();
+ 	if (sig == null)
+ 	  return new TypeVariable[0];
+ 	p = new MethodSignatureParser(this, sig);
+@@ -366,7 +357,7 @@ public final class Constructor<T>
+   {
+     if (p == null)
+       {
+-	String sig = VMConstructor.getSignature(this);
++	String sig = cons.getSignature();
+ 	if (sig == null)
+ 	  return getExceptionTypes();
+ 	p = new MethodSignatureParser(this, sig);
+@@ -390,7 +381,7 @@ public final class Constructor<T>
+   {
+     if (p == null)
+       {
+-	String sig = VMConstructor.getSignature(this);
++	String sig = cons.getSignature();
+ 	if (sig == null)
+ 	  return getParameterTypes();
+ 	p = new MethodSignatureParser(this, sig);
+@@ -420,7 +411,7 @@ public final class Constructor<T>
+    */
+   public Annotation[][] getParameterAnnotations()
+   {
+-    return VMConstructor.getParameterAnnotations(this);
++    return cons.getParameterAnnotations();
+   }
+ 
+ }
+Index: java/lang/reflect/Field.java
+===================================================================
+RCS file: /sources/classpath/classpath/java/lang/reflect/Field.java,v
+retrieving revision 1.6
+diff -u -3 -p -u -r1.6 Field.java
+--- java/lang/reflect/Field.java	3 Mar 2008 18:59:10 -0000	1.6
++++ java/lang/reflect/Field.java	3 Mar 2008 21:15:40 -0000
+@@ -79,10 +79,6 @@ import gnu.java.lang.reflect.FieldSignat
+ public final class Field
+ extends AccessibleObject implements Member
+ {
+-  Class declaringClass;
+-  String name;
+-  int slot;
+-
+   static final int FIELD_MODIFIERS
+     = Modifier.FINAL | Modifier.PRIVATE | Modifier.PROTECTED
+       | Modifier.PUBLIC | Modifier.STATIC | Modifier.TRANSIENT
+@@ -90,14 +86,14 @@ extends AccessibleObject implements Memb
+ 
+   private FieldSignatureParser p;
+ 
++  private VMField f;
++
+   /**
+    * This class is uninstantiable outside the package.
+    */
+-  Field(Class declaringClass, String name, int slot)
++  Field(VMField f)
+   {
+-    this.declaringClass = declaringClass;
+-    this.name = name;
+-    this.slot = slot;
++    this.f = f;
+   }
+ 
+   /**
+@@ -105,9 +101,10 @@ extends AccessibleObject implements Memb
+    * is a non-inherited member.
+    * @return the class that declared this member
+    */
++  @SuppressWarnings("unchecked")
+   public Class<?> getDeclaringClass()
+   {
+-    return declaringClass;
++    return (Class<?>) f.getDeclaringClass();
+   }
+ 
+   /**
+@@ -116,7 +113,7 @@ extends AccessibleObject implements Memb
+    */
+   public String getName()
+   {
+-    return name;
++    return f.getName();
+   }
+ 
+   /**
+@@ -130,7 +127,7 @@ extends AccessibleObject implements Memb
+    */
+   public int getModifiers()
+   {
+-    return VMField.getModifiersInternal(this) & FIELD_MODIFIERS;
++    return f.getModifiersInternal() & FIELD_MODIFIERS;
+   }
+ 
+   /**
+@@ -139,7 +136,7 @@ extends AccessibleObject implements Memb
+    */
+   public boolean isSynthetic()
+   {
+-    return (VMField.getModifiersInternal(this) & Modifier.SYNTHETIC) != 0;
++    return (f.getModifiersInternal() & Modifier.SYNTHETIC) != 0;
+   }
+ 
+   /**
+@@ -149,7 +146,7 @@ extends AccessibleObject implements Memb
+    */
+   public boolean isEnumConstant()
+   {
+-    return (VMField.getModifiersInternal(this) & Modifier.ENUM) != 0;
++    return (f.getModifiersInternal() & Modifier.ENUM) != 0;
+   }
+ 
+   /**
+@@ -158,7 +155,7 @@ extends AccessibleObject implements Memb
+    */
+   public Class<?> getType()
+   {
+-    return VMField.getType(this);
++    return f.getType();
+   }
+ 
+   /**
+@@ -172,16 +169,7 @@ extends AccessibleObject implements Memb
+    */
+   public boolean equals(Object o)
+   {
+-    if (!(o instanceof Field))
+-      return false;
+-    Field that = (Field)o; 
+-    if (this.getDeclaringClass() != that.getDeclaringClass())
+-      return false;
+-    if (!this.getName().equals(that.getName()))
+-      return false;
+-    if (this.getType() != that.getType())
+-      return false;
+-    return true;
++    return f.equals(o);
+   }
+ 
+   /**
+@@ -192,7 +180,7 @@ extends AccessibleObject implements Memb
+    */
+   public int hashCode()
+   {
+-    return getDeclaringClass().getName().hashCode() ^ getName().hashCode();
++    return f.getDeclaringClass().getName().hashCode() ^ f.getName().hashCode();
+   }
+ 
+   /**
+@@ -267,7 +255,7 @@ extends AccessibleObject implements Memb
+   public Object get(Object o)
+     throws IllegalAccessException
+   {
+-    return VMField.get(this, o);
++    return f.get(o);
+   }
+ 
+   /**
+@@ -290,7 +278,7 @@ extends AccessibleObject implements Memb
+   public boolean getBoolean(Object o)
+     throws IllegalAccessException
+   {
+-    return VMField.getBoolean(this, o);
++    return f.getBoolean(o);
+   }
+ 
+   /**
+@@ -313,7 +301,7 @@ extends AccessibleObject implements Memb
+   public byte getByte(Object o)
+     throws IllegalAccessException
+   {
+-    return VMField.getByte(this, o);
++    return f.getByte(o);
+   }
+ 
+   /**
+@@ -334,7 +322,7 @@ extends AccessibleObject implements Memb
+   public char getChar(Object o)
+     throws IllegalAccessException
+   {
+-    return VMField.getChar(this, o);
++    return f.getChar(o);
+   }
+ 
+   /**
+@@ -357,7 +345,7 @@ extends AccessibleObject implements Memb
+   public short getShort(Object o)
+     throws IllegalAccessException
+   {
+-    return VMField.getShort(this, o);
++    return f.getShort(o);
+   }
+ 
+   /**
+@@ -380,7 +368,7 @@ extends AccessibleObject implements Memb
+   public int getInt(Object o)
+     throws IllegalAccessException
+   {
+-    return VMField.getInt(this, o);
++    return f.getInt(o);
+   }
+ 
+   /**
+@@ -403,7 +391,7 @@ extends AccessibleObject implements Memb
+   public long getLong(Object o)
+     throws IllegalAccessException
+   {
+-    return VMField.getLong(this, o);
++    return f.getLong(o);
+   }
+ 
+   /**
+@@ -426,7 +414,7 @@ extends AccessibleObject implements Memb
+   public float getFloat(Object o)
+     throws IllegalAccessException
+   {
+-    return VMField.getFloat(this, o);
++    return f.getFloat(o);
+   }
+ 
+   /**
+@@ -450,7 +438,7 @@ extends AccessibleObject implements Memb
+   public double getDouble(Object o)
+     throws IllegalAccessException
+   {
+-    return VMField.getDouble(this, o);
++    return f.getDouble(o);
+   }
+ 
+   /**
+@@ -501,7 +489,7 @@ extends AccessibleObject implements Memb
+   public void set(Object o, Object value)
+     throws IllegalAccessException
+   {
+-    VMField.set(this, o, value);
++    f.set(o, value);
+   }
+ 
+   /**
+@@ -524,7 +512,7 @@ extends AccessibleObject implements Memb
+   public void setBoolean(Object o, boolean value)
+     throws IllegalAccessException
+   {
+-    VMField.setBoolean(this, o, value);
++    f.setBoolean(o, value);
+   }
+ 
+   /**
+@@ -547,7 +535,7 @@ extends AccessibleObject implements Memb
+   public void setByte(Object o, byte value)
+     throws IllegalAccessException
+   {
+-    VMField.setByte(this, o, value);
++    f.setByte(o, value);
+   }
+ 
+   /**
+@@ -570,7 +558,7 @@ extends AccessibleObject implements Memb
+   public void setChar(Object o, char value)
+     throws IllegalAccessException
+   {
+-    VMField.setChar(this, o, value);
++    f.setChar(o, value);
+   }
+ 
+   /**
+@@ -593,7 +581,7 @@ extends AccessibleObject implements Memb
+   public void setShort(Object o, short value)
+     throws IllegalAccessException
+   {
+-    VMField.setShort(this, o, value);
++    f.setShort(o, value);
+   }
+ 
+   /**
+@@ -616,7 +604,7 @@ extends AccessibleObject implements Memb
+   public void setInt(Object o, int value)
+     throws IllegalAccessException
+   {
+-    VMField.setInt(this, o, value);
++    f.setInt(o, value);
+   }
+ 
+   /**
+@@ -639,7 +627,7 @@ extends AccessibleObject implements Memb
+   public void setLong(Object o, long value)
+     throws IllegalAccessException
+   {
+-    VMField.setLong(this, o, value);
++    f.setLong(o, value);
+   }
+ 
+   /**
+@@ -662,7 +650,7 @@ extends AccessibleObject implements Memb
+   public void setFloat(Object o, float value)
+     throws IllegalAccessException
+   {
+-    VMField.setFloat(this, o, value);
++    f.setFloat(o, value);
+   }
+ 
+   /**
+@@ -685,7 +673,7 @@ extends AccessibleObject implements Memb
+   public void setDouble(Object o, double value)
+     throws IllegalAccessException
+   {
+-    VMField.setDouble(this, o, value);
++    f.setDouble(o, value);
+   }
+ 
+   /**
+@@ -701,7 +689,7 @@ extends AccessibleObject implements Memb
+   {
+     if (p == null)
+       {
+-	String signature = VMField.getSignature(this);
++	String signature = f.getSignature();
+ 	if (signature == null)
+ 	  return getType();
+ 	p = new FieldSignatureParser(getDeclaringClass(),
+Index: java/lang/reflect/Method.java
+===================================================================
+RCS file: /sources/classpath/classpath/java/lang/reflect/Method.java,v
+retrieving revision 1.5
+diff -u -3 -p -u -r1.5 Method.java
+--- java/lang/reflect/Method.java	3 Mar 2008 18:59:10 -0000	1.5
++++ java/lang/reflect/Method.java	3 Mar 2008 21:15:40 -0000
+@@ -44,7 +44,6 @@ import gnu.java.lang.CPStringBuilder;
+ import gnu.java.lang.reflect.MethodSignatureParser;
+ 
+ import java.lang.annotation.Annotation;
+-import java.util.Arrays;
+ 
+ /**
+  * The Method class represents a member method of a class. It also allows
+@@ -82,25 +81,21 @@ import java.util.Arrays;
+ public final class Method
+ extends AccessibleObject implements Member, GenericDeclaration
+ {
+-  Class declaringClass;
+-  String name;
+-  int slot;
+-
+-  static final int METHOD_MODIFIERS
++  private static final int METHOD_MODIFIERS
+     = Modifier.ABSTRACT | Modifier.FINAL | Modifier.NATIVE
+       | Modifier.PRIVATE | Modifier.PROTECTED | Modifier.PUBLIC
+       | Modifier.STATIC | Modifier.STRICT | Modifier.SYNCHRONIZED;
+ 
+   private MethodSignatureParser p;
+ 
++  private VMMethod m;
++
+   /**
+    * This class is uninstantiable outside this package.
+    */
+-  Method(Class declaringClass, String name, int slot)
++  Method(VMMethod m)
+   {
+-    this.declaringClass = declaringClass;
+-    this.name = name;
+-    this.slot = slot;
++    this.m = m;
+   }
+ 
+   /**
+@@ -108,9 +103,10 @@ extends AccessibleObject implements Memb
+    * is a non-inherited member.
+    * @return the class that declared this member
+    */
++  @SuppressWarnings("unchecked")
+   public Class<?> getDeclaringClass()
+   {
+-    return declaringClass;
++    return (Class<?>) m.getDeclaringClass();
+   }
+ 
+   /**
+@@ -119,7 +115,7 @@ extends AccessibleObject implements Memb
+    */
+   public String getName()
+   {
+-    return name;
++    return m.getName();
+   }
+ 
+   /**
+@@ -133,7 +129,7 @@ extends AccessibleObject implements Memb
+    */
+   public int getModifiers()
+   {
+-    return VMMethod.getModifiersInternal(this) & METHOD_MODIFIERS;
++    return m.getModifiersInternal() & METHOD_MODIFIERS;
+   }
+ 
+   /**
+@@ -144,7 +140,7 @@ extends AccessibleObject implements Memb
+    */
+   public boolean isBridge()
+   {
+-    return (VMMethod.getModifiersInternal(this) & Modifier.BRIDGE) != 0;
++    return (m.getModifiersInternal() & Modifier.BRIDGE) != 0;
+   }
+ 
+   /**
+@@ -153,7 +149,7 @@ extends AccessibleObject implements Memb
+    */
+   public boolean isSynthetic()
+   {
+-    return (VMMethod.getModifiersInternal(this) & Modifier.SYNTHETIC) != 0;
++    return (m.getModifiersInternal() & Modifier.SYNTHETIC) != 0;
+   }
+ 
+   /**
+@@ -163,7 +159,7 @@ extends AccessibleObject implements Memb
+    */
+   public boolean isVarArgs()
+   {
+-    return (VMMethod.getModifiersInternal(this) & Modifier.VARARGS) != 0;
++    return (m.getModifiersInternal() & Modifier.VARARGS) != 0;
+   }
+ 
+   /**
+@@ -173,7 +169,7 @@ extends AccessibleObject implements Memb
+   @SuppressWarnings("unchecked")
+   public Class<?> getReturnType()
+   {
+-    return (Class<?>) VMMethod.getReturnType(this);
++    return (Class<?>) m.getReturnType();
+   }
+ 
+   /**
+@@ -185,7 +181,7 @@ extends AccessibleObject implements Memb
+   @SuppressWarnings("unchecked")
+   public Class<?>[] getParameterTypes()
+   {
+-    return (Class<?>[]) VMMethod.getParameterTypes(this);
++    return (Class<?>[]) m.getParameterTypes();
+   }
+ 
+   /**
+@@ -198,7 +194,7 @@ extends AccessibleObject implements Memb
+   @SuppressWarnings("unchecked")
+   public Class<?>[] getExceptionTypes()
+   {
+-    return (Class<?>[]) VMMethod.getExceptionTypes(this);
++    return (Class<?>[]) m.getExceptionTypes();
+   }
+ 
+   /**
+@@ -211,38 +207,7 @@ extends AccessibleObject implements Memb
+    */
+   public boolean equals(Object o)
+   {
+-      // Implementation note:
+-      // The following is a correct but possibly slow implementation.
+-      //
+-      // This class has a private field 'slot' that could be used by
+-      // the VM implementation to "link" a particular method to a Class.
+-      // In that case equals could be simply implemented as:
+-      //
+-      // if (o instanceof Method)
+-      // {
+-      //    Method m = (Method)o;
+-      //    return m.declaringClass == this.declaringClass
+-      //           && m.slot == this.slot;
+-      // }
+-      // return false;
+-      //
+-      // If a VM uses the Method class as their native/internal representation
+-      // then just using the following would be optimal:
+-      //
+-      // return this == o;
+-      //
+-    if (!(o instanceof Method))
+-      return false;
+-    Method that = (Method)o;
+-    if (this.getDeclaringClass() != that.getDeclaringClass())
+-      return false;
+-    if (!this.getName().equals(that.getName()))
+-      return false;
+-    if (this.getReturnType() != that.getReturnType())
+-      return false;
+-    if (!Arrays.equals(this.getParameterTypes(), that.getParameterTypes()))
+-      return false;
+-    return true;
++    return m.equals(o);
+   }
+ 
+   /**
+@@ -253,7 +218,7 @@ extends AccessibleObject implements Memb
+    */
+   public int hashCode()
+   {
+-    return getDeclaringClass().getName().hashCode() ^ getName().hashCode();
++    return m.getDeclaringClass().getName().hashCode() ^ m.getName().hashCode();
+   }
+ 
+   /**
+@@ -362,7 +327,7 @@ extends AccessibleObject implements Memb
+   public Object invoke(Object o, Object... args)
+     throws IllegalAccessException, InvocationTargetException
+   {
+-    return VMMethod.invokeNative(o, args, declaringClass, slot);
++    return m.invoke(o, args);
+   }
+ 
+   /**
+@@ -381,7 +346,7 @@ extends AccessibleObject implements Memb
+   {
+     if (p == null)
+       {
+-	String sig = VMMethod.getSignature(this);
++	String sig = m.getSignature();
+ 	if (sig == null)
+ 	  return (TypeVariable<Method>[]) new TypeVariable[0];
+ 	p = new MethodSignatureParser(this, sig);
+@@ -405,7 +370,7 @@ extends AccessibleObject implements Memb
+   {
+     if (p == null)
+       {
+-	String sig = VMMethod.getSignature(this);
++	String sig = m.getSignature();
+ 	if (sig == null)
+ 	  return getExceptionTypes();
+ 	p = new MethodSignatureParser(this, sig);
+@@ -429,7 +394,7 @@ extends AccessibleObject implements Memb
+   {
+     if (p == null)
+       {
+-	String sig = VMMethod.getSignature(this);
++	String sig = m.getSignature();
+ 	if (sig == null)
+ 	  return getParameterTypes();
+ 	p = new MethodSignatureParser(this, sig);
+@@ -450,7 +415,7 @@ extends AccessibleObject implements Memb
+   {
+     if (p == null)
+       {
+-	String sig = VMMethod.getSignature(this);
++	String sig = m.getSignature();
+ 	if (sig == null)
+ 	  return getReturnType();
+ 	p = new MethodSignatureParser(this, sig);
+@@ -471,7 +436,7 @@ extends AccessibleObject implements Memb
+    */
+   public Object getDefaultValue()
+   {
+-    return VMMethod.getDefaultValue(this);
++    return m.getDefaultValue();
+   }
+ 
+   /**
+@@ -496,7 +461,7 @@ extends AccessibleObject implements Memb
+    */
+   public Annotation[][] getParameterAnnotations()
+   {
+-    return VMMethod.getParameterAnnotations(this);
++    return m.getParameterAnnotations();
+   }
+ 
+ }
+Index: vm/reference/java/lang/reflect/VMConstructor.java
+===================================================================
+RCS file: /sources/classpath/classpath/vm/reference/java/lang/reflect/VMConstructor.java,v
+retrieving revision 1.1
+diff -u -3 -p -u -r1.1 VMConstructor.java
+--- vm/reference/java/lang/reflect/VMConstructor.java	3 Mar 2008 18:59:11 -0000	1.1
++++ vm/reference/java/lang/reflect/VMConstructor.java	3 Mar 2008 21:15:47 -0000
+@@ -40,46 +40,57 @@ package java.lang.reflect;
+ 
+ import java.lang.annotation.Annotation;
+ 
++import java.util.Arrays;
++
+ final class VMConstructor
+ {
++  Class clazz;
++  int slot;
++
++  VMConstructor(Class clazz, int slot)
++  {
++    this.clazz = clazz;
++    this.slot = slot;
++  }
++
++  public Class getDeclaringClass()
++  {
++    return clazz;
++  }
++
+   /**
+    * Return the raw modifiers for this constructor.  In particular
+    * this will include the synthetic and varargs bits.
+-   * @param c the constructor concerned.
+    * @return the constructor's modifiers
+    */
+-  static native int getModifiersInternal(Constructor c);
++  native int getModifiersInternal();
+ 
+   /**
+    * Get the parameter list for this constructor, in declaration order. If the
+    * constructor takes no parameters, returns a 0-length array (not null).
+    *
+-   * @param c the constructor concerned.
+    * @return a list of the types of the constructor's parameters
+    */
+-  static native Class[] getParameterTypes(Constructor c);
++  native Class[] getParameterTypes();
+ 
+   /**
+    * Get the exception types this constructor says it throws, in no particular
+    * order. If the constructor has no throws clause, returns a 0-length array
+    * (not null).
+    *
+-   * @param c the constructor concerned.
+    * @return a list of the types in the constructor's throws clause
+    */
+-  static native Class[] getExceptionTypes(Constructor c);
++  native Class[] getExceptionTypes();
+ 
+-  static native Object constructNative(Object[] args, Class declaringClass,
+-				       int slot)
++  native Object construct(Object[] args)
+     throws InstantiationException, IllegalAccessException,
+     InvocationTargetException;
+ 
+   /**
+    * Return the String in the Signature attribute for this constructor. If there
+    * is no Signature attribute, return null.
+-   * @param c the constructor concerned.
+    */
+-  static native String getSignature(Constructor c);
++  native String getSignature();
+   
+   /**
+    * <p>
+@@ -96,12 +107,33 @@ final class VMConstructor
+    * no affect on the return value of future calls to this method.
+    * </p>
+    * 
+-   * @param c the constructor concerned.
+    * @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
+    */
+-  static native Annotation[][] getParameterAnnotations(Constructor c);
++  native Annotation[][] getParameterAnnotations();
++
++  /**
++   * Compare two objects to see if they are semantically equivalent.
++   * Two Constructors are semantically equivalent if they have the same
++   * declaring class and the same parameter list.  This ignores different
++   * exception clauses, but since you can't create a Method except through the
++   * VM, this is just the == relation.
++   *
++   * @param o the object to compare to
++   * @return <code>true</code> if they are equal; <code>false</code> if not.
++   */
++  public boolean equals(Object o)
++  {
++    if (!(o instanceof Constructor))
++      return false;
++    Constructor that = (Constructor)o; 
++    if (clazz != that.getDeclaringClass())
++      return false;
++    if (!Arrays.equals(getParameterTypes(), that.getParameterTypes()))
++      return false;
++    return true;
++  }
+ 
+ }
+Index: vm/reference/java/lang/reflect/VMField.java
+===================================================================
+RCS file: /sources/classpath/classpath/vm/reference/java/lang/reflect/VMField.java,v
+retrieving revision 1.1
+diff -u -3 -p -u -r1.1 VMField.java
+--- vm/reference/java/lang/reflect/VMField.java	3 Mar 2008 18:59:11 -0000	1.1
++++ vm/reference/java/lang/reflect/VMField.java	3 Mar 2008 21:15:47 -0000
+@@ -40,20 +40,38 @@ package java.lang.reflect;
+ 
+ final class VMField
+ {
++  Class declaringClass;
++  String name;
++  int slot;
++
++  VMField(Class declaringClass, String name, int slot)
++  {
++    this.declaringClass = declaringClass;
++    this.name = name;
++    this.slot = slot;
++  }
++
++  public Class getDeclaringClass()
++  {
++    return declaringClass;
++  }
++
++  public String getName()
++  {
++    return name;
++  }
+ 
+   /**
+    * Return the raw modifiers for this field.
+-   * @param f the field concerned.
+    * @return the field's modifiers
+    */
+-  static native int getModifiersInternal(Field f);
++  native int getModifiersInternal();
+ 
+   /**
+    * Gets the type of this field.
+-   * @param f the field concerned.
+    * @return the type of this field
+    */
+-  static native Class getType(Field f);
++  native Class getType();
+ 
+   /**
+    * Get the value of this Field.  If it is primitive, it will be wrapped
+@@ -76,7 +94,6 @@ final class VMField
+    * declaring class, even if the instance passed in belongs to a subclass
+    * which declares another field to hide this one.
+    *
+-   * @param f the field concerned.
+    * @param o the object to get the value of this Field from
+    * @return the value of the Field
+    * @throws IllegalAccessException if you could not normally access this field
+@@ -96,14 +113,13 @@ final class VMField
+    * @see #getFloat(Object)
+    * @see #getDouble(Object)
+    */
+-  static native Object get(Field f, Object o)
++  native Object get(Object o)
+     throws IllegalAccessException;
+ 
+   /**
+    * Get the value of this boolean Field. If the field is static,
+    * <code>o</code> will be ignored.
+    *
+-   * @param f the field concerned.
+    * @param o the object to get the value of this Field from
+    * @return the value of the Field
+    * @throws IllegalAccessException if you could not normally access this field
+@@ -117,14 +133,13 @@ final class VMField
+    *         class initialization, which then failed
+    * @see #get(Object)
+    */
+-  static native boolean getBoolean(Field f, Object o)
++  native boolean getBoolean(Object o)
+     throws IllegalAccessException;
+ 
+   /**
+    * Get the value of this byte Field. If the field is static,
+    * <code>o</code> will be ignored.
+    *
+-   * @param f the field concerned.
+    * @param o the object to get the value of this Field from
+    * @return the value of the Field
+    * @throws IllegalAccessException if you could not normally access this field
+@@ -138,14 +153,13 @@ final class VMField
+    *         class initialization, which then failed
+    * @see #get(Object)
+    */
+-  static native byte getByte(Field f, Object o)
++  native byte getByte(Object o)
+     throws IllegalAccessException;
+ 
+   /**
+    * Get the value of this Field as a char. If the field is static,
+    * <code>o</code> will be ignored.
+    *
+-   * @param f the field concerned.
+    * @param o the object to get the value of this Field from
+    * @throws IllegalAccessException if you could not normally access this field
+    *         (i.e. it is not public)
+@@ -158,14 +172,13 @@ final class VMField
+    *         class initialization, which then failed
+    * @see #get(Object)
+    */
+-  static native char getChar(Field f, Object o)
++  native char getChar(Object o)
+     throws IllegalAccessException;
+ 
+   /**
+    * Get the value of this Field as a short. If the field is static,
+    * <code>o</code> will be ignored.
+    *
+-   * @param f the field concerned.
+    * @param o the object to get the value of this Field from
+    * @return the value of the Field
+    * @throws IllegalAccessException if you could not normally access this field
+@@ -179,14 +192,13 @@ final class VMField
+    *         class initialization, which then failed
+    * @see #get(Object)
+    */
+-  static native short getShort(Field f, Object o)
++  native short getShort(Object o)
+     throws IllegalAccessException;
+ 
+   /**
+    * Get the value of this Field as an int. If the field is static,
+    * <code>o</code> will be ignored.
+    *
+-   * @param f the field concerned.
+    * @param o the object to get the value of this Field from
+    * @return the value of the Field
+    * @throws IllegalAccessException if you could not normally access this field
+@@ -200,14 +212,13 @@ final class VMField
+    *         class initialization, which then failed
+    * @see #get(Object)
+    */
+-  static native int getInt(Field f, Object o)
++  native int getInt(Object o)
+     throws IllegalAccessException;
+ 
+   /**
+    * Get the value of this Field as a long. If the field is static,
+    * <code>o</code> will be ignored.
+    *
+-   * @param f the field concerned.
+    * @param o the object to get the value of this Field from
+    * @return the value of the Field
+    * @throws IllegalAccessException if you could not normally access this field
+@@ -221,14 +232,13 @@ final class VMField
+    *         class initialization, which then failed
+    * @see #get(Object)
+    */
+-  static native long getLong(Field f, Object o)
++  native long getLong(Object o)
+     throws IllegalAccessException;
+ 
+   /**
+    * Get the value of this Field as a float. If the field is static,
+    * <code>o</code> will be ignored.
+    *
+-   * @param f the field concerned.
+    * @param o the object to get the value of this Field from
+    * @return the value of the Field
+    * @throws IllegalAccessException if you could not normally access this field
+@@ -242,14 +252,13 @@ final class VMField
+    *         class initialization, which then failed
+    * @see #get(Object)
+    */
+-  static native float getFloat(Field f, Object o)
++  native float getFloat(Object o)
+     throws IllegalAccessException;
+ 
+   /**
+    * Get the value of this Field as a double. If the field is static,
+    * <code>o</code> will be ignored.
+    *
+-   * @param f the field concerned.
+    * @param o the object to get the value of this Field from
+    * @return the value of the Field
+    * @throws IllegalAccessException if you could not normally access this field
+@@ -264,7 +273,7 @@ final class VMField
+    *         class initialization, which then failed
+    * @see #get(Object)
+    */
+-  static native double getDouble(Field f, Object o)
++  native double getDouble(Object o)
+     throws IllegalAccessException;
+ 
+   /**
+@@ -291,7 +300,6 @@ final class VMField
+    * the field of the declaring class, even if the instance passed in belongs
+    * to a subclass which declares another field to hide this one.
+    *
+-   * @param f the field concerned.
+    * @param o the object to set this Field on
+    * @param value the value to set this Field to
+    * @throws IllegalAccessException if you could not normally access this field
+@@ -313,14 +321,13 @@ final class VMField
+    * @see #setFloat(Object, float)
+    * @see #setDouble(Object, double)
+    */
+-  static native void set(Field f, Object o, Object value)
++  native void set(Object o, Object value)
+     throws IllegalAccessException;
+ 
+   /**
+    * Set this boolean Field. If the field is static, <code>o</code> will be
+    * ignored.
+    *
+-   * @param f the field concerned.
+    * @param o the object to set this Field on
+    * @param value the value to set this Field to
+    * @throws IllegalAccessException if you could not normally access this field
+@@ -334,14 +341,13 @@ final class VMField
+    *         class initialization, which then failed
+    * @see #set(Object, Object)
+    */
+-  static native void setBoolean(Field f, Object o, boolean value)
++  native void setBoolean(Object o, boolean value)
+     throws IllegalAccessException;
+ 
+   /**
+    * Set this byte Field. If the field is static, <code>o</code> will be
+    * ignored.
+    *
+-   * @param f the field concerned.
+    * @param o the object to set this Field on
+    * @param value the value to set this Field to
+    * @throws IllegalAccessException if you could not normally access this field
+@@ -355,14 +361,13 @@ final class VMField
+    *         class initialization, which then failed
+    * @see #set(Object, Object)
+    */
+-  static native void setByte(Field f, Object o, byte value)
++  native void setByte(Object o, byte value)
+     throws IllegalAccessException;
+ 
+   /**
+    * Set this char Field. If the field is static, <code>o</code> will be
+    * ignored.
+    *
+-   * @param f the field concerned.
+    * @param o the object to set this Field on
+    * @param value the value to set this Field to
+    * @throws IllegalAccessException if you could not normally access this field
+@@ -376,14 +381,13 @@ final class VMField
+    *         class initialization, which then failed
+    * @see #set(Object, Object)
+    */
+-  static native void setChar(Field f, Object o, char value)
++  native void setChar(Object o, char value)
+     throws IllegalAccessException;
+ 
+   /**
+    * Set this short Field. If the field is static, <code>o</code> will be
+    * ignored.
+    *
+-   * @param f the field concerned.
+    * @param o the object to set this Field on
+    * @param value the value to set this Field to
+    * @throws IllegalAccessException if you could not normally access this field
+@@ -397,14 +401,13 @@ final class VMField
+    *         class initialization, which then failed
+    * @see #set(Object, Object)
+    */
+-  static native void setShort(Field f, Object o, short value)
++  native void setShort(Object o, short value)
+     throws IllegalAccessException;
+ 
+   /**
+    * Set this int Field. If the field is static, <code>o</code> will be
+    * ignored.
+    *
+-   * @param f the field concerned.
+    * @param o the object to set this Field on
+    * @param value the value to set this Field to
+    * @throws IllegalAccessException if you could not normally access this field
+@@ -418,14 +421,13 @@ final class VMField
+    *         class initialization, which then failed
+    * @see #set(Object, Object)
+    */
+-  static native void setInt(Field f, Object o, int value)
++  native void setInt(Object o, int value)
+     throws IllegalAccessException;
+ 
+   /**
+    * Set this long Field. If the field is static, <code>o</code> will be
+    * ignored.
+    *
+-   * @param f the field concerned.
+    * @param o the object to set this Field on
+    * @param value the value to set this Field to
+    * @throws IllegalAccessException if you could not normally access this field
+@@ -439,14 +441,13 @@ final class VMField
+    *         class initialization, which then failed
+    * @see #set(Object, Object)
+    */
+-  static native void setLong(Field f, Object o, long value)
++  native void setLong(Object o, long value)
+     throws IllegalAccessException;
+ 
+   /**
+    * Set this float Field. If the field is static, <code>o</code> will be
+    * ignored.
+    *
+-   * @param f the field concerned.
+    * @param o the object to set this Field on
+    * @param value the value to set this Field to
+    * @throws IllegalAccessException if you could not normally access this field
+@@ -460,14 +461,13 @@ final class VMField
+    *         class initialization, which then failed
+    * @see #set(Object, Object)
+    */
+-  static native void setFloat(Field f, Object o, float value)
++  native void setFloat(Object o, float value)
+     throws IllegalAccessException;
+ 
+   /**
+    * Set this double Field. If the field is static, <code>o</code> will be
+    * ignored.
+    *
+-   * @param f the field concerned.
+    * @param o the object to set this Field on
+    * @param value the value to set this Field to
+    * @throws IllegalAccessException if you could not normally access this field
+@@ -481,15 +481,37 @@ final class VMField
+    *         class initialization, which then failed
+    * @see #set(Object, Object)
+    */
+-  static native void setDouble(Field f, Object o, double value)
++  native void setDouble(Object o, double value)
+     throws IllegalAccessException;
+ 
+   /**
+    * Return the String in the Signature attribute for this field. If there
+    * is no Signature attribute, return null.
+    *
+-   * @param f the field concerned.
+    */
+-  static native String getSignature(Field f);
++  native String getSignature();
++
++  /**
++   * Compare two objects to see if they are semantically equivalent.
++   * Two Fields are semantically equivalent if they have the same declaring
++   * class, name, and type. Since you can't create a Field except through
++   * the VM, this is just the == relation.
++   *
++   * @param o the object to compare to
++   * @return <code>true</code> if they are equal; <code>false</code> if not
++   */
++  public boolean equals(Object o)
++  {
++    if (!(o instanceof Field))
++      return false;
++    Field that = (Field)o; 
++    if (declaringClass != that.getDeclaringClass())
++      return false;
++    if (!name.equals(that.getName()))
++      return false;
++    if (getType() != that.getType())
++      return false;
++    return true;
++  }
+ 
+ }
+Index: vm/reference/java/lang/reflect/VMMethod.java
+===================================================================
+RCS file: /sources/classpath/classpath/vm/reference/java/lang/reflect/VMMethod.java,v
+retrieving revision 1.1
+diff -u -3 -p -u -r1.1 VMMethod.java
+--- vm/reference/java/lang/reflect/VMMethod.java	3 Mar 2008 18:59:11 -0000	1.1
++++ vm/reference/java/lang/reflect/VMMethod.java	3 Mar 2008 21:15:47 -0000
+@@ -40,51 +40,61 @@ package java.lang.reflect;
+ 
+ import java.lang.annotation.Annotation;
+ 
++import java.util.Arrays;
++
+ final class VMMethod
+ {
++  Class declaringClass;
++  String name;
++  int slot;
++
++  public Class getDeclaringClass()
++  {
++    return declaringClass;
++  }
++
++  public String getName()
++  {
++    return name;
++  }
++
+   /**
+    * Return the raw modifiers for this method.
+-   * @param m the method concerned.
+    * @return the method's modifiers
+    */
+-  static native int getModifiersInternal(Method m);
++  native int getModifiersInternal();
+ 
+   /**
+    * Gets the return type of this method.
+-   * @param m the method concerned.
+    * @return the type of this method
+    */
+-  static native Class getReturnType(Method m);
++  native Class getReturnType();
+ 
+   /**
+    * Get the parameter list for this method, in declaration order. If the
+    * method takes no parameters, returns a 0-length array (not null).
+    *
+-   * @param m the method concerned.
+    * @return a list of the types of the method's parameters
+    */
+-  static native Class[] getParameterTypes(Method m);
++  native Class[] getParameterTypes();
+ 
+   /**
+    * Get the exception types this method says it throws, in no particular
+    * order. If the method has no throws clause, returns a 0-length array
+    * (not null).
+    *
+-   * @param m the method concerned.
+    * @return a list of the types in the method's throws clause
+    */
+-  static native Class[] getExceptionTypes(Method m);
++  native Class[] getExceptionTypes();
+ 
+-  static native Object invokeNative(Object o, Object[] args,
+-				    Class declaringClass, int slot)
++  native Object invoke(Object o, Object[] args)
+     throws IllegalAccessException, InvocationTargetException;
+ 
+   /**
+    * Return the String in the Signature attribute for this method. If there
+    * is no Signature attribute, return null.
+-   * @param m the method concerned.
+    */
+-  static native String getSignature(Method m);
++  native String getSignature();
+ 
+   /**
+    * If this method is an annotation method, returns the default
+@@ -92,13 +102,12 @@ final class VMMethod
+    * method is not a member of an annotation type, returns null.
+    * Primitive types are wrapped.
+    *
+-   * @param m the method concerned.
+    * @throws TypeNotPresentException if the method returns a Class,
+    * and the class cannot be found
+    *
+    * @since 1.5
+    */
+-  static native Object getDefaultValue(Method m);
++  native Object getDefaultValue();
+ 
+   /**
+    * <p>
+@@ -115,13 +124,56 @@ final class VMMethod
+    * no affect on the return value of future calls to this method.
+    * </p>
+    * 
+-   * @param m the method concerned.
+    * @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
+    */
+-  static native Annotation[][] getParameterAnnotations(Method m);
++  native Annotation[][] getParameterAnnotations();
++
++  /**
++   * Compare two objects to see if they are semantically equivalent.
++   * Two Methods are semantically equivalent if they have the same declaring
++   * class, name, parameter list, and return type.
++   *
++   * @param o the object to compare to
++   * @return <code>true</code> if they are equal; <code>false</code> if not
++   */
++  public boolean equals(Object o)
++  {
++      // Implementation note:
++      // The following is a correct but possibly slow implementation.
++      //
++      // This class has a private field 'slot' that could be used by
++      // the VM implementation to "link" a particular method to a Class.
++      // In that case equals could be simply implemented as:
++      //
++      // if (o instanceof Method)
++      // {
++      //    Method m = (Method)o;
++      //    return m.declaringClass == this.declaringClass
++      //           && m.slot == this.slot;
++      // }
++      // return false;
++      //
++      // If a VM uses the Method class as their native/internal representation
++      // then just using the following would be optimal:
++      //
++      // return this == o;
++      //
++    if (!(o instanceof Method))
++      return false;
++    Method that = (Method)o;
++    if (declaringClass != that.getDeclaringClass())
++      return false;
++    if (!name.equals(that.getName()))
++      return false;
++    if (getReturnType() != that.getReturnType())
++      return false;
++    if (!Arrays.equals(getParameterTypes(), that.getParameterTypes()))
++      return false;
++    return true;
++  }
+ 
+ }
+ 
Index: build/components/patches/classpath-web.RVM-385-03.patch
===================================================================
--- build/components/patches/classpath-web.RVM-385-03.patch	(revision 0)
+++ build/components/patches/classpath-web.RVM-385-03.patch	(revision 0)
@@ -0,0 +1,336 @@
+Index: java/lang/reflect/AccessibleObject.java
+===================================================================
+RCS file: /sources/classpath/classpath/java/lang/reflect/AccessibleObject.java,v
+retrieving revision 1.9
+diff -u -3 -p -u -r1.9 AccessibleObject.java
+--- java/lang/reflect/AccessibleObject.java	10 Dec 2006 20:25:45 -0000	1.9
++++ java/lang/reflect/AccessibleObject.java	5 Mar 2008 21:09:43 -0000
+@@ -160,21 +160,72 @@ public class AccessibleObject
+     this.flag = flag;
+   }
+ 
++  /**
++   * <p>
++   * Returns the element's annotation for the specified annotation type,
++   * or <code>null</code> if no such annotation exists.
++   * </p>
++   * <p>
++   * <strong>This method must be overridden by subclasses to provide
++   * appropriate behaviour.</strong>
++   * </p>
++   *
++   * @param annotationClass the type of annotation to look for.
++   * @return this element's annotation for the specified type, or
++   *         <code>null</code> if no such annotation exists.
++   * @throws NullPointerException if the annotation class is <code>null</code>.
++   */
+   public <T extends Annotation> T getAnnotation(Class<T> annotationClass)
+   {
+     throw new AssertionError("Subclass must override this method");
+   }
+ 
++  /**
++   * Returns all annotations associated with the element.  If there are
++   * no annotations associated with the element, then a zero-length array
++   * will be returned.  The returned array may be modified by the client
++   * code, but this will have no effect on the annotation content of the
++   * element, and hence no effect on the return value of this method for
++   * future callers.
++   *
++   * @return this element's annotations.
++   */
+   public Annotation[] getAnnotations()
+   {
+     return getDeclaredAnnotations();
+   }
+ 
++  /**
++   * <p>
++   * Returns all annotations directly defined by the element.  If there are
++   * no annotations directly associated with the element, then a zero-length
++   * array will be returned.  The returned array may be modified by the client
++   * code, but this will have no effect on the annotation content of this
++   * class, and hence no effect on the return value of this method for
++   * future callers.
++   * </p>
++   * <p>
++   * <strong>This method must be overridden by subclasses to provide
++   * appropriate behaviour.</strong>
++   * </p>
++   *
++   * @return the annotations directly defined by the element.
++   * @since 1.5
++   */
+   public Annotation[] getDeclaredAnnotations()
+   {
+     throw new AssertionError("Subclass must override this method");
+   }
+ 
++  /**
++   * Returns true if an annotation for the specified type is associated
++   * with the element.  This is primarily a short-hand for using marker
++   * annotations.
++   *
++   * @param annotationClass the type of annotation to look for.
++   * @return true if an annotation exists for the specified type.
++   * @since 1.5
++   */
+   public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass)
+   {
+     return getAnnotation(annotationClass) != null;
+Index: java/lang/reflect/Constructor.java
+===================================================================
+RCS file: /sources/classpath/classpath/java/lang/reflect/Constructor.java,v
+retrieving revision 1.7
+diff -u -3 -p -u -r1.7 Constructor.java
+--- java/lang/reflect/Constructor.java	3 Mar 2008 21:21:32 -0000	1.7
++++ java/lang/reflect/Constructor.java	5 Mar 2008 21:09:43 -0000
+@@ -414,4 +414,35 @@ public final class Constructor<T>
+     return cons.getParameterAnnotations();
+   }
+ 
++  /**
++   * Returns the element's annotation for the specified annotation type,
++   * or <code>null</code> if no such annotation exists.
++   *
++   * @param annotationClass the type of annotation to look for.
++   * @return this element's annotation for the specified type, or
++   *         <code>null</code> if no such annotation exists.
++   * @throws NullPointerException if the annotation class is <code>null</code>.
++   */
++  @SuppressWarnings("unchecked")
++  public <T extends Annotation> T getAnnotation(Class<T> annotationClass)
++  {
++    return (T) cons.getAnnotation(annotationClass);
++  }
++
++  /**
++   * Returns all annotations directly defined by the element.  If there are
++   * no annotations directly associated with the element, then a zero-length
++   * array will be returned.  The returned array may be modified by the client
++   * code, but this will have no effect on the annotation content of this
++   * class, and hence no effect on the return value of this method for
++   * future callers.
++   *
++   * @return the annotations directly defined by the element.
++   * @since 1.5
++   */
++  public Annotation[] getDeclaredAnnotations()
++  {
++    return cons.getDeclaredAnnotations();
++  }
++
+ }
+Index: java/lang/reflect/Field.java
+===================================================================
+RCS file: /sources/classpath/classpath/java/lang/reflect/Field.java,v
+retrieving revision 1.7
+diff -u -3 -p -u -r1.7 Field.java
+--- java/lang/reflect/Field.java	3 Mar 2008 21:21:32 -0000	1.7
++++ java/lang/reflect/Field.java	5 Mar 2008 21:09:43 -0000
+@@ -43,6 +43,8 @@ import gnu.java.lang.CPStringBuilder;
+ 
+ import gnu.java.lang.reflect.FieldSignatureParser;
+ 
++import java.lang.annotation.Annotation;
++
+ /**
+  * The Field class represents a member variable of a class. It also allows
+  * dynamic access to a member, via reflection. This works for both
+@@ -698,4 +700,35 @@ extends AccessibleObject implements Memb
+     return p.getFieldType();
+   }
+ 
++  /**
++   * Returns the element's annotation for the specified annotation type,
++   * or <code>null</code> if no such annotation exists.
++   *
++   * @param annotationClass the type of annotation to look for.
++   * @return this element's annotation for the specified type, or
++   *         <code>null</code> if no such annotation exists.
++   * @throws NullPointerException if the annotation class is <code>null</code>.
++   */
++  @SuppressWarnings("unchecked")
++  public <T extends Annotation> T getAnnotation(Class<T> annotationClass)
++  {
++    return (T) f.getAnnotation(annotationClass);
++  }
++
++  /**
++   * Returns all annotations directly defined by the element.  If there are
++   * no annotations directly associated with the element, then a zero-length
++   * array will be returned.  The returned array may be modified by the client
++   * code, but this will have no effect on the annotation content of this
++   * class, and hence no effect on the return value of this method for
++   * future callers.
++   *
++   * @return the annotations directly defined by the element.
++   * @since 1.5
++   */
++  public Annotation[] getDeclaredAnnotations()
++  {
++    return f.getDeclaredAnnotations();
++  }
++
+ }
+Index: java/lang/reflect/Method.java
+===================================================================
+RCS file: /sources/classpath/classpath/java/lang/reflect/Method.java,v
+retrieving revision 1.6
+diff -u -3 -p -u -r1.6 Method.java
+--- java/lang/reflect/Method.java	3 Mar 2008 21:21:32 -0000	1.6
++++ java/lang/reflect/Method.java	5 Mar 2008 21:09:43 -0000
+@@ -464,4 +464,35 @@ extends AccessibleObject implements Memb
+     return m.getParameterAnnotations();
+   }
+ 
++  /**
++   * Returns the element's annotation for the specified annotation type,
++   * or <code>null</code> if no such annotation exists.
++   *
++   * @param annotationClass the type of annotation to look for.
++   * @return this element's annotation for the specified type, or
++   *         <code>null</code> if no such annotation exists.
++   * @throws NullPointerException if the annotation class is <code>null</code>.
++   */
++  @SuppressWarnings("unchecked")
++  public <T extends Annotation> T getAnnotation(Class<T> annotationClass)
++  {
++    return (T) m.getAnnotation(annotationClass);
++  }
++
++  /**
++   * Returns all annotations directly defined by the element.  If there are
++   * no annotations directly associated with the element, then a zero-length
++   * array will be returned.  The returned array may be modified by the client
++   * code, but this will have no effect on the annotation content of this
++   * class, and hence no effect on the return value of this method for
++   * future callers.
++   *
++   * @return the annotations directly defined by the element.
++   * @since 1.5
++   */
++  public Annotation[] getDeclaredAnnotations()
++  {
++    return m.getDeclaredAnnotations();
++  }
++
+ }
+Index: vm/reference/java/lang/reflect/VMConstructor.java
+===================================================================
+RCS file: /sources/classpath/classpath/vm/reference/java/lang/reflect/VMConstructor.java,v
+retrieving revision 1.2
+diff -u -3 -p -u -r1.2 VMConstructor.java
+--- vm/reference/java/lang/reflect/VMConstructor.java	3 Mar 2008 21:21:32 -0000	1.2
++++ vm/reference/java/lang/reflect/VMConstructor.java	5 Mar 2008 21:09:51 -0000
+@@ -136,4 +136,28 @@ final class VMConstructor
+     return true;
+   }
+ 
++  /**
++   * Returns the element's annotation for the specified annotation type,
++   * or <code>null</code> if no such annotation exists.
++   *
++   * @param annotationClass the type of annotation to look for.
++   * @return this element's annotation for the specified type, or
++   *         <code>null</code> if no such annotation exists.
++   * @throws NullPointerException if the annotation class is <code>null</code>.
++   */
++  native Annotation getAnnotation(Class annotationClass);
++
++  /**
++   * Returns all annotations directly defined by the element.  If there are
++   * no annotations directly associated with the element, then a zero-length
++   * array will be returned.  The returned array may be modified by the client
++   * code, but this will have no effect on the annotation content of this
++   * class, and hence no effect on the return value of this method for
++   * future callers.
++   *
++   * @return the annotations directly defined by the element.
++   * @since 1.5
++   */
++  native Annotation[] getDeclaredAnnotations();
++
+ }
+Index: vm/reference/java/lang/reflect/VMField.java
+===================================================================
+RCS file: /sources/classpath/classpath/vm/reference/java/lang/reflect/VMField.java,v
+retrieving revision 1.2
+diff -u -3 -p -u -r1.2 VMField.java
+--- vm/reference/java/lang/reflect/VMField.java	3 Mar 2008 21:21:32 -0000	1.2
++++ vm/reference/java/lang/reflect/VMField.java	5 Mar 2008 21:09:51 -0000
+@@ -38,6 +38,8 @@ exception statement from your version. *
+ 
+ package java.lang.reflect;
+ 
++import java.lang.annotation.Annotation;
++
+ final class VMField
+ {
+   Class declaringClass;
+@@ -514,4 +516,28 @@ final class VMField
+     return true;
+   }
+ 
++  /**
++   * Returns the element's annotation for the specified annotation type,
++   * or <code>null</code> if no such annotation exists.
++   *
++   * @param annotationClass the type of annotation to look for.
++   * @return this element's annotation for the specified type, or
++   *         <code>null</code> if no such annotation exists.
++   * @throws NullPointerException if the annotation class is <code>null</code>.
++   */
++  native Annotation getAnnotation(Class annotationClass);
++
++  /**
++   * Returns all annotations directly defined by the element.  If there are
++   * no annotations directly associated with the element, then a zero-length
++   * array will be returned.  The returned array may be modified by the client
++   * code, but this will have no effect on the annotation content of this
++   * class, and hence no effect on the return value of this method for
++   * future callers.
++   *
++   * @return the annotations directly defined by the element.
++   * @since 1.5
++   */
++  native Annotation[] getDeclaredAnnotations();
++
+ }
+Index: vm/reference/java/lang/reflect/VMMethod.java
+===================================================================
+RCS file: /sources/classpath/classpath/vm/reference/java/lang/reflect/VMMethod.java,v
+retrieving revision 1.2
+diff -u -3 -p -u -r1.2 VMMethod.java
+--- vm/reference/java/lang/reflect/VMMethod.java	3 Mar 2008 21:21:33 -0000	1.2
++++ vm/reference/java/lang/reflect/VMMethod.java	5 Mar 2008 21:09:51 -0000
+@@ -175,5 +175,29 @@ final class VMMethod
+     return true;
+   }
+ 
++  /**
++   * Returns the element's annotation for the specified annotation type,
++   * or <code>null</code> if no such annotation exists.
++   *
++   * @param annotationClass the type of annotation to look for.
++   * @return this element's annotation for the specified type, or
++   *         <code>null</code> if no such annotation exists.
++   * @throws NullPointerException if the annotation class is <code>null</code>.
++   */
++  native Annotation getAnnotation(Class annotationClass);
++
++  /**
++   * Returns all annotations directly defined by the element.  If there are
++   * no annotations directly associated with the element, then a zero-length
++   * array will be returned.  The returned array may be modified by the client
++   * code, but this will have no effect on the annotation content of this
++   * class, and hence no effect on the return value of this method for
++   * future callers.
++   *
++   * @return the annotations directly defined by the element.
++   * @since 1.5
++   */
++  native Annotation[] getDeclaredAnnotations();
++
+ }
+ 
Index: build/components/patches/classpath-web.RVM-385-04.patch
===================================================================
--- build/components/patches/classpath-web.RVM-385-04.patch	(revision 0)
+++ build/components/patches/classpath-web.RVM-385-04.patch	(revision 0)
@@ -0,0 +1,132 @@
+Index: java/lang/reflect/Constructor.java
+===================================================================
+RCS file: /sources/classpath/classpath/java/lang/reflect/Constructor.java,v
+retrieving revision 1.8
+diff -u -3 -p -u -r1.8 Constructor.java
+--- java/lang/reflect/Constructor.java	5 Mar 2008 21:16:37 -0000	1.8
++++ java/lang/reflect/Constructor.java	6 Mar 2008 19:30:59 -0000
+@@ -87,7 +87,7 @@ public final class Constructor<T>
+ 
+   private MethodSignatureParser p;
+ 
+-  private VMConstructor cons;
++  VMConstructor cons;
+ 
+   /**
+    * This class is uninstantiable outside this package.
+@@ -95,6 +95,7 @@ public final class Constructor<T>
+   Constructor(VMConstructor cons)
+   {
+     this.cons = cons;
++    cons.cons = this;
+   }
+ 
+   private Constructor()
+Index: java/lang/reflect/Field.java
+===================================================================
+RCS file: /sources/classpath/classpath/java/lang/reflect/Field.java,v
+retrieving revision 1.8
+diff -u -3 -p -u -r1.8 Field.java
+--- java/lang/reflect/Field.java	5 Mar 2008 21:16:37 -0000	1.8
++++ java/lang/reflect/Field.java	6 Mar 2008 19:30:59 -0000
+@@ -88,7 +88,7 @@ extends AccessibleObject implements Memb
+ 
+   private FieldSignatureParser p;
+ 
+-  private VMField f;
++  VMField f;
+ 
+   /**
+    * This class is uninstantiable outside the package.
+@@ -96,6 +96,7 @@ extends AccessibleObject implements Memb
+   Field(VMField f)
+   {
+     this.f = f;
++    f.f = this;
+   }
+ 
+   /**
+Index: java/lang/reflect/Method.java
+===================================================================
+RCS file: /sources/classpath/classpath/java/lang/reflect/Method.java,v
+retrieving revision 1.7
+diff -u -3 -p -u -r1.7 Method.java
+--- java/lang/reflect/Method.java	5 Mar 2008 21:16:37 -0000	1.7
++++ java/lang/reflect/Method.java	6 Mar 2008 19:30:59 -0000
+@@ -88,7 +88,7 @@ extends AccessibleObject implements Memb
+ 
+   private MethodSignatureParser p;
+ 
+-  private VMMethod m;
++  VMMethod m;
+ 
+   /**
+    * This class is uninstantiable outside this package.
+@@ -96,6 +96,7 @@ extends AccessibleObject implements Memb
+   Method(VMMethod m)
+   {
+     this.m = m;
++    m.m = this;
+   }
+ 
+   /**
+Index: vm/reference/java/lang/reflect/VMConstructor.java
+===================================================================
+RCS file: /sources/classpath/classpath/vm/reference/java/lang/reflect/VMConstructor.java,v
+retrieving revision 1.3
+diff -u -3 -p -u -r1.3 VMConstructor.java
+--- vm/reference/java/lang/reflect/VMConstructor.java	5 Mar 2008 21:16:38 -0000	1.3
++++ vm/reference/java/lang/reflect/VMConstructor.java	6 Mar 2008 19:31:09 -0000
+@@ -47,6 +47,12 @@ final class VMConstructor
+   Class clazz;
+   int slot;
+ 
++  /** 
++   * This field allows us to refer back to the main constructor instance.
++   *  It is set by the constructor of Constructor.
++   */
++  Constructor cons;
++
+   VMConstructor(Class clazz, int slot)
+   {
+     this.clazz = clazz;
+Index: vm/reference/java/lang/reflect/VMField.java
+===================================================================
+RCS file: /sources/classpath/classpath/vm/reference/java/lang/reflect/VMField.java,v
+retrieving revision 1.3
+diff -u -3 -p -u -r1.3 VMField.java
+--- vm/reference/java/lang/reflect/VMField.java	5 Mar 2008 21:16:38 -0000	1.3
++++ vm/reference/java/lang/reflect/VMField.java	6 Mar 2008 19:31:09 -0000
+@@ -45,6 +45,12 @@ final class VMField
+   Class declaringClass;
+   String name;
+   int slot;
++  
++  /** 
++   * This field allows us to refer back to the main constructor instance.
++   *  It is set by the constructor of Field.
++   */
++  Field f;
+ 
+   VMField(Class declaringClass, String name, int slot)
+   {
+Index: vm/reference/java/lang/reflect/VMMethod.java
+===================================================================
+RCS file: /sources/classpath/classpath/vm/reference/java/lang/reflect/VMMethod.java,v
+retrieving revision 1.3
+diff -u -3 -p -u -r1.3 VMMethod.java
+--- vm/reference/java/lang/reflect/VMMethod.java	5 Mar 2008 21:16:38 -0000	1.3
++++ vm/reference/java/lang/reflect/VMMethod.java	6 Mar 2008 19:31:09 -0000
+@@ -48,6 +48,12 @@ final class VMMethod
+   String name;
+   int slot;
+ 
++  /** 
++   * This field allows us to refer back to the main constructor instance.
++   *  It is set by the constructor of Field.
++   */
++  Method m;
++
+   public Class getDeclaringClass()
+   {
+     return declaringClass;
Index: rvm/src/org/jikesrvm/classloader/VM_AbstractMethod.java
===================================================================
--- rvm/src/org/jikesrvm/classloader/VM_AbstractMethod.java	(revision 14002)
+++ rvm/src/org/jikesrvm/classloader/VM_AbstractMethod.java	(working copy)
@@ -34,7 +34,7 @@ public final class VM_AbstractMethod ext
    */
   VM_AbstractMethod(VM_TypeReference declaringClass, VM_MemberReference memRef, short modifiers,
                     VM_TypeReference[] exceptionTypes, VM_Atom signature, VM_Annotation[] annotations,
-                    VM_Annotation[] parameterAnnotations, Object annotationDefault) {
+                    VM_Annotation[][] parameterAnnotations, Object annotationDefault) {
     super(declaringClass,
           memRef,
           modifiers,
Index: rvm/src/org/jikesrvm/classloader/VM_Class.java
===================================================================
--- rvm/src/org/jikesrvm/classloader/VM_Class.java	(revision 14002)
+++ rvm/src/org/jikesrvm/classloader/VM_Class.java	(working copy)
@@ -1474,7 +1474,7 @@ public final class VM_Class extends VM_T
       } else if (attName == VM_ClassLoader.signatureAttributeName) {
         signature = VM_Class.getUtf(constantPool, input.readUnsignedShort());
       } else if (attName == VM_ClassLoader.runtimeVisibleAnnotationsAttributeName) {
-        annotations = VM_AnnotatedElement.readAnnotations(constantPool, input, 2, typeRef.getClassLoader());
+        annotations = VM_AnnotatedElement.readAnnotations(constantPool, input, typeRef.getClassLoader());
       } else {
         input.skipBytes(attLength);
       }
Index: rvm/src/org/jikesrvm/classloader/VM_AnnotatedElement.java
===================================================================
--- rvm/src/org/jikesrvm/classloader/VM_AnnotatedElement.java	(revision 14002)
+++ rvm/src/org/jikesrvm/classloader/VM_AnnotatedElement.java	(working copy)
@@ -59,21 +59,12 @@ public abstract class VM_AnnotatedElemen
    * that's being constructed
    * @param input the DataInputStream to read the method's attributes
    * from
-   * @param numAnnotationBytes how many bytes are there in the number
-   * of annotations field? Normally 2, but parameter annotations just
-   * have 1.
    * @return an array of read annotations
    */
-  protected static VM_Annotation[] readAnnotations(int[] constantPool, DataInputStream input, int numAnnotationBytes,
+  protected static VM_Annotation[] readAnnotations(int[] constantPool, DataInputStream input,
                                                    ClassLoader classLoader) throws IOException {
     try {
-      int numAnnotations;
-      if (numAnnotationBytes == 2) {
-        numAnnotations = input.readUnsignedShort();
-      } else {
-        if (VM.VerifyAssertions) VM._assert(numAnnotationBytes == 1);
-        numAnnotations = input.readByte() & 0xFF;
-      }
+      int numAnnotations = input.readUnsignedShort();
       final VM_Annotation[] annotations = new VM_Annotation[numAnnotations];
       for (int j = 0; j < numAnnotations; j++) {
         annotations[j] = VM_Annotation.readAnnotation(constantPool, input, classLoader);
Index: rvm/src/org/jikesrvm/classloader/VM_NormalMethod.java
===================================================================
--- rvm/src/org/jikesrvm/classloader/VM_NormalMethod.java	(revision 14002)
+++ rvm/src/org/jikesrvm/classloader/VM_NormalMethod.java	(working copy)
@@ -150,7 +150,7 @@ public final class VM_NormalMethod exten
    */
   VM_NormalMethod(VM_TypeReference dc, VM_MemberReference mr, short mo, VM_TypeReference[] et, short lw, short ow,
                   byte[] bc, VM_ExceptionHandlerMap eMap, int[] lm, int[] constantPool, VM_Atom sig,
-                  VM_Annotation[] annotations, VM_Annotation[] parameterAnnotations, Object ad) {
+                  VM_Annotation[] annotations, VM_Annotation[][] parameterAnnotations, Object ad) {
     super(dc, mr, mo, et, sig, annotations, parameterAnnotations, ad);
     localWords = lw;
     operandWords = ow;
Index: rvm/src/org/jikesrvm/classloader/VM_Method.java
===================================================================
--- rvm/src/org/jikesrvm/classloader/VM_Method.java	(revision 14002)
+++ rvm/src/org/jikesrvm/classloader/VM_Method.java	(working copy)
@@ -12,8 +12,11 @@
  */
 package org.jikesrvm.classloader;
 
+import java.lang.annotation.Annotation;
+
 import java.io.DataInputStream;
 import java.io.IOException;
+
 import org.jikesrvm.ArchitectureSpecific.VM_CodeArray;
 import org.jikesrvm.ArchitectureSpecific.VM_LazyCompilationTrampoline;
 import org.jikesrvm.VM;
@@ -41,11 +44,11 @@ public abstract class VM_Method extends 
    */
   protected final VM_TypeReference[] exceptionTypes;
   /**
-   * Method paramter annotations from the class file that are
+   * Method parameter annotations from the class file that are
    * described as runtime visible. These annotations are available to
    * the reflection API.
    */
-  protected final VM_Annotation[] parameterAnnotations;
+  protected final VM_Annotation[][] parameterAnnotations;
   /**
    * A value present in the method info tables of annotation types. It
    * represents the default result from an annotation method.
@@ -57,6 +60,9 @@ public abstract class VM_Method extends 
    */
   private Offset jtocOffset;
 
+  /** Cached array of declared parameter annotations. */
+  private Annotation[][] declaredParameterAnnotations;
+
   /**
    * Construct a read method
    *
@@ -71,7 +77,7 @@ public abstract class VM_Method extends 
    */
   protected VM_Method(VM_TypeReference declaringClass, VM_MemberReference memRef, short modifiers,
                       VM_TypeReference[] exceptionTypes, VM_Atom signature, VM_Annotation[] annotations,
-                      VM_Annotation[] parameterAnnotations, Object annotationDefault) {
+                      VM_Annotation[][] parameterAnnotations, Object annotationDefault) {
     super(declaringClass, memRef, (short) (modifiers & APPLICABLE_TO_METHODS), signature, annotations);
     this.parameterAnnotations = parameterAnnotations;
     this.annotationDefault = annotationDefault;
@@ -99,7 +105,7 @@ public abstract class VM_Method extends 
     int[] tmp_lineNumberMap = null;
     VM_Atom tmp_signature = null;
     VM_Annotation[] annotations = null;
-    VM_Annotation[] parameterAnnotations = null;
+    VM_Annotation[][] parameterAnnotations = null;
     Object tmp_annotationDefault = null;
 
     // Read the attributes
@@ -148,10 +154,13 @@ public abstract class VM_Method extends 
       } else if (attName == VM_ClassLoader.signatureAttributeName) {
         tmp_signature = VM_Class.getUtf(constantPool, input.readUnsignedShort());
       } else if (attName == VM_ClassLoader.runtimeVisibleAnnotationsAttributeName) {
-        annotations = VM_AnnotatedElement.readAnnotations(constantPool, input, 2, declaringClass.getClassLoader());
+        annotations = VM_AnnotatedElement.readAnnotations(constantPool, input, declaringClass.getClassLoader());
       } else if (attName == VM_ClassLoader.runtimeVisibleParameterAnnotationsAttributeName) {
-        parameterAnnotations =
-            VM_AnnotatedElement.readAnnotations(constantPool, input, 1, declaringClass.getClassLoader());
+        int numParameters = input.readByte() & 0xFF;
+	parameterAnnotations = new VM_Annotation[numParameters][];
+	for (int a = 0; a < numParameters; ++a) {
+	  parameterAnnotations[a] = VM_AnnotatedElement.readAnnotations(constantPool, input, declaringClass.getClassLoader());
+	}
       } else if (attName == VM_ClassLoader.annotationDefaultAttributeName) {
         try {
           tmp_annotationDefault = VM_Annotation.readValue(constantPool, input, declaringClass.getClassLoader());
@@ -706,4 +715,17 @@ public abstract class VM_Method extends 
     }
     return jtocOffset;
   }
+
+  /**
+   * Returns the parameter annotations for this method.
+   */
+  public final Annotation[][] getDeclaredParameterAnnotations() {
+    if (declaredParameterAnnotations == null) {
+      declaredParameterAnnotations = new Annotation[parameterAnnotations.length][];
+      for (int a = 0; a < declaredParameterAnnotations.length; ++a)
+	declaredParameterAnnotations[a] = toAnnotations(parameterAnnotations[a]);
+    }
+    return declaredParameterAnnotations;
+  }
+
 }
Index: rvm/src/org/jikesrvm/classloader/VM_Field.java
===================================================================
--- rvm/src/org/jikesrvm/classloader/VM_Field.java	(revision 14002)
+++ rvm/src/org/jikesrvm/classloader/VM_Field.java	(working copy)
@@ -92,7 +92,7 @@ public final class VM_Field extends VM_M
       } else if (attName == VM_ClassLoader.signatureAttributeName) {
         signature = VM_Class.getUtf(constantPool, input.readUnsignedShort());
       } else if (attName == VM_ClassLoader.runtimeVisibleAnnotationsAttributeName) {
-        annotations = VM_AnnotatedElement.readAnnotations(constantPool, input, 2, declaringClass.getClassLoader());
+        annotations = VM_AnnotatedElement.readAnnotations(constantPool, input, declaringClass.getClassLoader());
       } else {
         // all other attributes are boring...
         input.skipBytes(attLength);
Index: rvm/src/org/jikesrvm/classloader/VM_NativeMethod.java
===================================================================
--- rvm/src/org/jikesrvm/classloader/VM_NativeMethod.java	(revision 14002)
+++ rvm/src/org/jikesrvm/classloader/VM_NativeMethod.java	(working copy)
@@ -55,7 +55,7 @@ public final class VM_NativeMethod exten
    */
   VM_NativeMethod(VM_TypeReference declaringClass, VM_MemberReference memRef, short modifiers,
                   VM_TypeReference[] exceptionTypes, VM_Atom signature, VM_Annotation[] annotations,
-                  VM_Annotation[] parameterAnnotations, Object annotationDefault) {
+                  VM_Annotation[][] parameterAnnotations, Object annotationDefault) {
     super(declaringClass,
           memRef,
           modifiers,

