Program: 124584
Project: 124584
Buggy source:
/** 
 * Generates the "SHOW_IF" condition for the "SUPPORTED_SPARK_VERSION" drop down list. Given a map of Spark versions and corresponding supported hadoop versions, it builds a   {@link ComponentCondition} for each entry in the map.
 * @param supportedSparkVersions the map of Spark versions
 * @return an array of a String reprensation of a {@link ComponentCondition}
 */
public static String[] generateSparkVersionShowIfConditions(Map<ESparkVersion,Set<DistributionVersion>> supportedSparkVersions){
  String[] results=null;
  if (supportedSparkVersions != null) {
    results=new String[supportedSparkVersions.size()];
    int conditionIndex=0;
    for (    Map.Entry<ESparkVersion,Set<DistributionVersion>> entry : supportedSparkVersions.entrySet()) {
      Set<ComponentCondition> multiComponentConditions=new HashSet<>();
      for (      DistributionVersion distributionVersion : entry.getValue()) {
        SimpleComponentCondition distribution=new SimpleComponentCondition(new BasicExpression("String_Node_Str",EqualityOperator.EQ,distributionVersion.distribution.getName()));
        SimpleComponentCondition version=new SimpleComponentCondition(new BasicExpression("String_Node_Str",EqualityOperator.EQ,distributionVersion.getVersion()));
        multiComponentConditions.add(new MultiComponentCondition(distribution,BooleanOperator.AND,version));
      }
      ComponentCondition componentCondition=buildDistributionShowIf(multiComponentConditions);
      results[conditionIndex++]=componentCondition != null ? componentCondition.getConditionString() : null;
    }
  }
  return results;
}

Fixed version (ground truth):
/** 
 * Generates the "SHOW_IF" condition for the "SUPPORTED_SPARK_VERSION" drop down list. Given a map of Spark versions and corresponding supported hadoop versions, it builds a   {@link ComponentCondition} for each entry in the map.
 * @param supportedSparkVersions the map of Spark versions
 * @return an array of a String reprensation of a {@link ComponentCondition}
 */
public static String[] generateSparkVersionShowIfConditions(Map<ESparkVersion,Set<DistributionVersion>> supportedSparkVersions){
  String[] results=null;
  if (supportedSparkVersions != null) {
    results=new String[supportedSparkVersions.size()];
    int conditionIndex=0;
    for (    Map.Entry<ESparkVersion,Set<DistributionVersion>> entry : supportedSparkVersions.entrySet()) {
      Set<ComponentCondition> multiComponentConditions=new LinkedHashSet<>();
      for (      DistributionVersion distributionVersion : entry.getValue()) {
        SimpleComponentCondition distribution=new SimpleComponentCondition(new BasicExpression("String_Node_Str",EqualityOperator.EQ,distributionVersion.distribution.getName()));
        SimpleComponentCondition version=new SimpleComponentCondition(new BasicExpression("String_Node_Str",EqualityOperator.EQ,distributionVersion.getVersion()));
        multiComponentConditions.add(new MultiComponentCondition(distribution,BooleanOperator.AND,version));
      }
      ComponentCondition componentCondition=buildDistributionShowIf(multiComponentConditions);
      results[conditionIndex++]=componentCondition != null ? componentCondition.getConditionString() : null;
    }
  }
  return results;
}