summaryrefslogtreecommitdiffstats
path: root/dalvik/src
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-01-16 09:55:51 -0800
committerElliott Hughes <enh@google.com>2013-01-16 11:28:48 -0800
commit81abb6fb7332dfe62ff596ffb250d8aec61895df (patch)
treeca567d6c9faa65213dc1f0b560bd47f64f1a32ad /dalvik/src
parenta2b9e57099eaafd047495d89610a9614022737b7 (diff)
downloadlibcore-81abb6fb7332dfe62ff596ffb250d8aec61895df.zip
libcore-81abb6fb7332dfe62ff596ffb250d8aec61895df.tar.gz
libcore-81abb6fb7332dfe62ff596ffb250d8aec61895df.tar.bz2
More backwards compatibility for Facebook.
Another day, another private field accessed. Bug: 7726934 Change-Id: I1cf2e9b9c9c7c53afd43642fcbf8f1a1d203bf6c
Diffstat (limited to 'dalvik/src')
-rw-r--r--dalvik/src/main/java/dalvik/system/DexPathList.java20
1 files changed, 12 insertions, 8 deletions
diff --git a/dalvik/src/main/java/dalvik/system/DexPathList.java b/dalvik/src/main/java/dalvik/system/DexPathList.java
index 3088ca5..3d9ee3e 100644
--- a/dalvik/src/main/java/dalvik/system/DexPathList.java
+++ b/dalvik/src/main/java/dalvik/system/DexPathList.java
@@ -54,10 +54,14 @@ import static libcore.io.OsConstants.*;
/** class definition context */
private final ClassLoader definingContext;
- /** list of dex/resource (class path) elements */
- private final Element[] pathElements;
+ /**
+ * List of dex/resource (class path) elements.
+ * Should be called pathElements, but the Facebook app uses reflection
+ * to modify 'dexElements' (http://b/7726934).
+ */
+ private final Element[] dexElements;
- /** list of native library directory elements */
+ /** List of native library directories. */
private final File[] nativeLibraryDirectories;
/**
@@ -99,12 +103,12 @@ import static libcore.io.OsConstants.*;
}
this.definingContext = definingContext;
- this.pathElements = makeDexElements(splitDexPath(dexPath), optimizedDirectory);
+ this.dexElements = makeDexElements(splitDexPath(dexPath), optimizedDirectory);
this.nativeLibraryDirectories = splitLibraryPath(libraryPath);
}
@Override public String toString() {
- return "DexPathList[pathElements=" + Arrays.toString(pathElements) +
+ return "DexPathList[" + Arrays.toString(dexElements) +
",nativeLibraryDirectories=" + Arrays.toString(nativeLibraryDirectories) + "]";
}
@@ -302,7 +306,7 @@ import static libcore.io.OsConstants.*;
* found in any of the dex files
*/
public Class findClass(String name) {
- for (Element element : pathElements) {
+ for (Element element : dexElements) {
DexFile dex = element.dexFile;
if (dex != null) {
@@ -325,7 +329,7 @@ import static libcore.io.OsConstants.*;
* resource is not found in any of the zip/jar files
*/
public URL findResource(String name) {
- for (Element element : pathElements) {
+ for (Element element : dexElements) {
URL url = element.findResource(name);
if (url != null) {
return url;
@@ -343,7 +347,7 @@ import static libcore.io.OsConstants.*;
public Enumeration<URL> findResources(String name) {
ArrayList<URL> result = new ArrayList<URL>();
- for (Element element : pathElements) {
+ for (Element element : dexElements) {
URL url = element.findResource(name);
if (url != null) {
result.add(url);