Program: 90915
Project: 90915
Buggy source:
/** 
 * Create a SyslogAppender.
 * @param host The name of the host to connect to.
 * @param portNum The port to connect to on the target host.
 * @param protocol The Protocol to use.
 * @param delay The interval in which failed writes should be retried.
 * @param name The name of the Appender.
 * @param immediateFlush "true" if data should be flushed on each write.
 * @param suppress "true" if exceptions should be hidden from the application, "false" otherwise.The default is "true".
 * @param facility The Facility is used to try to classify the message.
 * @param id The default structured data id to use when formatting according to RFC 5424.
 * @param ein The IANA enterprise number.
 * @param includeMDC Indicates whether data from the ThreadContextMap will be included in the RFC 5424 Syslogrecord. Defaults to "true:.
 * @param mdcId The id to use for the MDC Structured Data Element.
 * @param includeNL If true, a newline will be appended to the end of the syslog record. The default is false.
 * @param appName The value to use as the APP-NAME in the RFC 5424 syslog record.
 * @param msgId The default value to be used in the MSGID field of RFC 5424 syslog records.
 * @param excludes A comma separated list of mdc keys that should be excluded from the LogEvent.
 * @param includes A comma separated list of mdc keys that should be included in the FlumeEvent.
 * @param required A comma separated list of mdc keys that must be present in the MDC.
 * @param format If set to "RFC5424" the data will be formatted in accordance with RFC 5424. Otherwise,it will be formatted as a BSD Syslog record.
 * @param filter A Filter to determine if the event should be handled by this Appender.
 * @param config The Configuration.
 * @param charset The character set to use when converting the syslog String to a byte array.
 * @return A SyslogAppender.
 */
@PluginFactory public static SyslogAppender createAppender(@PluginAttr("String_Node_Str") String host,@PluginAttr("String_Node_Str") String portNum,@PluginAttr("String_Node_Str") String protocol,@PluginAttr("String_Node_Str") String delay,@PluginAttr("String_Node_Str") String name,@PluginAttr("String_Node_Str") String immediateFlush,@PluginAttr("String_Node_Str") String suppress,@PluginAttr("String_Node_Str") String facility,@PluginAttr("String_Node_Str") String id,@PluginAttr("String_Node_Str") String ein,@PluginAttr("String_Node_Str") String includeMDC,@PluginAttr("String_Node_Str") String mdcId,@PluginAttr("String_Node_Str") String includeNL,@PluginAttr("String_Node_Str") String appName,@PluginAttr("String_Node_Str") String msgId,@PluginAttr("String_Node_Str") String excludes,@PluginAttr("String_Node_Str") String includes,@PluginAttr("String_Node_Str") String required,@PluginAttr("String_Node_Str") String format,@PluginElement("String_Node_Str") Filter filter,@PluginConfiguration Configuration config,@PluginAttr("String_Node_Str") String charset){
  boolean isFlush=immediateFlush == null ? true : Boolean.valueOf(immediateFlush);
  ;
  boolean handleExceptions=suppress == null ? true : Boolean.valueOf(suppress);
  int reconnectDelay=delay == null ? 0 : Integer.parseInt(delay);
  int port=portNum == null ? 0 : Integer.parseInt(portNum);
  Charset c=Charset.isSupported("String_Node_Str") ? Charset.forName("String_Node_Str") : Charset.defaultCharset();
  if (charset != null) {
    if (Charset.isSupported(charset)) {
      c=Charset.forName(charset);
    }
 else {
      LOGGER.error("String_Node_Str" + charset + "String_Node_Str"+ c.displayName());
    }
  }
  Layout layout=(format.equalsIgnoreCase(RFC5424)) ? RFC5424Layout.createLayout(facility,id,ein,includeMDC,mdcId,includeNL,appName,msgId,excludes,includes,required,charset,config) : SyslogLayout.createLayout(facility,includeNL,charset);
  if (name == null) {
    LOGGER.error("String_Node_Str");
    return null;
  }
  AbstractSocketManager manager=createSocketManager(protocol,host,port,reconnectDelay);
  if (manager == null) {
    return null;
  }
  return new SyslogAppender(name,layout,filter,handleExceptions,isFlush,manager);
}

Fixed version (ground truth):
/** 
 * Create a SyslogAppender.
 * @param host The name of the host to connect to.
 * @param portNum The port to connect to on the target host.
 * @param protocol The Protocol to use.
 * @param delay The interval in which failed writes should be retried.
 * @param name The name of the Appender.
 * @param immediateFlush "true" if data should be flushed on each write.
 * @param suppress "true" if exceptions should be hidden from the application, "false" otherwise.The default is "true".
 * @param facility The Facility is used to try to classify the message.
 * @param id The default structured data id to use when formatting according to RFC 5424.
 * @param ein The IANA enterprise number.
 * @param includeMDC Indicates whether data from the ThreadContextMap will be included in the RFC 5424 Syslogrecord. Defaults to "true:.
 * @param mdcId The id to use for the MDC Structured Data Element.
 * @param includeNL If true, a newline will be appended to the end of the syslog record. The default is false.
 * @param appName The value to use as the APP-NAME in the RFC 5424 syslog record.
 * @param msgId The default value to be used in the MSGID field of RFC 5424 syslog records.
 * @param excludes A comma separated list of mdc keys that should be excluded from the LogEvent.
 * @param includes A comma separated list of mdc keys that should be included in the FlumeEvent.
 * @param required A comma separated list of mdc keys that must be present in the MDC.
 * @param format If set to "RFC5424" the data will be formatted in accordance with RFC 5424. Otherwise,it will be formatted as a BSD Syslog record.
 * @param filter A Filter to determine if the event should be handled by this Appender.
 * @param config The Configuration.
 * @param charset The character set to use when converting the syslog String to a byte array.
 * @return A SyslogAppender.
 */
@PluginFactory public static SyslogAppender createAppender(@PluginAttr("String_Node_Str") String host,@PluginAttr("String_Node_Str") String portNum,@PluginAttr("String_Node_Str") String protocol,@PluginAttr("String_Node_Str") String delay,@PluginAttr("String_Node_Str") String name,@PluginAttr("String_Node_Str") String immediateFlush,@PluginAttr("String_Node_Str") String suppress,@PluginAttr("String_Node_Str") String facility,@PluginAttr("String_Node_Str") String id,@PluginAttr("String_Node_Str") String ein,@PluginAttr("String_Node_Str") String includeMDC,@PluginAttr("String_Node_Str") String mdcId,@PluginAttr("String_Node_Str") String includeNL,@PluginAttr("String_Node_Str") String appName,@PluginAttr("String_Node_Str") String msgId,@PluginAttr("String_Node_Str") String excludes,@PluginAttr("String_Node_Str") String includes,@PluginAttr("String_Node_Str") String required,@PluginAttr("String_Node_Str") String format,@PluginElement("String_Node_Str") Filter filter,@PluginConfiguration Configuration config,@PluginAttr("String_Node_Str") String charset){
  boolean isFlush=immediateFlush == null ? true : Boolean.valueOf(immediateFlush);
  boolean handleExceptions=suppress == null ? true : Boolean.valueOf(suppress);
  int reconnectDelay=delay == null ? 0 : Integer.parseInt(delay);
  int port=portNum == null ? 0 : Integer.parseInt(portNum);
  Charset c=Charset.isSupported("String_Node_Str") ? Charset.forName("String_Node_Str") : Charset.defaultCharset();
  if (charset != null) {
    if (Charset.isSupported(charset)) {
      c=Charset.forName(charset);
    }
 else {
      LOGGER.error("String_Node_Str" + charset + "String_Node_Str"+ c.displayName());
    }
  }
  Layout layout=(format.equalsIgnoreCase(RFC5424)) ? RFC5424Layout.createLayout(facility,id,ein,includeMDC,mdcId,includeNL,appName,msgId,excludes,includes,required,charset,config) : SyslogLayout.createLayout(facility,includeNL,charset);
  if (name == null) {
    LOGGER.error("String_Node_Str");
    return null;
  }
  AbstractSocketManager manager=createSocketManager(protocol,host,port,reconnectDelay);
  if (manager == null) {
    return null;
  }
  return new SyslogAppender(name,layout,filter,handleExceptions,isFlush,manager);
}