Automatic code cleanup. PiperOrigin-RevId: 538997759 Change-Id: Ib05809de42d6dd246f30f75391c0b7064b92ba21
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/Allowlist.java b/src/main/java/com/google/devtools/build/lib/analysis/Allowlist.java index 372364b..1554ed9 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/Allowlist.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/Allowlist.java
@@ -123,19 +123,6 @@ } /** - * Returns whether the given label is in the allowlist provided. - * - * @param allowlist the allowlist provided - * @param relevantLabel the label to check for in the allowlist. - */ - public static boolean isAvailableForAllowlist( - TransitiveInfoCollection allowlist, Label relevantLabel) { - PackageSpecificationProvider packageSpecificationProvider = - allowlist.get(PackageGroupConfiguredTarget.PROVIDER); - return isAvailableFor(packageSpecificationProvider.getPackageSpecifications(), relevantLabel); - } - - /** * Returns whether the rule from the given rule context has a allowlist by the given name. * * @param ruleContext The rule context to check
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/AnalysisIssues.java b/src/main/java/com/google/devtools/build/lib/analysis/AnalysisIssues.java index ca591bd..91ddc40 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/AnalysisIssues.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/AnalysisIssues.java
@@ -13,122 +13,4 @@ // limitations under the License. package com.google.devtools.build.lib.analysis; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableList; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import javax.annotation.Nullable; -/** - * Checked exception for analysis-time errors, which can store the errors for later reporting. - * - * <p>It's more robust for a method to throw this exception than expecting a - * {@link RuleErrorConsumer} object (which may be null). - */ -public final class AnalysisIssues extends Exception { - - /** - * An error entry. - * - * <p>{@link AnalysisIssues} can accumulate multiple of these, and report all of them at once. - */ - public static final class Entry { - private final String attribute; - private final String messageTemplate; - private final Object[] arguments; - - private Entry(@Nullable String attribute, String messageTemplate, Object... arguments) { - this.attribute = attribute; - this.messageTemplate = messageTemplate; - this.arguments = arguments; - } - - private void reportTo(RuleErrorConsumer errors) { - String msg = String.format(messageTemplate, arguments); - if (attribute == null) { - errors.ruleError(msg); - } else { - errors.attributeError(attribute, msg); - } - } - - private void reportTo(StringBuilder sb) { - String msg = String.format(messageTemplate, arguments); - if (attribute == null) { - sb.append("ERROR: ").append(msg); - } else { - sb.append("ERROR: in attribute \"").append(attribute).append("\": ").append(msg); - } - } - - @Override - public String toString() { - if (attribute == null) { - return String.format("ERROR: " + messageTemplate, arguments); - } else { - List<Object> args = new ArrayList<>(); - args.add(attribute); - Collections.addAll(args, arguments); - return String.format("ERROR in '%s': " + messageTemplate, args.toArray()); - } - } - } - - private final ImmutableList<Entry> entries; - - public AnalysisIssues(Entry entry) { - this.entries = ImmutableList.of(Preconditions.checkNotNull(entry)); - } - - public AnalysisIssues(Collection<Entry> entries) { - this.entries = ImmutableList.copyOf(Preconditions.checkNotNull(entries)); - } - - /** - * Creates a attribute error entry that will be added to a {@link AnalysisIssues} later. - */ - public static Entry attributeError(String attribute, String messageTemplate, - Object... arguments) { - return new Entry(attribute, messageTemplate, arguments); - } - - public static Entry ruleError(String messageTemplate, Object... arguments) { - return new Entry(null, messageTemplate, arguments); - } - - /** - * Report all accumulated errors and warnings to the given consumer object. - */ - public void reportTo(RuleErrorConsumer errors) { - Preconditions.checkNotNull(errors); - for (Entry e : entries) { - e.reportTo(errors); - } - } - - @Nullable - private String asString() { - if (entries == null) { - return null; - } - - StringBuilder sb = new StringBuilder(); - for (Entry e : entries) { - e.reportTo(sb); - } - return sb.toString(); - } - - @Override - public String getMessage() { - return asString(); - } - - @Override - public String toString() { - String s = asString(); - return s == null ? "" : s; - } -}
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/AnalysisPhaseCompleteEvent.java b/src/main/java/com/google/devtools/build/lib/analysis/AnalysisPhaseCompleteEvent.java index e5cc58e..7f270fd 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/AnalysisPhaseCompleteEvent.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/AnalysisPhaseCompleteEvent.java
@@ -32,7 +32,6 @@ private final PackageManagerStatistics pkgManagerStats; private final TotalAndConfiguredTargetOnlyMetric actionsConstructed; private final boolean analysisCacheDropped; - private final boolean skymeldEnabled; public AnalysisPhaseCompleteEvent( Collection<? extends ConfiguredTarget> topLevelTargets, @@ -65,7 +64,6 @@ this.pkgManagerStats = pkgManagerStats; this.actionsConstructed = checkNotNull(actionsConstructed); this.analysisCacheDropped = analysisCacheDropped; - this.skymeldEnabled = skymeldEnabled; } /** @@ -120,14 +118,6 @@ } /** - * Returns whether this event originated from Skymeld. Some subscribers are incompatible with - * Skymeld and this distinction is required for now. - */ - public boolean isOriginatedFromSkymeld() { - return skymeldEnabled; - } - - /** * Returns package manager statistics. */ public PackageManagerStatistics getPkgManagerStats() {
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/AnalysisPhaseStartedEvent.java b/src/main/java/com/google/devtools/build/lib/analysis/AnalysisPhaseStartedEvent.java index 25e9594..23e6ac2 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/AnalysisPhaseStartedEvent.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/AnalysisPhaseStartedEvent.java
@@ -19,7 +19,6 @@ import com.google.common.collect.Iterables; import com.google.devtools.build.lib.cmdline.Label; import com.google.devtools.build.lib.packages.Target; - import java.util.Collection; /** @@ -49,8 +48,4 @@ } }); } - - public ImmutableSet<Target> getTargets() { - return targets; - } }
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/AnalysisResult.java b/src/main/java/com/google/devtools/build/lib/analysis/AnalysisResult.java index d57774a..c136118 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/AnalysisResult.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/AnalysisResult.java
@@ -154,10 +154,6 @@ return topLevelContext; } - public String getWorkspaceName() { - return workspaceName; - } - public Collection<TargetAndConfiguration> getTopLevelTargetsWithConfigs() { return topLevelTargetsWithConfigs; }