Skip to content

Commit

Permalink
Convert ToolchainType from AutoValue to record.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 677907326
Change-Id: I987aa2d34afb756ac9a0373df787626316e3a6dc
  • Loading branch information
katre authored and copybara-github committed Sep 23, 2024
1 parent 33aca3f commit 7aa9e77
Showing 1 changed file with 4 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,20 +153,10 @@ public UnloadedToolchainContext compute(SkyKey skyKey, Environment env)
}
}

@AutoValue
abstract static class ToolchainType {
abstract ToolchainTypeRequirement toolchainTypeRequirement();

abstract ToolchainTypeInfo toolchainTypeInfo();

static ToolchainType create(
ToolchainTypeRequirement toolchainTypeRequirement, ToolchainTypeInfo toolchainTypeInfo) {
return new AutoValue_ToolchainResolutionFunction_ToolchainType(
toolchainTypeRequirement, toolchainTypeInfo);
}

private record ToolchainType(
ToolchainTypeRequirement toolchainTypeRequirement, ToolchainTypeInfo toolchainTypeInfo) {
public boolean mandatory() {
return toolchainTypeRequirement().mandatory();
return toolchainTypeRequirement.mandatory();
}
}

Expand Down Expand Up @@ -219,7 +209,7 @@ private ImmutableSet<ToolchainType> loadToolchainTypes(
toolchainTypeRequirement.toBuilder().toolchainType(toolchainTypeLabel).build();
}

resolved.add(ToolchainType.create(toolchainTypeRequirement, toolchainTypeInfo));
resolved.add(new ToolchainType(toolchainTypeRequirement, toolchainTypeInfo));
}
return resolved.build();
}
Expand Down

0 comments on commit 7aa9e77

Please sign in to comment.