summaryrefslogtreecommitdiff
path: root/java/com/google/devtools/build/android/desugar/CoreLibraryInvocationRewriter.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/com/google/devtools/build/android/desugar/CoreLibraryInvocationRewriter.java')
-rw-r--r--java/com/google/devtools/build/android/desugar/CoreLibraryInvocationRewriter.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/java/com/google/devtools/build/android/desugar/CoreLibraryInvocationRewriter.java b/java/com/google/devtools/build/android/desugar/CoreLibraryInvocationRewriter.java
index 77db915..381a344 100644
--- a/java/com/google/devtools/build/android/desugar/CoreLibraryInvocationRewriter.java
+++ b/java/com/google/devtools/build/android/desugar/CoreLibraryInvocationRewriter.java
@@ -14,6 +14,7 @@
package com.google.devtools.build.android.desugar;
import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;
import org.objectweb.asm.ClassVisitor;
@@ -65,9 +66,13 @@ public class CoreLibraryInvocationRewriter extends ClassVisitor {
}
if (opcode == Opcodes.INVOKESTATIC || opcode == Opcodes.INVOKESPECIAL) {
- checkArgument(itf, "Expected interface to rewrite %s.%s : %s", owner, name, desc);
- owner = InterfaceDesugaring.getCompanionClassName(coreInterfaceName);
+ checkArgument(itf || opcode == Opcodes.INVOKESPECIAL,
+ "Expected interface to rewrite %s.%s : %s", owner, name, desc);
+ owner = coreInterface.isInterface()
+ ? InterfaceDesugaring.getCompanionClassName(coreInterfaceName)
+ : checkNotNull(support.getMoveTarget(coreInterfaceName, name));
} else {
+ checkState(coreInterface.isInterface());
owner = coreInterfaceName + "$$Dispatch";
}