Merge "Add InterfaceRenamingTest"
diff --git a/build.gradle b/build.gradle
index 2d9e9b4..8237781 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1339,10 +1339,6 @@
 }
 
 task buildPreNJdwpTestsDex(type: Exec, dependsOn: "buildPreNJdwpTestsJar") {
-    onlyIf {
-        // TODO(b/76135355): Update dx.bat on Windows to something that can build this.
-        !OperatingSystem.current().isWindows()
-    }
     def inFile = buildPreNJdwpTestsJar.archivePath
     def outFile = new File(buildPreNJdwpTestsJar.destinationDir, buildPreNJdwpTestsJar.baseName + '-dex.jar')
     inputs.file inFile
diff --git a/src/main/java/com/android/tools/r8/graph/DexItemFactory.java b/src/main/java/com/android/tools/r8/graph/DexItemFactory.java
index 50302fb..75f2ee8 100644
--- a/src/main/java/com/android/tools/r8/graph/DexItemFactory.java
+++ b/src/main/java/com/android/tools/r8/graph/DexItemFactory.java
@@ -548,11 +548,14 @@
     String bootstrapClass = bootstrapMethod.asMethod().holder.toDescriptorString();
     DexMethod interfaceMethod = null;
     if (bootstrapClass.equals("Ljava/lang/invoke/LambdaMetafactory;")) {
-      DexType interfaceType = methodProto.returnType;
-      assert bootstrapArgs.size() == 3;
-      // bootstrapArgs contains samMethodType, implMethod and instantiatedMethodType.
-      DexValueMethodType samMethodType = (DexValueMethodType) bootstrapArgs.get(0);
-      interfaceMethod = createMethod(interfaceType, samMethodType.value, methodName);
+      if (methodName.toString().equals("metafactory")) {
+        DexType interfaceType = methodProto.returnType;
+        assert bootstrapArgs.size() == 3;
+        // bootstrapArgs contains samMethodType, implMethod and instantiatedMethodType.
+        DexValueMethodType samMethodType = (DexValueMethodType) bootstrapArgs.get(0);
+        interfaceMethod = createMethod(interfaceType, samMethodType.value, methodName);
+      }
+      // TODO(mathiasr): Support altMetafactory, possibly using ir.desugar.LambdaDescriptor
     }
     DexCallSite callSite =
         new DexCallSite(methodName, methodProto, bootstrapMethod, bootstrapArgs, interfaceMethod);
diff --git a/src/test/java/com/android/tools/r8/debug/MinificationTest.java b/src/test/java/com/android/tools/r8/debug/MinificationTest.java
index 414fbc3..2f995db 100644
--- a/src/test/java/com/android/tools/r8/debug/MinificationTest.java
+++ b/src/test/java/com/android/tools/r8/debug/MinificationTest.java
@@ -185,11 +185,6 @@
       String innerClassName,
       MethodSignature innerMethod)
       throws Throwable {
-    if (ToolHelper.isWindows()) {
-      // TODO(b/76135355): Update dx.bat on Windows to something that can build
-      // jdwp-tests-preN-dex.jar.
-      return;
-    }
     Path proguardMap = config.getProguardMap();
     String mappingFile = proguardMap == null ? null : proguardMap.toString();
     DexInspector inspector = new DexInspector(config.getPaths(), mappingFile);