Program: 90747
Project: 90747
Buggy source:
private Properties createProperties(final String name,final Agent[] agents,final Property[] properties,final int batchSize,String dataDir){
  final Properties props=new Properties();
  if ((agents == null || agents.length == 0) && (properties == null || properties.length == 0)) {
    LOGGER.error("String_Node_Str");
    throw new ConfigurationException("String_Node_Str");
  }
  if ((agents != null && agents.length > 0 && properties != null && properties.length > 0)) {
    LOGGER.error("String_Node_Str");
    throw new ConfigurationException("String_Node_Str");
  }
  if (agents != null && agents.length > 0) {
    props.put(name + "String_Node_Str",FlumeEmbeddedManager.SOURCE_NAME);
    props.put(name + "String_Node_Str" + FlumeEmbeddedManager.SOURCE_NAME+ "String_Node_Str",sourceType);
    props.put(name + "String_Node_Str","String_Node_Str");
    props.put(name + "String_Node_Str","String_Node_Str");
    if (dataDir != null && dataDir.length() > 0) {
      if (!dataDir.endsWith(Constants.LINE_SEP)) {
        dataDir=dataDir + Constants.LINE_SEP;
      }
      props.put(name + "String_Node_Str",dataDir + "String_Node_Str");
      props.put(name + "String_Node_Str",dataDir + "String_Node_Str");
    }
    final StringBuilder sb=new StringBuilder();
    String leading="String_Node_Str";
    int priority=agents.length;
    for (int i=0; i < agents.length; ++i) {
      sb.append(leading).append("String_Node_Str").append(i);
      leading="String_Node_Str";
      final String prefix=name + "String_Node_Str" + i;
      props.put(prefix + "String_Node_Str","String_Node_Str");
      props.put(prefix + "String_Node_Str","String_Node_Str");
      props.put(prefix + "String_Node_Str",agents[i].getHost());
      props.put(prefix + "String_Node_Str",Integer.toString(agents[i].getPort()));
      props.put(prefix + "String_Node_Str",Integer.toString(batchSize));
      props.put(name + "String_Node_Str" + i,Integer.toString(priority));
      --priority;
    }
    props.put(name + "String_Node_Str",sb.toString());
    props.put(name + "String_Node_Str","String_Node_Str");
    props.put(name + "String_Node_Str",sb.toString());
    props.put(name + "String_Node_Str","String_Node_Str");
    final String sourceChannels="String_Node_Str";
    props.put(name + "String_Node_Str",sourceChannels);
    props.put(name + "String_Node_Str" + FlumeEmbeddedManager.SOURCE_NAME+ "String_Node_Str",sourceChannels);
  }
 else {
    String channels=null;
    String[] sinks=null;
    props.put(name + "String_Node_Str",FlumeEmbeddedManager.SOURCE_NAME);
    props.put(name + "String_Node_Str" + FlumeEmbeddedManager.SOURCE_NAME+ "String_Node_Str",sourceType);
    for (    final Property property : properties) {
      final String key=property.getName();
      if (key == null || key.length() == 0) {
        final String msg="String_Node_Str";
        LOGGER.error(msg);
        throw new ConfigurationException(msg);
      }
      final String upperKey=key.toUpperCase(Locale.ENGLISH);
      if (upperKey.startsWith(name.toUpperCase(Locale.ENGLISH))) {
        final String msg="String_Node_Str" + key;
        LOGGER.error(msg);
        throw new ConfigurationException(msg);
      }
      if (upperKey.startsWith("String_Node_Str")) {
        final String msg="String_Node_Str" + key;
        LOGGER.error(msg);
        throw new ConfigurationException(msg);
      }
      final String value=property.getValue();
      if (value == null || value.length() == 0) {
        final String msg="String_Node_Str" + key + "String_Node_Str";
        LOGGER.error(msg);
        throw new ConfigurationException(msg);
      }
      if (upperKey.equals("String_Node_Str")) {
        channels=value.trim();
      }
 else       if (upperKey.equals("String_Node_Str")) {
        sinks=value.trim().split("String_Node_Str");
      }
      props.put(name + '.' + key,value);
    }
    String sourceChannels=channels;
    if (channels == null) {
      sourceChannels="String_Node_Str";
      props.put(name + "String_Node_Str",sourceChannels);
    }
    props.put(name + "String_Node_Str" + FlumeEmbeddedManager.SOURCE_NAME+ "String_Node_Str",sourceChannels);
    if (sinks == null || sinks.length == 0) {
      final String msg="String_Node_Str";
      LOGGER.error(msg);
      throw new ConfigurationException(msg);
    }
  }
  return props;
}

Fixed version (ground truth):
private Properties createProperties(final String name,final Agent[] agents,final Property[] properties,final int batchSize,String dataDir){
  final Properties props=new Properties();
  if ((agents == null || agents.length == 0) && (properties == null || properties.length == 0)) {
    LOGGER.error("String_Node_Str");
    throw new ConfigurationException("String_Node_Str");
  }
  if ((agents != null && agents.length > 0 && properties != null && properties.length > 0)) {
    LOGGER.error("String_Node_Str");
    throw new ConfigurationException("String_Node_Str");
  }
  if (agents != null && agents.length > 0) {
    props.put(name + "String_Node_Str",FlumeEmbeddedManager.SOURCE_NAME);
    props.put(name + "String_Node_Str" + FlumeEmbeddedManager.SOURCE_NAME+ "String_Node_Str",SOURCE_TYPE);
    props.put(name + "String_Node_Str","String_Node_Str");
    props.put(name + "String_Node_Str","String_Node_Str");
    if (dataDir != null && dataDir.length() > 0) {
      if (!dataDir.endsWith(Constants.LINE_SEP)) {
        dataDir=dataDir + Constants.LINE_SEP;
      }
      props.put(name + "String_Node_Str",dataDir + "String_Node_Str");
      props.put(name + "String_Node_Str",dataDir + "String_Node_Str");
    }
    final StringBuilder sb=new StringBuilder();
    String leading="String_Node_Str";
    int priority=agents.length;
    for (int i=0; i < agents.length; ++i) {
      sb.append(leading).append("String_Node_Str").append(i);
      leading="String_Node_Str";
      final String prefix=name + "String_Node_Str" + i;
      props.put(prefix + "String_Node_Str","String_Node_Str");
      props.put(prefix + "String_Node_Str","String_Node_Str");
      props.put(prefix + "String_Node_Str",agents[i].getHost());
      props.put(prefix + "String_Node_Str",Integer.toString(agents[i].getPort()));
      props.put(prefix + "String_Node_Str",Integer.toString(batchSize));
      props.put(name + "String_Node_Str" + i,Integer.toString(priority));
      --priority;
    }
    props.put(name + "String_Node_Str",sb.toString());
    props.put(name + "String_Node_Str","String_Node_Str");
    props.put(name + "String_Node_Str",sb.toString());
    props.put(name + "String_Node_Str","String_Node_Str");
    final String sourceChannels="String_Node_Str";
    props.put(name + "String_Node_Str",sourceChannels);
    props.put(name + "String_Node_Str" + FlumeEmbeddedManager.SOURCE_NAME+ "String_Node_Str",sourceChannels);
  }
 else {
    String channels=null;
    String[] sinks=null;
    props.put(name + "String_Node_Str",FlumeEmbeddedManager.SOURCE_NAME);
    props.put(name + "String_Node_Str" + FlumeEmbeddedManager.SOURCE_NAME+ "String_Node_Str",SOURCE_TYPE);
    for (    final Property property : properties) {
      final String key=property.getName();
      if (key == null || key.length() == 0) {
        final String msg="String_Node_Str";
        LOGGER.error(msg);
        throw new ConfigurationException(msg);
      }
      final String upperKey=key.toUpperCase(Locale.ENGLISH);
      if (upperKey.startsWith(name.toUpperCase(Locale.ENGLISH))) {
        final String msg="String_Node_Str" + key;
        LOGGER.error(msg);
        throw new ConfigurationException(msg);
      }
      if (upperKey.startsWith("String_Node_Str")) {
        final String msg="String_Node_Str" + key;
        LOGGER.error(msg);
        throw new ConfigurationException(msg);
      }
      final String value=property.getValue();
      if (value == null || value.length() == 0) {
        final String msg="String_Node_Str" + key + "String_Node_Str";
        LOGGER.error(msg);
        throw new ConfigurationException(msg);
      }
      if (upperKey.equals("String_Node_Str")) {
        channels=value.trim();
      }
 else       if (upperKey.equals("String_Node_Str")) {
        sinks=value.trim().split("String_Node_Str");
      }
      props.put(name + '.' + key,value);
    }
    String sourceChannels=channels;
    if (channels == null) {
      sourceChannels="String_Node_Str";
      props.put(name + "String_Node_Str",sourceChannels);
    }
    props.put(name + "String_Node_Str" + FlumeEmbeddedManager.SOURCE_NAME+ "String_Node_Str",sourceChannels);
    if (sinks == null || sinks.length == 0) {
      final String msg="String_Node_Str";
      LOGGER.error(msg);
      throw new ConfigurationException(msg);
    }
  }
  return props;
}