)]}'
{
  "commit": "a53f9a3c2971bb3d56c8c6a1332f1563d9fd0204",
  "tree": "498df8d7245d5e20eed6cfa3656ad5815e224c0d",
  "parents": [
    "cacab85169d79e8e0132d9bd286a43ce3cdd9a93"
  ],
  "author": {
    "name": "oscarthecat",
    "email": "oscar.gong@gmail.com",
    "time": "Wed Aug 26 16:13:57 2026 -0700"
  },
  "committer": {
    "name": "Copybara-Service",
    "email": "copybara-worker@google.com",
    "time": "Wed Aug 26 16:15:14 2026 -0700"
  },
  "message": "Merge #548 by oscarthecat: Prevent DexFileSplitter from dropping colliding class names\n\n## Problem\n\n`DexFileSplitter` stores input entries in a `TreeMap` using `ZipEntryComparator::compareClassNames`, then inserts them with `putIfAbsent`. The comparator replaces `$` with `0` before comparing names.\n\nWhen generated nested class names include entries such as `Foo$2$1$1.class.dex` and `Foo$2$101.class.dex`, both normalize to the same value. The comparator therefore returns zero, the `TreeMap` treats the distinct classes as the same key, and `putIfAbsent` silently drops one. The resulting APK can fail at runtime with `NoClassDefFoundError` for the missing class.\n\n## Change\n\nKeep the existing dx-style normalized ordering. When two normalized names compare equal, fall back to comparing the original names so distinct entries remain distinct. No ordering changes for names whose normalized forms differ.\n\nAdd regression coverage that inserts the colliding names into the same `TreeMap` shape used by `DexFileSplitter` and verifies that both remain present.\n\n## Testing\n\n- Passed a self-contained `javac` regression check against the modified `ZipEntryComparator`.\n- Added the collision case to `DexFileSplitterTest`.\n- Attempted `bazel test //src/tools/javatests/com/google/devtools/build/android/dexer:AllTests --test_output\u003derrors`; repository analysis could not complete locally because connections to `maven.google.com` timed out before compilation or test execution.\nCloses #548\n\nCOPYBARA_INTEGRATE_REVIEW\u003dhttps://github.com/bazelbuild/rules_android/pull/548 from oscarthecat:fix/dex-splitter-class-name-collision 140e6c0c407250c09d6fc931c70a0360c1b1c3e5\nPiperOrigin-RevId: 971560232\nChange-Id: Iba7facbdb7e7c4d784560bb0b359132d5c7c552f\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "e17650d58e34ac90bcde738a3ab17eae816692e4",
      "old_mode": 33188,
      "old_path": "src/tools/java/com/google/devtools/build/android/dexer/ZipEntryComparator.java",
      "new_id": "2736f8685f00dbe0e0e9b1dc7c5e25b0322ccfca",
      "new_mode": 33188,
      "new_path": "src/tools/java/com/google/devtools/build/android/dexer/ZipEntryComparator.java"
    },
    {
      "type": "modify",
      "old_id": "1551df2dec86bbebe216c35316166e154925c8a9",
      "old_mode": 33188,
      "old_path": "src/tools/javatests/com/google/devtools/build/android/dexer/DexFileSplitterTest.java",
      "new_id": "5784e876e610ff147447e65aa0d9a641f920a7f0",
      "new_mode": 33188,
      "new_path": "src/tools/javatests/com/google/devtools/build/android/dexer/DexFileSplitterTest.java"
    }
  ]
}
