Anonymous avatar Anonymous committed 0cfd9bc

Stop Facebook crashing with NoSuchFieldException.

The Facebook app uses reflection to access a private field of
BaseDexClassLoader, and won't start if we rename that field.

Bug: 7726934
Change-Id: I0b8febed1226655dbfeb5d1a539734b860558df4

Comments (0)

Files changed (1)

dalvik/src/main/java/dalvik/system/BaseDexClassLoader.java

  * {@link ClassLoader} implementations.
  */
 public class BaseDexClassLoader extends ClassLoader {
-    private final DexPathList path;
+    private final DexPathList pathList;
 
     /**
      * Constructs an instance.
     public BaseDexClassLoader(String dexPath, File optimizedDirectory,
             String libraryPath, ClassLoader parent) {
         super(parent);
-        this.path = new DexPathList(this, dexPath, libraryPath, optimizedDirectory);
+        this.pathList = new DexPathList(this, dexPath, libraryPath, optimizedDirectory);
     }
 
     @Override
     protected Class<?> findClass(String name) throws ClassNotFoundException {
-        Class c = path.findClass(name);
+        Class c = pathList.findClass(name);
         if (c == null) {
-            throw new ClassNotFoundException("Didn't find class \"" + name + "\" on path: " + path);
+            throw new ClassNotFoundException("Didn't find class \"" + name + "\" on path: " + pathList);
         }
         return c;
     }
 
     @Override
     protected URL findResource(String name) {
-        return path.findResource(name);
+        return pathList.findResource(name);
     }
 
     @Override
     protected Enumeration<URL> findResources(String name) {
-        return path.findResources(name);
+        return pathList.findResources(name);
     }
 
     @Override
     public String findLibrary(String name) {
-        return path.findLibrary(name);
+        return pathList.findLibrary(name);
     }
 
     /**
      */
     public String getLdLibraryPath() {
         StringBuilder result = new StringBuilder();
-        for (File directory : path.getNativeLibraryDirectories()) {
+        for (File directory : pathList.getNativeLibraryDirectories()) {
             if (result.length() > 0) {
                 result.append(':');
             }
     }
 
     @Override public String toString() {
-        return getClass().getName() + "[" + path + "]";
+        return getClass().getName() + "[" + pathList + "]";
     }
 }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.