From dc7bf5d8bff86bed7947806c81a28aff5e9a8c3e Mon Sep 17 00:00:00 2001 From: Andy McFadden Date: Mon, 23 Jan 2012 09:48:53 -0800 Subject: Don't use bootstrap loader directly The VM is allowed to use null to represent the bootstrap class loader, so attempting to call methods on it is a bad idea. Use the system class loader instead. Change-Id: I9190848945f679d546d5fb30aba10fd27c7e5404 --- core/java/com/android/internal/os/ZygoteInit.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java index 9c45dc64f469..6a99a2bb3473 100644 --- a/core/java/com/android/internal/os/ZygoteInit.java +++ b/core/java/com/android/internal/os/ZygoteInit.java @@ -243,7 +243,7 @@ public class ZygoteInit { private static void preloadClasses() { final VMRuntime runtime = VMRuntime.getRuntime(); - InputStream is = ZygoteInit.class.getClassLoader().getResourceAsStream( + InputStream is = ClassLoader.getSystemClassLoader().getResourceAsStream( PRELOADED_CLASSES); if (is == null) { Log.e(TAG, "Couldn't find " + PRELOADED_CLASSES + "."); -- cgit v1.2.3-59-g8ed1b