Merge "Add test for getDeclaredClasses of with missing class"
diff --git a/test/005-annotations/build b/test/005-annotations/build
index 1690213..2474055 100644
--- a/test/005-annotations/build
+++ b/test/005-annotations/build
@@ -23,5 +23,6 @@
${JAVAC} -d classes `find src -name '*.java'`
# ...but not at run time.
-rm classes/android/test/anno/MissingAnnotation.class
+rm 'classes/android/test/anno/MissingAnnotation.class'
+rm 'classes/android/test/anno/ClassWithInnerAnnotationClass$MissingInnerAnnotationClass.class'
${DX} -JXmx256m --debug --dex --output=$TEST_NAME.jar classes
diff --git a/test/005-annotations/src/android/test/anno/ClassWithInnerAnnotationClass.java b/test/005-annotations/src/android/test/anno/ClassWithInnerAnnotationClass.java
new file mode 100644
index 0000000..c69e01a
--- /dev/null
+++ b/test/005-annotations/src/android/test/anno/ClassWithInnerAnnotationClass.java
@@ -0,0 +1,8 @@
+package android.test.anno;
+
+import java.lang.annotation.*;
+
+public class ClassWithInnerAnnotationClass {
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface MissingInnerAnnotationClass {}
+}
diff --git a/test/005-annotations/src/android/test/anno/TestAnnotations.java b/test/005-annotations/src/android/test/anno/TestAnnotations.java
index 4eabb12..1deff33 100644
--- a/test/005-annotations/src/android/test/anno/TestAnnotations.java
+++ b/test/005-annotations/src/android/test/anno/TestAnnotations.java
@@ -149,26 +149,24 @@
testArrays();
testArrayProblem();
- //System.exit(0);
System.out.println(
"AnnoSimpleField " + AnnoSimpleField.class.isAnnotation() +
", SimplyNoted " + SimplyNoted.class.isAnnotation());
- Class clazz;
- clazz = SimplyNoted.class;
- printAnnotations(clazz);
- clazz = INoted.class;
- printAnnotations(clazz);
- clazz = SubNoted.class;
- printAnnotations(clazz);
- clazz = FullyNoted.class;
- printAnnotations(clazz);
+ printAnnotations(SimplyNoted.class);
+ printAnnotations(INoted.class);
+ printAnnotations(SubNoted.class);
+ printAnnotations(FullyNoted.class);
- Annotation anno;
+ try {
+ ClassWithInnerAnnotationClass.class.getDeclaredClasses();
+ throw new AssertionError();
+ } catch (NoClassDefFoundError expected) {
+ }
// this is expected to be non-null
- anno = SimplyNoted.class.getAnnotation(AnnoSimpleType.class);
+ Annotation anno = SimplyNoted.class.getAnnotation(AnnoSimpleType.class);
System.out.println("SimplyNoted.get(AnnoSimpleType) = " + anno);
// this is non-null if the @Inherited tag is present
anno = SubNoted.class.getAnnotation(AnnoSimpleType.class);
diff --git a/test/run-test b/test/run-test
index b140fbf..f11580e 100755
--- a/test/run-test
+++ b/test/run-test
@@ -93,6 +93,7 @@
elif [ "x$1" = "x--jvm" ]; then
target_mode="no"
runtime="jvm"
+ prebuild_mode="no"
NEED_DEX="false"
shift
elif [ "x$1" = "x-O" ]; then