Program: 34732
Project: 34732
Buggy source:
/** 
 * {@inheritDoc} <p>This method is triggered by the managed service listening for logging configuration updates from config admin & metatype processing. Tr metatype is defined to preserve variables set in bootstrap.properties so values set there are not unset by metatype defaults.
 * @param config a {@link LogProviderConfigImpl} containing dynamic updates fromthe OSGi managed service.
 */
@Override public synchronized void update(LogProviderConfig config){
  LogProviderConfigImpl trConfig=(LogProviderConfigImpl)config;
  logHeader=trConfig.getLogHeader();
  javaLangInstrument=trConfig.hasJavaLangInstrument();
  consoleLogLevel=trConfig.getConsoleLogLevel();
  copySystemStreams=trConfig.copySystemStreams();
  hideMessageids=trConfig.getMessagesToHide();
  if (hideMessageids.size() > 0) {
    logHeader=logHeader.concat("String_Node_Str" + hideMessageids).concat((LoggingConstants.nl));
  }
  if (formatter == null || trConfig.getTraceFormat() != formatter.getTraceFormat()) {
    formatter=new BaseTraceFormatter(trConfig.getTraceFormat());
  }
  isoDateFormat=trConfig.getIsoDateFormat();
  if (isoDateFormat != BaseTraceFormatter.useIsoDateFormat) {
    BaseTraceFormatter.useIsoDateFormat=isoDateFormat;
  }
  initializeWriters(trConfig);
  if (hideMessageids.size() > 0) {
    Tr.info(TraceSpecification.getTc(),"String_Node_Str",new Object[]{hideMessageids});
  }
  serverName=trConfig.getServerName();
  wlpUserDir=trConfig.getWlpUsrDir();
  if (collectorMgrPipelineUtils == null) {
    collectorMgrPipelineUtils=CollectorManagerPipelineUtils.getInstance();
  }
  logSource=collectorMgrPipelineUtils.getLogSource();
  traceSource=collectorMgrPipelineUtils.getTraceSource();
  logConduit=collectorMgrPipelineUtils.getLogConduit();
  traceConduit=collectorMgrPipelineUtils.getTraceConduit();
  String messageFormat=trConfig.getMessageFormat();
  String consoleFormat=trConfig.getConsoleFormat();
  List<String> messageSourceList=new ArrayList<String>(trConfig.getMessageSource());
  List<String> consoleSourceList=new ArrayList<String>(trConfig.getConsoleSource());
  List<String> filterdMessageSourceList=filterSourcelist(messageSourceList);
  List<String> filterdConsoleSourceList=filterSourcelist(consoleSourceList);
  if (messageLogHandler == null && messagesLog != null) {
    messageLogHandler=new MessageLogHandler(serverName,wlpUserDir,filterdMessageSourceList);
    collectorMgrPipelineUtils.setMessageHandler(messageLogHandler);
    messageLogHandler.setWriter(messagesLog);
  }
  if (consoleLogHandler == null) {
    consoleLogHandler=new ConsoleLogHandler(serverName,wlpUserDir,filterdConsoleSourceList);
    collectorMgrPipelineUtils.setConsoleHandler(consoleLogHandler);
    consoleLogHandler.setWriter(systemOut);
    consoleLogHandler.setSysErrHolder(systemErr);
  }
  if (messageFormat.toLowerCase().equals(LoggingConstants.DEFAULT_MESSAGE_FORMAT)) {
    if (messageLogHandler != null) {
      messageLogHandler.setFormat(LoggingConstants.DEFAULT_MESSAGE_FORMAT);
      messageLogHandler.setWriter(messagesLog);
      ArrayList<String> filteredList=new ArrayList<String>();
      filteredList.add("String_Node_Str");
      updateConduitSyncHandlerConnection(filteredList,messageLogHandler);
    }
  }
  if (consoleFormat.toLowerCase().equals(LoggingConstants.DEFAULT_CONSOLE_FORMAT)) {
    if (consoleLogHandler != null) {
      consoleLogHandler.setFormat(LoggingConstants.DEFAULT_CONSOLE_FORMAT);
      ArrayList<String> filteredList=new ArrayList<String>();
      filteredList.add("String_Node_Str");
      if (traceLog == systemOut) {
        filteredList.add("String_Node_Str");
        consoleLogHandler.setIsTraceStdout(true);
      }
 else {
        consoleLogHandler.setIsTraceStdout(false);
      }
      updateConduitSyncHandlerConnection(filteredList,consoleLogHandler);
      consoleLogHandler.setCopySystemStreams(copySystemStreams);
      consoleLogHandler.setConsoleLogLevel(consoleLogLevel.intValue());
    }
  }
  if (messageFormat.toLowerCase().equals(LoggingConstants.JSON_FORMAT)) {
    if (messageLogHandler != null) {
      messageLogHandler.setFormat(LoggingConstants.JSON_FORMAT);
      messageLogHandler.setWriter(messagesLog);
      messageLogHandler.modified(filterdMessageSourceList);
      updateConduitSyncHandlerConnection(messageSourceList,messageLogHandler);
    }
  }
  if (consoleFormat.toLowerCase().equals(LoggingConstants.JSON_FORMAT)) {
    if (consoleLogHandler != null) {
      consoleLogHandler.setFormat(LoggingConstants.JSON_FORMAT);
      consoleLogHandler.modified(filterdConsoleSourceList);
      updateConduitSyncHandlerConnection(consoleSourceList,consoleLogHandler);
    }
  }
  if (messageLogHandler != null) {
    messageLogHandler.setFormatter(formatter);
  }
  consoleLogHandler.setFormatter(formatter);
  consoleLogHandler.setBTS(this);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} <p>This method is triggered by the managed service listening for logging configuration updates from config admin & metatype processing. Tr metatype is defined to preserve variables set in bootstrap.properties so values set there are not unset by metatype defaults.
 * @param config a {@link LogProviderConfigImpl} containing dynamic updates fromthe OSGi managed service.
 */
@Override public synchronized void update(LogProviderConfig config){
  LogProviderConfigImpl trConfig=(LogProviderConfigImpl)config;
  logHeader=trConfig.getLogHeader();
  javaLangInstrument=trConfig.hasJavaLangInstrument();
  consoleLogLevel=trConfig.getConsoleLogLevel();
  copySystemStreams=trConfig.copySystemStreams();
  hideMessageids=trConfig.getMessagesToHide();
  if (hideMessageids.size() > 0) {
    logHeader=logHeader.concat("String_Node_Str" + hideMessageids).concat((LoggingConstants.nl));
  }
  if (formatter == null || trConfig.getTraceFormat() != formatter.getTraceFormat()) {
    formatter=new BaseTraceFormatter(trConfig.getTraceFormat());
  }
  isoDateFormat=trConfig.getIsoDateFormat();
  if (isoDateFormat != BaseTraceFormatter.useIsoDateFormat) {
    BaseTraceFormatter.useIsoDateFormat=isoDateFormat;
  }
  initializeWriters(trConfig);
  if (hideMessageids.size() > 0) {
    Tr.info(TraceSpecification.getTc(),"String_Node_Str",new Object[]{hideMessageids});
  }
  serverName=trConfig.getServerName();
  wlpUserDir=trConfig.getWlpUsrDir();
  if (collectorMgrPipelineUtils == null) {
    collectorMgrPipelineUtils=CollectorManagerPipelineUtils.getInstance();
    collectorMgrPipelineUtils.setJsonTrService(true);
  }
  logSource=collectorMgrPipelineUtils.getLogSource();
  traceSource=collectorMgrPipelineUtils.getTraceSource();
  logConduit=collectorMgrPipelineUtils.getLogConduit();
  traceConduit=collectorMgrPipelineUtils.getTraceConduit();
  String messageFormat=trConfig.getMessageFormat();
  String consoleFormat=trConfig.getConsoleFormat();
  List<String> messageSourceList=new ArrayList<String>(trConfig.getMessageSource());
  List<String> consoleSourceList=new ArrayList<String>(trConfig.getConsoleSource());
  List<String> filterdMessageSourceList=filterSourcelist(messageSourceList);
  List<String> filterdConsoleSourceList=filterSourcelist(consoleSourceList);
  if (messageLogHandler == null && messagesLog != null) {
    messageLogHandler=new MessageLogHandler(serverName,wlpUserDir,filterdMessageSourceList);
    collectorMgrPipelineUtils.setMessageHandler(messageLogHandler);
    messageLogHandler.setWriter(messagesLog);
  }
  if (consoleLogHandler == null) {
    consoleLogHandler=new ConsoleLogHandler(serverName,wlpUserDir,filterdConsoleSourceList);
    collectorMgrPipelineUtils.setConsoleHandler(consoleLogHandler);
    consoleLogHandler.setWriter(systemOut);
    consoleLogHandler.setSysErrHolder(systemErr);
  }
  if (messageFormat.toLowerCase().equals(LoggingConstants.DEFAULT_MESSAGE_FORMAT)) {
    if (messageLogHandler != null) {
      messageLogHandler.setFormat(LoggingConstants.DEFAULT_MESSAGE_FORMAT);
      messageLogHandler.setWriter(messagesLog);
      ArrayList<String> filteredList=new ArrayList<String>();
      filteredList.add("String_Node_Str");
      updateConduitSyncHandlerConnection(filteredList,messageLogHandler);
    }
  }
  if (consoleFormat.toLowerCase().equals(LoggingConstants.DEFAULT_CONSOLE_FORMAT)) {
    if (consoleLogHandler != null) {
      consoleLogHandler.setFormat(LoggingConstants.DEFAULT_CONSOLE_FORMAT);
      ArrayList<String> filteredList=new ArrayList<String>();
      filteredList.add("String_Node_Str");
      if (traceLog == systemOut) {
        filteredList.add("String_Node_Str");
        consoleLogHandler.setIsTraceStdout(true);
      }
 else {
        consoleLogHandler.setIsTraceStdout(false);
      }
      updateConduitSyncHandlerConnection(filteredList,consoleLogHandler);
      consoleLogHandler.setCopySystemStreams(copySystemStreams);
      consoleLogHandler.setConsoleLogLevel(consoleLogLevel.intValue());
    }
  }
  if (messageFormat.toLowerCase().equals(LoggingConstants.JSON_FORMAT)) {
    if (messageLogHandler != null) {
      messageLogHandler.setFormat(LoggingConstants.JSON_FORMAT);
      messageLogHandler.setWriter(messagesLog);
      messageLogHandler.modified(filterdMessageSourceList);
      updateConduitSyncHandlerConnection(messageSourceList,messageLogHandler);
    }
  }
  if (consoleFormat.toLowerCase().equals(LoggingConstants.JSON_FORMAT)) {
    if (consoleLogHandler != null) {
      consoleLogHandler.setFormat(LoggingConstants.JSON_FORMAT);
      consoleLogHandler.modified(filterdConsoleSourceList);
      updateConduitSyncHandlerConnection(consoleSourceList,consoleLogHandler);
    }
  }
  if (messageLogHandler != null) {
    messageLogHandler.setFormatter(formatter);
  }
  consoleLogHandler.setFormatter(formatter);
  consoleLogHandler.setBTS(this);
}