Skip to content

Commit

Permalink
Automatic code cleanup.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 414681149
  • Loading branch information
Googler authored and copybara-github committed Dec 7, 2021
1 parent 81264d2 commit f4db9ce
Showing 1 changed file with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -478,23 +478,6 @@ private void desugar(
}
}

private boolean isProgramClassForShard(int numberOfShards, int currentShard, String name) {
return getShardNumberForString(numberOfShards, name) == currentShard;
}

private int getShardCount(Path input) throws IOException {
return max(1, ZipUtils.getNumberOfEntries(input) / NUMBER_OF_ENTRIES_PER_SHARD);
}

private int getShardNumberForString(int numberOfShards, String string) {
// We group classes and inner classes to ensure that inner class annotations and nests are
// correctly handled.
if (string.contains("$")) {
string = string.substring(0, string.indexOf("$"));
}
return Math.floorMod(string.hashCode(), numberOfShards);
}

private void desugar() throws CompilationFailedException, IOException {
// Prepare bootclasspath and classpath. Some jars on the classpath are considered to be
// bootclasspath, and are moved there.
Expand Down Expand Up @@ -531,6 +514,23 @@ private void desugar() throws CompilationFailedException, IOException {
}
}

private boolean isProgramClassForShard(int numberOfShards, int currentShard, String name) {
return getShardNumberForString(numberOfShards, name) == currentShard;
}

private int getShardCount(Path input) throws IOException {
return max(1, ZipUtils.getNumberOfEntries(input) / NUMBER_OF_ENTRIES_PER_SHARD);
}

private int getShardNumberForString(int numberOfShards, String string) {
// We group classes and inner classes to ensure that inner class annotations and nests are
// correctly handled.
if (string.contains("$")) {
string = string.substring(0, string.indexOf("$"));
}
return Math.floorMod(string.hashCode(), numberOfShards);
}

private static boolean isPlatform(ClassFileResourceProvider provider) {
// See b/153106333.
boolean mightBePlatform = false;
Expand Down

0 comments on commit f4db9ce

Please sign in to comment.