emul/src/main/java/java/lang/Class.java
changeset 420 3497ecd097df
parent 400 5452b9fbd253
child 424 aef4fd91e99c
     1.1 --- a/emul/src/main/java/java/lang/Class.java	Mon Dec 31 12:44:51 2012 +0100
     1.2 +++ b/emul/src/main/java/java/lang/Class.java	Tue Jan 08 16:32:11 2013 +0100
     1.3 @@ -788,10 +788,18 @@
     1.4       * @since JDK1.1
     1.5       */
     1.6      public Method getMethod(String name, Class<?>... parameterTypes)
     1.7 -        throws SecurityException {
     1.8 +        throws SecurityException, NoSuchMethodException {
     1.9          Method m = MethodImpl.findMethod(this, name, parameterTypes);
    1.10          if (m == null) {
    1.11 -            throw new SecurityException(); // XXX: NoSuchMethodException
    1.12 +            StringBuilder sb = new StringBuilder();
    1.13 +            sb.append(getName()).append('.').append(name).append('(');
    1.14 +            String sep = "";
    1.15 +            for (int i = 0; i < parameterTypes.length; i++) {
    1.16 +                sb.append(sep).append(parameterTypes[i].getName());
    1.17 +                sep = ", ";
    1.18 +            }
    1.19 +            sb.append(')');
    1.20 +            throw new NoSuchMethodException(sb.toString());
    1.21          }
    1.22          return m;
    1.23      }