From 0f61ce9a6ff708bb0619ba2ad07d26b0ff579060 Mon Sep 17 00:00:00 2001 From: Izzat Bahadirov Date: Mon, 29 Apr 2013 17:02:14 -0400 Subject: [PATCH] Fix for broken tests. --- .../java/org/jf/dexlib2/analysis/ClassPath.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/dexlib2/src/main/java/org/jf/dexlib2/analysis/ClassPath.java b/dexlib2/src/main/java/org/jf/dexlib2/analysis/ClassPath.java index 7ff939e9..22c55fff 100644 --- a/dexlib2/src/main/java/org/jf/dexlib2/analysis/ClassPath.java +++ b/dexlib2/src/main/java/org/jf/dexlib2/analysis/ClassPath.java @@ -62,20 +62,21 @@ public class ClassPath { * * @param classPath An array of DexFile objects. When loading a class, these dex files will be searched in order */ - public ClassPath(int api, DexFile... classPath) throws IOException { - this(api, classPath, true); + public ClassPath(DexFile... classPath) throws IOException { + this(classPath, true, 15); } /** * Creates a new ClassPath instance that can load classes from the given dex files * * @param classPath An iterable of DexFile objects. When loading a class, these dex files will be searched in order + * @param api API level */ - public ClassPath(int api, Iterable classPath) { - this(api, Iterables.toArray(classPath, DexFile.class), false); + public ClassPath(Iterable classPath, int api) { + this(Iterables.toArray(classPath, DexFile.class), false, api); } - private ClassPath(int api, @Nonnull DexFile[] classPath, boolean copyArray) { + private ClassPath(@Nonnull DexFile[] classPath, boolean copyArray, int api) { if (copyArray) { dexFiles = new DexFile[classPath.length+1]; System.arraycopy(classPath, 0, dexFiles, 0, classPath.length); @@ -165,7 +166,7 @@ public class ClassPath { dexFiles.add(loadClassPathEntry(classPathDirs, classPathEntry, api)); } dexFiles.add(dexFile); - return new ClassPath(api, dexFiles); + return new ClassPath(dexFiles, api); } private static final Pattern dalvikCacheOdexPattern = Pattern.compile("@([^@]+)@classes.dex$");