Merge "Cache synthesized classes at AppInfo level."
diff --git a/src/main/java/com/android/tools/r8/shaking/Enqueuer.java b/src/main/java/com/android/tools/r8/shaking/Enqueuer.java
index 1891a0a..8de2695 100644
--- a/src/main/java/com/android/tools/r8/shaking/Enqueuer.java
+++ b/src/main/java/com/android/tools/r8/shaking/Enqueuer.java
@@ -840,8 +840,8 @@
// If this type has deferred annotations, we have to process those now, too.
Set<DexAnnotation> annotations = deferredAnnotations.remove(type);
if (annotations != null && !annotations.isEmpty()) {
- assert !holder.accessFlags.isAnnotation()
- || annotations.stream().allMatch(a -> a.annotation.type == holder.type);
+ assert holder.accessFlags.isAnnotation();
+ assert annotations.stream().allMatch(a -> a.annotation.type == holder.type);
annotations.forEach(annotation -> handleAnnotation(holder, annotation));
}
} else {
diff --git a/src/test/java/com/android/tools/r8/debug/InterfaceMethodTest.java b/src/test/java/com/android/tools/r8/debug/InterfaceMethodTest.java
index f8faf9c..e72cf0a 100644
--- a/src/test/java/com/android/tools/r8/debug/InterfaceMethodTest.java
+++ b/src/test/java/com/android/tools/r8/debug/InterfaceMethodTest.java
@@ -58,7 +58,7 @@
// the source file or the desguared interface is to make it an inner class.
assertEquals('$', InterfaceMethodRewriter.COMPANION_CLASS_NAME_SUFFIX.charAt(0));
defaultMethodName = InterfaceMethodRewriter.DEFAULT_METHOD_PREFIX + "doSomething";
- defaultMethodThisName = "-this";
+ defaultMethodThisName = "_this";
}
diff --git a/src/test/java/com/android/tools/r8/naming/b124357885/B124357885Test.java b/src/test/java/com/android/tools/r8/naming/b124357885/B124357885Test.java
index 3112ae7..32e8e4d 100644
--- a/src/test/java/com/android/tools/r8/naming/b124357885/B124357885Test.java
+++ b/src/test/java/com/android/tools/r8/naming/b124357885/B124357885Test.java
@@ -7,6 +7,7 @@
import static com.android.tools.r8.utils.codeinspector.Matchers.isPresent;
import static com.android.tools.r8.utils.codeinspector.Matchers.isRenamed;
import static org.hamcrest.CoreMatchers.allOf;
+import static org.hamcrest.CoreMatchers.anyOf;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.not;
import static org.junit.Assert.assertEquals;
@@ -69,9 +70,13 @@
})
.run(Main.class)
.assertFailureWithErrorThatMatches(
- containsString(
- "java.lang.ClassNotFoundException: "
- + "Didn't find class \"com.android.tools.r8.naming.b124357885.Foo\""));
+ anyOf(
+ containsString(
+ "java.lang.ClassNotFoundException: "
+ + "Didn't find class \"com.android.tools.r8.naming.b124357885.Foo\""),
+ containsString(
+ "java.lang.NoClassDefFoundError: "
+ + "com/android/tools/r8/naming/b124357885/Foo")));
}
}
@@ -94,4 +99,4 @@
interface Foo<T> {}
-class FooImpl<T> implements Foo<T> {}
\ No newline at end of file
+class FooImpl<T> implements Foo<T> {}