Making reflection with array parameters working
authorJaroslav Tulach <jaroslav.tulach@apidesign.org>
Mon, 21 Oct 2013 09:45:09 +0200
changeset 13768e600271bba1
parent 1375 a6c71e376889
child 1377 5e8f58b48380
Making reflection with array parameters working
rt/emul/compact/src/test/java/org/apidesign/bck2brwsr/tck/ReflectionTest.java
rt/emul/mini/src/main/java/java/lang/reflect/Array.java
     1.1 --- a/rt/emul/compact/src/test/java/org/apidesign/bck2brwsr/tck/ReflectionTest.java	Sun Oct 20 20:36:03 2013 +0200
     1.2 +++ b/rt/emul/compact/src/test/java/org/apidesign/bck2brwsr/tck/ReflectionTest.java	Mon Oct 21 09:45:09 2013 +0200
     1.3 @@ -21,6 +21,7 @@
     1.4  import java.lang.annotation.RetentionPolicy;
     1.5  import java.lang.reflect.Constructor;
     1.6  import java.lang.reflect.Method;
     1.7 +import java.lang.reflect.Proxy;
     1.8  import java.util.Arrays;
     1.9  import java.util.Collections;
    1.10  import java.util.List;
    1.11 @@ -82,6 +83,10 @@
    1.12          return Integer.class.getConstructor(int.class).newInstance(10).toString();
    1.13      }
    1.14      
    1.15 +    @Compare public String getMethodWithArray() throws Exception {
    1.16 +        return Proxy.class.getMethod("getProxyClass", ClassLoader.class, Class[].class).getName();
    1.17 +    }
    1.18 +    
    1.19      @Compare public String namesOfMethods() {
    1.20          StringBuilder sb = new StringBuilder();
    1.21          String[] arr = new String[20];
     2.1 --- a/rt/emul/mini/src/main/java/java/lang/reflect/Array.java	Sun Oct 20 20:36:03 2013 +0200
     2.2 +++ b/rt/emul/mini/src/main/java/java/lang/reflect/Array.java	Mon Oct 21 09:45:09 2013 +0200
     2.3 @@ -106,7 +106,7 @@
     2.4          if (type.getName().equals("void")) {
     2.5              throw new IllegalStateException("Can't create array for " + type);
     2.6          }
     2.7 -        return "[L" + type.getName() + ";";
     2.8 +        return "[L" + type.getName().replace('.', '/') + ";";
     2.9      }
    2.10      /**
    2.11       * Creates a new array