@@ -0,0 +1,2335 @@
+/*%0A * Copyright 2019-present Facebook, Inc.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22); you may%0A * not use this file except in compliance with the License. You may obtain%0A * a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS, WITHOUT%0A * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the%0A * License for the specific language governing permissions and limitations%0A * under the License.%0A */%0Apackage com.facebook.buck.core.rules.analysis.impl;%0A%0Aimport com.facebook.buck.core.model.BuildTarget;%0Aimport com.facebook.buck.core.rules.analysis.RuleAnalysisResult;%0Aimport com.facebook.buck.core.rules.analysis.action.ActionAnalysisData;%0Aimport com.facebook.buck.core.rules.providers.ProviderInfoCollection;%0Aimport com.facebook.buck.core.util.immutables.BuckStyleValue;%0Aimport com.google.common.collect.ImmutableMap;%0Aimport java.util.Optional;%0A%0A/**%0A * An implementation of the %7B@link RuleAnalysisResult%7D for legacy provider results from %7B@link%0A * com.facebook.buck.core.rules.DescriptionWithTargetGraph#createProviders(com.facebook.buck.core.rules.ProviderCreationContext,%0A * BuildTarget, Object)%7D.%0A *%0A * %3Cp%3EThis implementation throws on any operation relating to %7B@link ActionAnalysisData%7D.%0A */%0A@BuckStyleValue%0Aabstract class LegacyProviderRuleAnalysisResult implements RuleAnalysisResult %7B%0A  @Override%0A  public abstract BuildTarget getBuildTarget();%0A%0A  /** @return a %7B@link ProviderInfoCollection%7D exported by the rule */%0A  @Override%0A  public abstract ProviderInfoCollection getProviderInfos();%0A%0A  private IllegalStateException noActionsMethodOnLegacyProviders() %7B%0A    return new IllegalStateException(%0A        %22Should not call Action related methods on RuleAnalysisResult for legacy Providers%22);%0A  %7D%0A%0A  @Override%0A  public ImmutableMap%3CActionAnalysisData.ID, ActionAnalysisData%3E getRegisteredActions() %7B%0A    throw noActionsMethodOnLegacyProviders();%0A  %7D%0A%0A  @Override%0A  public boolean actionExists(ActionAnalysisData.ID key) %7B%0A    throw noActionsMethodOnLegacyProviders();%0A  %7D%0A%0A  @Override%0A  public Optional%3CActionAnalysisData%3E getActionOptional(ActionAnalysisData.ID key) %7B%0A    throw noActionsMethodOnLegacyProviders();%0A  %7D%0A%7D%0A

Add a LegacyProviderRuleAnalysisResult