diff options
author | 2016-07-18 08:27:23 -0700 | |
---|---|---|
committer | 2016-07-22 20:37:07 -0700 | |
commit | 166aaee6aa39c20c87113b3fcf0dcd81e0a934cb (patch) | |
tree | 70ab523f146d164ece8a0e94dbc499783005e3dc /test/138-duplicate-classes-check2/src/FancyLoader.java | |
parent | 115c1de1f812d380449ef89cfe50cc4fb4289275 (diff) |
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
Diffstat (limited to 'test/138-duplicate-classes-check2/src/FancyLoader.java')
-rw-r--r-- | test/138-duplicate-classes-check2/src/FancyLoader.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/test/138-duplicate-classes-check2/src/FancyLoader.java b/test/138-duplicate-classes-check2/src/FancyLoader.java index 7e2bb08a5c..58b7ec49d3 100644 --- a/test/138-duplicate-classes-check2/src/FancyLoader.java +++ b/test/138-duplicate-classes-check2/src/FancyLoader.java @@ -42,7 +42,7 @@ public class FancyLoader extends ClassLoader { "/138-duplicate-classes-check2-ex.jar"; /* on Dalvik, this is a DexFile; otherwise, it's null */ - private Class mDexClass; + private Class<?> mDexClass; private Object mDexFile; @@ -83,12 +83,12 @@ public class FancyLoader extends ClassLoader { if (mDexFile == null) { synchronized (FancyLoader.class) { - Constructor ctor; + Constructor<?> ctor; /* * Construct a DexFile object through reflection. */ try { - ctor = mDexClass.getConstructor(new Class[] {String.class}); + ctor = mDexClass.getConstructor(String.class); } catch (NoSuchMethodException nsme) { throw new ClassNotFoundException("getConstructor failed", nsme); @@ -112,8 +112,7 @@ public class FancyLoader extends ClassLoader { Method meth; try { - meth = mDexClass.getMethod("loadClass", - new Class[] { String.class, ClassLoader.class }); + meth = mDexClass.getMethod("loadClass", String.class, ClassLoader.class); } catch (NoSuchMethodException nsme) { throw new ClassNotFoundException("getMethod failed", nsme); } @@ -185,7 +184,7 @@ public class FancyLoader extends ClassLoader { protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException { - Class res; + Class<?> res; /* * 1. Invoke findLoadedClass(String) to check if the class has |