diff options
author | Andreas Gampe <agampe@google.com> | 2015-03-02 21:00:37 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-03-02 21:00:37 +0000 |
commit | 416adb0c5a6521c48fd3cf7c120c4f2c609bccb8 (patch) | |
tree | af93e0f707c98b675593695fcd04c998e51abcc4 | |
parent | 7775ae57db6918c270285539408d384ceed117f0 (diff) | |
parent | f94993c756f36e2b4b1f776264bb6aca4e799a7b (diff) | |
download | libcore-416adb0c5a6521c48fd3cf7c120c4f2c609bccb8.zip libcore-416adb0c5a6521c48fd3cf7c120c4f2c609bccb8.tar.gz libcore-416adb0c5a6521c48fd3cf7c120c4f2c609bccb8.tar.bz2 |
am f94993c7: Merge "Libcore: Change DexFile cookie to object"
* commit 'f94993c756f36e2b4b1f776264bb6aca4e799a7b':
Libcore: Change DexFile cookie to object
-rw-r--r-- | dalvik/src/main/java/dalvik/system/DexFile.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/dalvik/src/main/java/dalvik/system/DexFile.java b/dalvik/src/main/java/dalvik/system/DexFile.java index 86bb531..3ffd634 100644 --- a/dalvik/src/main/java/dalvik/system/DexFile.java +++ b/dalvik/src/main/java/dalvik/system/DexFile.java @@ -34,7 +34,7 @@ import libcore.io.Libcore; * read-only by the VM. */ public final class DexFile { - private long mCookie; + private Object mCookie; private final String mFileName; private final CloseGuard guard = CloseGuard.get(); @@ -175,10 +175,10 @@ public final class DexFile { * normally should not happen */ public void close() throws IOException { - if (mCookie != 0) { + if (mCookie != null) { guard.close(); closeDexFile(mCookie); - mCookie = 0; + mCookie = null; } } @@ -219,7 +219,7 @@ public final class DexFile { return defineClass(name, loader, mCookie, suppressed); } - private static Class defineClass(String name, ClassLoader loader, long cookie, + private static Class defineClass(String name, ClassLoader loader, Object cookie, List<Throwable> suppressed) { Class result = null; try { @@ -290,22 +290,22 @@ public final class DexFile { * Open a DEX file. The value returned is a magic VM cookie. On * failure, an IOException is thrown. */ - private static long openDexFile(String sourceName, String outputName, int flags) throws IOException { + private static Object openDexFile(String sourceName, String outputName, int flags) throws IOException { // Use absolute paths to enable the use of relative paths when testing on host. return openDexFileNative(new File(sourceName).getAbsolutePath(), (outputName == null) ? null : new File(outputName).getAbsolutePath(), flags); } - private static native void closeDexFile(long cookie); - private static native Class defineClassNative(String name, ClassLoader loader, long cookie) + private static native void closeDexFile(Object cookie); + private static native Class defineClassNative(String name, ClassLoader loader, Object cookie) throws ClassNotFoundException, NoClassDefFoundError; - private static native String[] getClassNameList(long cookie); + private static native String[] getClassNameList(Object cookie); /* * Open a DEX file. The value returned is a magic VM cookie. On * failure, an IOException is thrown. */ - private static native long openDexFileNative(String sourceName, String outputName, int flags); + private static native Object openDexFileNative(String sourceName, String outputName, int flags); /** * Returns true if the VM believes that the apk/jar file is out of date |