OSDN Git Service

LayoutLib: Skip classes from java package. [DO NOT MERGE]
authorDeepanshu Gupta <deepanshu@google.com>
Mon, 1 Jun 2015 21:21:24 +0000 (14:21 -0700)
committerDeepanshu Gupta <deepanshu@google.com>
Tue, 25 Aug 2015 19:06:49 +0000 (12:06 -0700)
Classes in "java" package can't be defined at runtime anyway. No use
including them in LayoutLib.

Change-Id: I7e7c46f0d74e32c893b23093828569b4fa5e3a73
(cherry picked from commit 86caef1892e1ce063e0e880396c8deaa3a6a171d)

tools/layoutlib/create/src/com/android/tools/layoutlib/create/DependencyFinder.java

index 7690fcd..61b64a2 100644 (file)
@@ -307,7 +307,9 @@ public class DependencyFinder {
 
             try {
                 // exclude classes that are part of the default JRE (the one executing this program)
-                if (getClass().getClassLoader().loadClass(className) != null) {
+                // or in java package (we won't be able to load them anyway).
+                if (className.startsWith("java.") ||
+                        getClass().getClassLoader().loadClass(className) != null) {
                     return;
                 }
             } catch (ClassNotFoundException e) {