summaryrefslogtreecommitdiffstats
path: root/dalvik/src
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-02-05 01:06:30 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-02-05 01:06:30 +0000
commit089ca43a60000659c3588b04e9ada55c9b0bf8f9 (patch)
tree55511d368f315d0b8e20f9ded4466179d5dea23e /dalvik/src
parentbfb883abadbf7e914cdac55d22d28a1c8286979b (diff)
parent6b9829917263ba6ccc8d725d730316bb36c0fc78 (diff)
downloadlibcore-089ca43a60000659c3588b04e9ada55c9b0bf8f9.zip
libcore-089ca43a60000659c3588b04e9ada55c9b0bf8f9.tar.gz
libcore-089ca43a60000659c3588b04e9ada55c9b0bf8f9.tar.bz2
Merge "Switch libcore over to a long in DexFile."
Diffstat (limited to 'dalvik/src')
-rw-r--r--dalvik/src/main/java/dalvik/system/DexFile.java27
1 files changed, 9 insertions, 18 deletions
diff --git a/dalvik/src/main/java/dalvik/system/DexFile.java b/dalvik/src/main/java/dalvik/system/DexFile.java
index d2fd5da..5d38f2c 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.StructStat;
* read-only by the VM.
*/
public final class DexFile {
- private int mCookie;
+ private long mCookie;
private final String mFileName;
private final CloseGuard guard = CloseGuard.get();
@@ -215,7 +215,7 @@ public final class DexFile {
return defineClass(name, loader, mCookie, suppressed);
}
- private static Class defineClass(String name, ClassLoader loader, int cookie,
+ private static Class defineClass(String name, ClassLoader loader, long cookie,
List<Throwable> suppressed) {
Class result = null;
try {
@@ -232,9 +232,6 @@ public final class DexFile {
return result;
}
- private static native Class defineClassNative(String name, ClassLoader loader, int cookie)
- throws ClassNotFoundException, NoClassDefFoundError;
-
/**
* Enumerate the names of the classes in this DEX file.
*
@@ -266,9 +263,6 @@ public final class DexFile {
}
}
- /* return a String array with class names */
- native private static String[] getClassNameList(int cookie);
-
/**
* Called when the class is finalized. Makes sure the DEX file is closed.
*
@@ -291,20 +285,17 @@ public final class DexFile {
* Open a DEX file. The value returned is a magic VM cookie. On
* failure, an IOException is thrown.
*/
- private static int openDexFile(String sourceName, String outputName,
- int flags) throws IOException {
+ private static long openDexFile(String sourceName, String outputName, int flags) throws IOException {
return openDexFileNative(new File(sourceName).getCanonicalPath(),
(outputName == null) ? null : new File(outputName).getCanonicalPath(),
flags);
}
- native private static int openDexFileNative(String sourceName, String outputName,
- int flags) throws IOException;
-
- /*
- * Close DEX file.
- */
- native private static void closeDexFile(int cookie);
+ private static native void closeDexFile(long cookie);
+ private static native Class defineClassNative(String name, ClassLoader loader, long cookie)
+ throws ClassNotFoundException, NoClassDefFoundError;
+ private static native String[] getClassNameList(long cookie);
+ private static native long openDexFileNative(String sourceName, String outputName, int flags);
/**
* Returns true if the VM believes that the apk/jar file is out of date
@@ -320,6 +311,6 @@ public final class DexFile {
* @throws dalvik.system.StaleDexCacheError if the optimized dex file
* is stale but exists on a read-only partition.
*/
- native public static boolean isDexOptNeeded(String fileName)
+ public static native boolean isDexOptNeeded(String fileName)
throws FileNotFoundException, IOException;
}