Loading tools/preload-check/device/src/com/android/preload/check/Initialized.java +3 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ package com.android.preload.check; /** * Test that the given boot classpath class is initialized. */ public class Initialized { public static void main(String[] args) throws Exception { Util.assertInitialized(args[0], null); Loading tools/preload-check/device/src/com/android/preload/check/IntegrityCheck.java +5 −1 Original line number Diff line number Diff line Loading @@ -16,13 +16,16 @@ package com.android.preload.check; /** * Test that a helper class is first seen as uninitialized, then initialized after forced. */ public class IntegrityCheck { public static void main(String[] args) throws Exception { ClassLoader loader = IntegrityCheck.class.getClassLoader(); Util.assertNotInitialized("com.android.preload.check.IntegrityCheck$StatusHelper", loader); Class<?> klass = Class.forName("com.android.preload.check.IntegrityCheck$StatusHelper", Class.forName("com.android.preload.check.IntegrityCheck$StatusHelper", /* initialize */ true, loader); Util.assertInitialized("com.android.preload.check.IntegrityCheck$StatusHelper", loader); Loading @@ -30,6 +33,7 @@ public class IntegrityCheck { System.out.println("OK"); } @SuppressWarnings("unused") private static class StatusHelper { private final static Object defer = new Object(); } Loading tools/preload-check/device/src/com/android/preload/check/NotInitialized.java +3 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ package com.android.preload.check; /** * Test that the given boot classpath class is not initialized. */ public class NotInitialized { public static void main(String[] args) throws Exception { Util.assertNotInitialized(args[0], null); Loading tools/preload-check/device/src/com/android/preload/check/NotInitializedRegex.java +8 −0 Original line number Diff line number Diff line Loading @@ -23,7 +23,15 @@ import java.util.Enumeration; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * Test boot classpath classes that satisfy a given regular expression to be not initialized. * Optionally check that at least one class was matched. */ public class NotInitializedRegex { /** * First arg (mandatory): regular exception. Second arg (optional): boolean to denote a * required match. */ public static void main(String[] args) throws Exception { Matcher m = Pattern.compile(args[0]).matcher(""); boolean requiresMatch = args.length > 1 ? Boolean.parseBoolean(args[1]) : false; Loading Loading
tools/preload-check/device/src/com/android/preload/check/Initialized.java +3 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ package com.android.preload.check; /** * Test that the given boot classpath class is initialized. */ public class Initialized { public static void main(String[] args) throws Exception { Util.assertInitialized(args[0], null); Loading
tools/preload-check/device/src/com/android/preload/check/IntegrityCheck.java +5 −1 Original line number Diff line number Diff line Loading @@ -16,13 +16,16 @@ package com.android.preload.check; /** * Test that a helper class is first seen as uninitialized, then initialized after forced. */ public class IntegrityCheck { public static void main(String[] args) throws Exception { ClassLoader loader = IntegrityCheck.class.getClassLoader(); Util.assertNotInitialized("com.android.preload.check.IntegrityCheck$StatusHelper", loader); Class<?> klass = Class.forName("com.android.preload.check.IntegrityCheck$StatusHelper", Class.forName("com.android.preload.check.IntegrityCheck$StatusHelper", /* initialize */ true, loader); Util.assertInitialized("com.android.preload.check.IntegrityCheck$StatusHelper", loader); Loading @@ -30,6 +33,7 @@ public class IntegrityCheck { System.out.println("OK"); } @SuppressWarnings("unused") private static class StatusHelper { private final static Object defer = new Object(); } Loading
tools/preload-check/device/src/com/android/preload/check/NotInitialized.java +3 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ package com.android.preload.check; /** * Test that the given boot classpath class is not initialized. */ public class NotInitialized { public static void main(String[] args) throws Exception { Util.assertNotInitialized(args[0], null); Loading
tools/preload-check/device/src/com/android/preload/check/NotInitializedRegex.java +8 −0 Original line number Diff line number Diff line Loading @@ -23,7 +23,15 @@ import java.util.Enumeration; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * Test boot classpath classes that satisfy a given regular expression to be not initialized. * Optionally check that at least one class was matched. */ public class NotInitializedRegex { /** * First arg (mandatory): regular exception. Second arg (optional): boolean to denote a * required match. */ public static void main(String[] args) throws Exception { Matcher m = Pattern.compile(args[0]).matcher(""); boolean requiresMatch = args.length > 1 ? Boolean.parseBoolean(args[1]) : false; Loading