Version 1.5.37

Cherry pick: Relax check in Enqueuer.ensureFromLibraryOrThrow to allow
for classpath
CL: https://r8-review.googlesource.com/c/r8/+/38541

Cherry pick: Fix MixedCaseTest to not generate unique names on Windows

CL: https://r8-review.googlesource.com/c/r8/+/38719
Change-Id: I91fb5190127e510f20589820c18574f95c8587be
diff --git a/src/main/java/com/android/tools/r8/Version.java b/src/main/java/com/android/tools/r8/Version.java
index 6fce43b..db8a74d 100644
--- a/src/main/java/com/android/tools/r8/Version.java
+++ b/src/main/java/com/android/tools/r8/Version.java
@@ -11,7 +11,7 @@
 
   // This field is accessed from release scripts using simple pattern matching.
   // Therefore, changing this field could break our release scripts.
-  public static final String LABEL = "1.5.36";
+  public static final String LABEL = "1.5.37";
 
   private Version() {
   }
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 b52762a..9f48d56 100644
--- a/src/main/java/com/android/tools/r8/shaking/Enqueuer.java
+++ b/src/main/java/com/android/tools/r8/shaking/Enqueuer.java
@@ -853,9 +853,9 @@
         markTypeAsLive(holder.superType);
         if (holder.isNotProgramClass()) {
           // Library classes may only extend other implement library classes.
-          ensureFromLibraryOrThrow(holder.superType, type);
+          ensureNotFromProgramOrThrow(holder.superType, type);
           for (DexType iface : holder.interfaces.values) {
-            ensureFromLibraryOrThrow(iface, type);
+            ensureNotFromProgramOrThrow(iface, type);
           }
         }
       }
@@ -964,7 +964,7 @@
     }
   }
 
-  private void ensureFromLibraryOrThrow(DexType type, DexType context) {
+  private void ensureNotFromProgramOrThrow(DexType type, DexType context) {
     if (tracingMainDex) {
       // b/72312389: android.jar contains parts of JUnit and most developers include JUnit in
       // their programs. This leads to library classes extending program classes. When tracing
@@ -972,14 +972,14 @@
       return;
     }
 
-    DexClass holder = appView.definitionFor(type);
-    if (holder != null && !holder.isLibraryClass()) {
+    DexClass clazz = appView.definitionFor(type);
+    if (clazz != null && clazz.isProgramClass()) {
       if (!dontWarnPatterns.matches(context)) {
         Diagnostic message =
             new StringDiagnostic(
                 "Library class "
                     + context.toSourceString()
-                    + (holder.isInterface() ? " implements " : " extends ")
+                    + (clazz.isInterface() ? " implements " : " extends ")
                     + "program class "
                     + type.toSourceString());
         if (tracingMainDex || forceProguardCompatibility) {
diff --git a/src/test/java/com/android/tools/r8/naming/MinificationMixedCaseAndNumbersTest.java b/src/test/java/com/android/tools/r8/naming/MinificationMixedCaseAndNumbersTest.java
index 55b3a9a..f27f20f 100644
--- a/src/test/java/com/android/tools/r8/naming/MinificationMixedCaseAndNumbersTest.java
+++ b/src/test/java/com/android/tools/r8/naming/MinificationMixedCaseAndNumbersTest.java
@@ -44,7 +44,7 @@
   @Test
   public void testNaming() throws ExecutionException, CompilationFailedException, IOException {
     Set<String> allowedNames = new HashSet<>();
-    allowedNames.add("com.android.tools.r8.naming.MinificationMixedCaseAndNumbersTest$Main");
+    allowedNames.add(Main.class.getTypeName());
     for (int i = 1; i < NUMBER_OF_MINIFIED_CLASSES; i++) {
       String newString =
           SymbolGenerationUtils.numberToIdentifier(i, MixedCasing.DONT_USE_MIXED_CASE);
@@ -129,58 +129,6 @@
 
   public static class Z {}
 
-  public static class a {}
-
-  public static class b {}
-
-  public static class c {}
-
-  public static class d {}
-
-  public static class e {}
-
-  public static class f {}
-
-  public static class g {}
-
-  public static class h {}
-
-  public static class i {}
-
-  public static class j {}
-
-  public static class k {}
-
-  public static class l {}
-
-  public static class m {}
-
-  public static class n {}
-
-  public static class o {}
-
-  public static class p {}
-
-  public static class q {}
-
-  public static class r {}
-
-  public static class s {}
-
-  public static class t {}
-
-  public static class u {}
-
-  public static class v {}
-
-  public static class w {}
-
-  public static class x {}
-
-  public static class y {}
-
-  public static class z {}
-
   public static class AA {}
 
   public static class AB {}
@@ -195,6 +143,58 @@
 
   public static class AG {}
 
+  public static class AH {}
+
+  public static class AI {}
+
+  public static class AJ {}
+
+  public static class AK {}
+
+  public static class AL {}
+
+  public static class AM {}
+
+  public static class AN {}
+
+  public static class AO {}
+
+  public static class AP {}
+
+  public static class AQ {}
+
+  public static class AR {}
+
+  public static class AS {}
+
+  public static class AT {}
+
+  public static class AU {}
+
+  public static class AV {}
+
+  public static class AW {}
+
+  public static class AX {}
+
+  public static class AY {}
+
+  public static class AZ {}
+
+  public static class AAA {}
+
+  public static class AAB {}
+
+  public static class AAC {}
+
+  public static class AAD {}
+
+  public static class AAE {}
+
+  public static class AAF {}
+
+  public static class AAG {}
+
   public static class Main {
 
     public static void main(String[] args) {