summaryrefslogtreecommitdiffstats
path: root/dalvik
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2015-02-25 17:38:07 -0800
committerAndreas Gampe <agampe@google.com>2015-02-25 17:38:07 -0800
commit25ac148a433feee2972fb01655a3f7ed4956c1f8 (patch)
treeba2cbee16d66edb6cd16c04d72fde0603b99f06c /dalvik
parentb87a2c8e03bb12e89e41a8284ae6c8c6941c78fa (diff)
downloadlibcore-25ac148a433feee2972fb01655a3f7ed4956c1f8.zip
libcore-25ac148a433feee2972fb01655a3f7ed4956c1f8.tar.gz
libcore-25ac148a433feee2972fb01655a3f7ed4956c1f8.tar.bz2
Libcore: Change DexFile cookie to object
Use an object field instead of long for the cookie. Change-Id: If3c2b31b9d0914ed1965cfd5e3fdb94ea41b1477
Diffstat (limited to 'dalvik')
-rw-r--r--dalvik/src/main/java/dalvik/system/DexFile.java18
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