ART: Fix type parameter in tests
Move Class to Class<?>, Constructor to Constructor<?>, and in
general clean up reflection.
Test: m test-art-host-run-test
Change-Id: I3a4223ee8d14d032015edf34bf27135757f7138c
diff --git a/test/044-proxy/src/BasicTest.java b/test/044-proxy/src/BasicTest.java
index 445a6cc..5f04b93 100644
--- a/test/044-proxy/src/BasicTest.java
+++ b/test/044-proxy/src/BasicTest.java
@@ -99,18 +99,16 @@
InvocationHandler handler = new MyInvocationHandler(proxyMe);
/* create the proxy class */
- Class proxyClass = Proxy.getProxyClass(Shapes.class.getClassLoader(),
- new Class[] { Quads.class, Colors.class, Trace.class });
+ Class<?> proxyClass = Proxy.getProxyClass(Shapes.class.getClassLoader(),
+ Quads.class, Colors.class, Trace.class);
Main.registerProxyClassName(proxyClass.getCanonicalName());
/* create a proxy object, passing the handler object in */
Object proxy = null;
try {
- Constructor<Class> cons;
- cons = proxyClass.getConstructor(
- new Class[] { InvocationHandler.class });
+ Constructor<?> cons = proxyClass.getConstructor(InvocationHandler.class);
//System.out.println("Constructor is " + cons);
- proxy = cons.newInstance(new Object[] { handler });
+ proxy = cons.newInstance(handler);
} catch (NoSuchMethodException nsme) {
System.err.println("failed: " + nsme);
} catch (InstantiationException ie) {
diff --git a/test/044-proxy/src/Clash.java b/test/044-proxy/src/Clash.java
index adeffdc..d000112 100644
--- a/test/044-proxy/src/Clash.java
+++ b/test/044-proxy/src/Clash.java
@@ -30,7 +30,7 @@
/* try passing in the same interface twice */
try {
Proxy.newProxyInstance(Clash.class.getClassLoader(),
- new Class[] { Interface1A.class, Interface1A.class },
+ new Class<?>[] { Interface1A.class, Interface1A.class },
handler);
System.err.println("Dupe did not throw expected exception");
} catch (IllegalArgumentException iae) {
@@ -39,7 +39,7 @@
try {
Proxy.newProxyInstance(Clash.class.getClassLoader(),
- new Class[] { Interface1A.class, Interface1B.class },
+ new Class<?>[] { Interface1A.class, Interface1B.class },
handler);
System.err.println("Clash did not throw expected exception");
} catch (IllegalArgumentException iae) {
diff --git a/test/044-proxy/src/Clash2.java b/test/044-proxy/src/Clash2.java
index 2a384f4..e405cfe 100644
--- a/test/044-proxy/src/Clash2.java
+++ b/test/044-proxy/src/Clash2.java
@@ -29,7 +29,7 @@
try {
Proxy.newProxyInstance(Clash.class.getClassLoader(),
- new Class[] { Interface2A.class, Interface2B.class },
+ new Class<?>[] { Interface2A.class, Interface2B.class },
handler);
System.err.println("Clash2 did not throw expected exception");
} catch (IllegalArgumentException iae) {
diff --git a/test/044-proxy/src/Clash3.java b/test/044-proxy/src/Clash3.java
index 6d6f2f2..44806ce 100644
--- a/test/044-proxy/src/Clash3.java
+++ b/test/044-proxy/src/Clash3.java
@@ -29,7 +29,7 @@
try {
Proxy.newProxyInstance(Clash.class.getClassLoader(),
- new Class[] {
+ new Class<?>[] {
Interface3a.class,
Interface3base.class,
Interface3aa.class,
diff --git a/test/044-proxy/src/Clash4.java b/test/044-proxy/src/Clash4.java
index 1bfb37f..ca5c3ab 100644
--- a/test/044-proxy/src/Clash4.java
+++ b/test/044-proxy/src/Clash4.java
@@ -29,7 +29,7 @@
try {
Proxy.newProxyInstance(Clash.class.getClassLoader(),
- new Class[] {
+ new Class<?>[] {
Interface4a.class,
Interface4aa.class,
Interface4base.class,
diff --git a/test/044-proxy/src/FloatSelect.java b/test/044-proxy/src/FloatSelect.java
index febe697..217ccaf 100644
--- a/test/044-proxy/src/FloatSelect.java
+++ b/test/044-proxy/src/FloatSelect.java
@@ -34,7 +34,7 @@
public static void main(String[] args) {
FloatSelectI proxyObject = (FloatSelectI) Proxy.newProxyInstance(
FloatSelectI.class.getClassLoader(),
- new Class[] { FloatSelectI.class },
+ new Class<?>[] { FloatSelectI.class },
new FloatSelectIInvoke1());
float floatResult = proxyObject.method(2.1f, 5.8f);
diff --git a/test/044-proxy/src/NativeProxy.java b/test/044-proxy/src/NativeProxy.java
index b425da8..c609dc2 100644
--- a/test/044-proxy/src/NativeProxy.java
+++ b/test/044-proxy/src/NativeProxy.java
@@ -40,7 +40,7 @@
try {
NativeInterface inf = (NativeInterface)Proxy.newProxyInstance(
NativeProxy.class.getClassLoader(),
- new Class[] { NativeInterface.class },
+ new Class<?>[] { NativeInterface.class },
new NativeInvocationHandler());
nativeCall(inf);
diff --git a/test/044-proxy/src/ReturnsAndArgPassing.java b/test/044-proxy/src/ReturnsAndArgPassing.java
index 225cc5b..3d8ebf0 100644
--- a/test/044-proxy/src/ReturnsAndArgPassing.java
+++ b/test/044-proxy/src/ReturnsAndArgPassing.java
@@ -98,7 +98,7 @@
MyInvocationHandler myHandler = new MyInvocationHandler();
MyInterface proxyMyInterface =
(MyInterface)Proxy.newProxyInstance(ReturnsAndArgPassing.class.getClassLoader(),
- new Class[] { MyInterface.class },
+ new Class<?>[] { MyInterface.class },
myHandler);
check(fooInvocations == 0);
proxyMyInterface.voidFoo();
@@ -441,7 +441,7 @@
MyInvocationHandler myHandler = new MyInvocationHandler();
MyInterface proxyMyInterface =
(MyInterface)Proxy.newProxyInstance(ReturnsAndArgPassing.class.getClassLoader(),
- new Class[] { MyInterface.class },
+ new Class<?>[] { MyInterface.class },
myHandler);
check((Integer)proxyMyInterface.selectArg(0, Integer.MAX_VALUE, Long.MAX_VALUE,
diff --git a/test/044-proxy/src/WrappedThrow.java b/test/044-proxy/src/WrappedThrow.java
index 27ae84e..643ba05 100644
--- a/test/044-proxy/src/WrappedThrow.java
+++ b/test/044-proxy/src/WrappedThrow.java
@@ -32,7 +32,7 @@
try {
proxy = Proxy.newProxyInstance(WrappedThrow.class.getClassLoader(),
- new Class[] { InterfaceW1.class, InterfaceW2.class },
+ new Class<?>[] { InterfaceW1.class, InterfaceW2.class },
handler);
} catch (IllegalArgumentException iae) {
System.out.println("WT init failed");