Program: 110986
Project: 110986
Buggy source:
/** 
 * Constructs an instance of RuleClass whose name is 'name', attributes are 'attributes'. The   {@code srcsAllowedFiles} determines which types offiles are allowed as parameters to the "srcs" attribute; rules are always allowed. For the "deps" attribute, there are four cases: <ul> <li>if the parameter is a file, it is allowed if its file type is given in  {@code depsAllowedFiles}, <li>if the parameter is a rule and the rule class is accepted by  {@code depsAllowedRules}, then it is allowed, <li>if the parameter is a rule and the rule class is not accepted by  {@code depsAllowedRules}, but accepted by  {@code depsAllowedRulesWithWarning}, then it is allowed, but triggers a warning; <li>all other parameters trigger an error. </ul> <p>The   {@code depsAllowedRules} predicate should have a {@code toString}method which returns a plain English enumeration of the allowed rule class names, if it does not allow all rule classes.
 * @param workspaceOnly
 */
@VisibleForTesting void RuleClass(String name,boolean isSkylark,boolean skylarkExecutable,boolean documented,boolean publicByDefault,boolean binaryOutput,boolean workspaceOnly,boolean outputsDefaultExecutable,ImplicitOutputsFunction implicitOutputsFunction,Configurator<?,?> configurator,ConfiguredTargetFactory<?,?> configuredTargetFactory,PredicateWithMessage<Rule> validityPredicate,Predicate<String> preferredDependencyPredicate,ImmutableSet<Class<?>> advertisedProviders,@Nullable BaseFunction configuredTargetFunction,Function<? super Rule,Map<String,Label>> externalBindingsFunction,@Nullable Environment ruleDefinitionEnvironment,ConfigurationFragmentPolicy configurationFragmentPolicy,boolean supportsConstraintChecking,Attribute... attributes){
  this.name=name;
  this.isSkylark=isSkylark;
  this.targetKind=name + "String_Node_Str";
  this.skylarkExecutable=skylarkExecutable;
  this.documented=documented;
  this.publicByDefault=publicByDefault;
  this.binaryOutput=binaryOutput;
  this.implicitOutputsFunction=implicitOutputsFunction;
  this.configurator=Preconditions.checkNotNull(configurator);
  this.configuredTargetFactory=configuredTargetFactory;
  this.validityPredicate=validityPredicate;
  this.preferredDependencyPredicate=preferredDependencyPredicate;
  this.advertisedProviders=advertisedProviders;
  this.configuredTargetFunction=configuredTargetFunction;
  this.externalBindingsFunction=externalBindingsFunction;
  this.ruleDefinitionEnvironment=ruleDefinitionEnvironment;
  this.attributes=ImmutableList.copyOf(attributes);
  this.workspaceOnly=workspaceOnly;
  this.outputsDefaultExecutable=outputsDefaultExecutable;
  this.configurationFragmentPolicy=configurationFragmentPolicy;
  this.supportsConstraintChecking=supportsConstraintChecking;
  int index=0;
  attributeIndex=new HashMap<>(attributes.length);
  for (  Attribute attribute : attributes) {
    attributeIndex.put(attribute.getName(),index++);
  }
}

Fixed version (ground truth):
/** 
 * Constructs an instance of RuleClass whose name is 'name', attributes are 'attributes'. The   {@code srcsAllowedFiles} determines which types offiles are allowed as parameters to the "srcs" attribute; rules are always allowed. For the "deps" attribute, there are four cases: <ul> <li>if the parameter is a file, it is allowed if its file type is given in  {@code depsAllowedFiles}, <li>if the parameter is a rule and the rule class is accepted by  {@code depsAllowedRules}, then it is allowed, <li>if the parameter is a rule and the rule class is not accepted by  {@code depsAllowedRules}, but accepted by  {@code depsAllowedRulesWithWarning}, then it is allowed, but triggers a warning; <li>all other parameters trigger an error. </ul> <p>The   {@code depsAllowedRules} predicate should have a {@code toString}method which returns a plain English enumeration of the allowed rule class names, if it does not allow all rule classes.
 * @param workspaceOnly
 */
@VisibleForTesting void RuleClass(String name,boolean isSkylark,boolean skylarkExecutable,boolean documented,boolean publicByDefault,boolean binaryOutput,boolean workspaceOnly,boolean outputsDefaultExecutable,ImplicitOutputsFunction implicitOutputsFunction,Configurator<?,?> configurator,ConfiguredTargetFactory<?,?> configuredTargetFactory,PredicateWithMessage<Rule> validityPredicate,Predicate<String> preferredDependencyPredicate,ImmutableSet<Class<?>> advertisedProviders,@Nullable BaseFunction configuredTargetFunction,Function<? super Rule,Map<String,Label>> externalBindingsFunction,@Nullable Environment ruleDefinitionEnvironment,ConfigurationFragmentPolicy configurationFragmentPolicy,boolean supportsConstraintChecking,Attribute... attributes){
  this.name=name;
  this.isSkylark=isSkylark;
  this.targetKind=name + "String_Node_Str";
  this.skylarkExecutable=skylarkExecutable;
  this.documented=documented;
  this.publicByDefault=publicByDefault;
  this.binaryOutput=binaryOutput;
  this.implicitOutputsFunction=implicitOutputsFunction;
  this.configurator=Preconditions.checkNotNull(configurator);
  this.configuredTargetFactory=configuredTargetFactory;
  this.validityPredicate=validityPredicate;
  this.preferredDependencyPredicate=preferredDependencyPredicate;
  this.advertisedProviders=advertisedProviders;
  this.configuredTargetFunction=configuredTargetFunction;
  this.externalBindingsFunction=externalBindingsFunction;
  this.ruleDefinitionEnvironment=ruleDefinitionEnvironment;
  validateNoClashInPublicNames(attributes);
  this.attributes=ImmutableList.copyOf(attributes);
  this.workspaceOnly=workspaceOnly;
  this.outputsDefaultExecutable=outputsDefaultExecutable;
  this.configurationFragmentPolicy=configurationFragmentPolicy;
  this.supportsConstraintChecking=supportsConstraintChecking;
  int index=0;
  attributeIndex=new HashMap<>(attributes.length);
  for (  Attribute attribute : attributes) {
    attributeIndex.put(attribute.getName(),index++);
  }
}