diff options
| author | 2019-04-17 22:43:44 +0000 | |
|---|---|---|
| committer | 2019-04-17 22:43:44 +0000 | |
| commit | a1759a9bd89c6371eafab643474a1e50cfec2d3c (patch) | |
| tree | dad8ee1934af3348a7f2ba1ab0e0fefc95c6f363 | |
| parent | 73b25f4fcc38221b6f2f2a58f87ee4f93fe1da28 (diff) | |
| parent | 1e8c3995c6260953ed3e09ba8f6188210b9f96c0 (diff) | |
Merge "PreloadCheck: Add some comments"
4 files changed, 19 insertions, 1 deletions
diff --git a/tools/preload-check/device/src/com/android/preload/check/Initialized.java b/tools/preload-check/device/src/com/android/preload/check/Initialized.java index b21b5f6e024e..81c074c04d4c 100644 --- a/tools/preload-check/device/src/com/android/preload/check/Initialized.java +++ b/tools/preload-check/device/src/com/android/preload/check/Initialized.java @@ -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); diff --git a/tools/preload-check/device/src/com/android/preload/check/IntegrityCheck.java b/tools/preload-check/device/src/com/android/preload/check/IntegrityCheck.java index 6cc3946d5be6..1c1e927c54c4 100644 --- a/tools/preload-check/device/src/com/android/preload/check/IntegrityCheck.java +++ b/tools/preload-check/device/src/com/android/preload/check/IntegrityCheck.java @@ -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); @@ -30,6 +33,7 @@ public class IntegrityCheck { System.out.println("OK"); } + @SuppressWarnings("unused") private static class StatusHelper { private final static Object defer = new Object(); } diff --git a/tools/preload-check/device/src/com/android/preload/check/NotInitialized.java b/tools/preload-check/device/src/com/android/preload/check/NotInitialized.java index d2e98fe205a2..c3d2c7737c7d 100644 --- a/tools/preload-check/device/src/com/android/preload/check/NotInitialized.java +++ b/tools/preload-check/device/src/com/android/preload/check/NotInitialized.java @@ -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); diff --git a/tools/preload-check/device/src/com/android/preload/check/NotInitializedRegex.java b/tools/preload-check/device/src/com/android/preload/check/NotInitializedRegex.java index 261024b030f0..d942bad9b6a8 100644 --- a/tools/preload-check/device/src/com/android/preload/check/NotInitializedRegex.java +++ b/tools/preload-check/device/src/com/android/preload/check/NotInitializedRegex.java @@ -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; |