summaryrefslogtreecommitdiff
path: root/test/071-dexfile/src/Main.java
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2016-07-18 08:27:23 -0700
committer Andreas Gampe <agampe@google.com> 2016-07-22 20:37:07 -0700
commit166aaee6aa39c20c87113b3fcf0dcd81e0a934cb (patch)
tree70ab523f146d164ece8a0e94dbc499783005e3dc /test/071-dexfile/src/Main.java
parent115c1de1f812d380449ef89cfe50cc4fb4289275 (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/071-dexfile/src/Main.java')
-rw-r--r--test/071-dexfile/src/Main.java19
1 files changed, 11 insertions, 8 deletions
diff --git a/test/071-dexfile/src/Main.java b/test/071-dexfile/src/Main.java
index 2f85790175..c3a96715c2 100644
--- a/test/071-dexfile/src/Main.java
+++ b/test/071-dexfile/src/Main.java
@@ -66,7 +66,7 @@ public class Main {
*/
private static void testDexClassLoader() throws Exception {
ClassLoader dexClassLoader = getDexClassLoader();
- Class Another = dexClassLoader.loadClass("Another");
+ Class<?> Another = dexClassLoader.loadClass("Another");
Object another = Another.newInstance();
// not expected to work; just exercises the call
dexClassLoader.getResource("nonexistent");
@@ -79,18 +79,21 @@ public class Main {
*/
private static ClassLoader getDexClassLoader() throws Exception {
ClassLoader classLoader = Main.class.getClassLoader();
- Class DexClassLoader = classLoader.loadClass("dalvik.system.DexClassLoader");
- Constructor DexClassLoader_init = DexClassLoader.getConstructor(String.class,
- String.class,
- String.class,
- ClassLoader.class);
+ Class<?> DexClassLoader = classLoader.loadClass("dalvik.system.DexClassLoader");
+ Constructor<?> DexClassLoader_init = DexClassLoader.getConstructor(String.class,
+ String.class,
+ String.class,
+ ClassLoader.class);
// create an instance, using the path we found
- return (ClassLoader) DexClassLoader_init.newInstance(CLASS_PATH, getOdexDir(), LIB_DIR, classLoader);
+ return (ClassLoader) DexClassLoader_init.newInstance(CLASS_PATH,
+ getOdexDir(),
+ LIB_DIR,
+ classLoader);
}
private static void testDexFile() throws Exception {
ClassLoader classLoader = Main.class.getClassLoader();
- Class DexFile = classLoader.loadClass("dalvik.system.DexFile");
+ Class<?> DexFile = classLoader.loadClass("dalvik.system.DexFile");
Method DexFile_loadDex = DexFile.getMethod("loadDex",
String.class,
String.class,