Program: 28927
Project: 28927
Buggy source:
/** 
 * Implementation of org.jvnet.hk2.config.ConfigListener 
 */
public UnprocessedChangeEvents changed(PropertyChangeEvent[] events){
  jmsService=serverConfig.getExtensionByType(JmsService.class);
  List<UnprocessedChangeEvent> unprocessedEvents=new ArrayList<UnprocessedChangeEvent>();
  _logger.log(Level.FINE,"String_Node_Str");
  Domain domain=Globals.get(Domain.class);
  String jmsProviderPort=null;
  ServerContext serverContext=Globals.get(ServerContext.class);
  Server thisServer=domain.getServerNamed(serverContext.getInstanceName());
{
  }
  for (int i=0; i < events.length; i++) {
    PropertyChangeEvent event=events[i];
    String eventName=event.getPropertyName();
    Object oldValue=event.getOldValue();
    Object newValue=event.getNewValue();
    if (event.getSource().toString().indexOf("String_Node_Str") != -1) {
      UnprocessedChangeEvent uchangeEvent=new UnprocessedChangeEvent(event,"String_Node_Str");
      unprocessedEvents.add(uchangeEvent);
    }
 else     if (event.getSource().toString().indexOf("String_Node_Str") != -1) {
      UnprocessedChangeEvent uchangeEvent=new UnprocessedChangeEvent(event,"String_Node_Str");
      unprocessedEvents.add(uchangeEvent);
    }
    _logger.log(Level.FINE,"String_Node_Str" + eventName + oldValue+ newValue);
    if (oldValue != null && oldValue.equals(newValue)) {
      _logger.log(Level.FINE,"String_Node_Str" + eventName + "String_Node_Str"+ oldValue);
      continue;
    }
    if ("String_Node_Str".equals(newValue)) {
      PropertyChangeEvent nextevent=events[i + 1];
      jmsProviderPort=(String)nextevent.getNewValue();
    }
    if (event.getSource() instanceof JmsService) {
      if (eventName.equals(ServerTags.MASTER_BROKER)) {
        String oldMB=oldValue != null ? oldValue.toString() : null;
        String newMB=newValue != null ? newValue.toString() : null;
        _logger.log(Level.FINE,"String_Node_Str" + event.getSource() + "String_Node_Str"+ eventName+ "String_Node_Str"+ oldMB+ "String_Node_Str"+ newMB);
        if (newMB != null) {
          Server newMBServer=domain.getServerNamed(newMB);
          if (newMBServer != null) {
            Node node=domain.getNodeNamed(newMBServer.getNodeRef());
            String newMasterBrokerPort=JmsRaUtil.getJMSPropertyValue(newMBServer);
            if (newMasterBrokerPort == null)             newMasterBrokerPort=getDefaultJmsHost(jmsService).getPort();
            String newMasterBrokerHost=node.getNodeHost();
            aresourceAdapter.setMasterBroker(newMasterBrokerHost + "String_Node_Str" + newMasterBrokerPort);
          }
        }
      }
    }
    if (eventName.equals(ServerTags.SERVER_REF)) {
      String oldServerRef=oldValue != null ? oldValue.toString() : null;
      String newServerRef=newValue != null ? newValue.toString() : null;
      if (oldServerRef != null && newServerRef == null && !thisServer.isDas()) {
        _logger.log(Level.FINE,"String_Node_Str" + event.getSource() + "String_Node_Str"+ eventName+ "String_Node_Str"+ oldServerRef+ "String_Node_Str"+ newServerRef);
        String url=getBrokerList();
        aresourceAdapter.setClusterBrokerList(url);
        break;
      }
    }
    if (event.getSource() instanceof Server) {
      _logger.log(Level.FINE,"String_Node_Str" + event.getSource());
      Server changedServer=(Server)event.getSource();
      if (thisServer.isDas())       return null;
      if (jmsProviderPort != null) {
        String nodeName=changedServer.getNodeRef();
        String nodeHost=null;
        if (nodeName != null)         nodeHost=domain.getNodeNamed(nodeName).getNodeHost();
        String url=getBrokerList();
        url=url + "String_Node_Str" + nodeHost+ "String_Node_Str"+ jmsProviderPort;
        aresourceAdapter.setClusterBrokerList(url);
        break;
      }
    }
  }
  return unprocessedEvents.size() > 0 ? new UnprocessedChangeEvents(unprocessedEvents) : null;
}

Fixed version (ground truth):
/** 
 * Implementation of org.jvnet.hk2.config.ConfigListener 
 */
public UnprocessedChangeEvents changed(PropertyChangeEvent[] events){
  jmsService=serverConfig.getExtensionByType(JmsService.class);
  List<UnprocessedChangeEvent> unprocessedEvents=new ArrayList<UnprocessedChangeEvent>();
  _logger.log(Level.FINE,"String_Node_Str");
  Domain domain=Globals.get(Domain.class);
  String jmsProviderPort=null;
  ServerContext serverContext=Globals.get(ServerContext.class);
  Server thisServer=domain.getServerNamed(serverContext.getInstanceName());
{
  }
  for (int i=0; i < events.length; i++) {
    PropertyChangeEvent event=events[i];
    String eventName=event.getPropertyName();
    Object oldValue=event.getOldValue();
    Object newValue=event.getNewValue();
    if (event.getSource().toString().indexOf("String_Node_Str") != -1) {
      UnprocessedChangeEvent uchangeEvent=new UnprocessedChangeEvent(event,"String_Node_Str");
      unprocessedEvents.add(uchangeEvent);
    }
 else     if (event.getSource().toString().indexOf("String_Node_Str") != -1) {
      UnprocessedChangeEvent uchangeEvent=new UnprocessedChangeEvent(event,"String_Node_Str");
      unprocessedEvents.add(uchangeEvent);
    }
    _logger.log(Level.FINE,"String_Node_Str" + eventName + oldValue+ newValue);
    if (oldValue != null && oldValue.equals(newValue)) {
      _logger.log(Level.FINE,"String_Node_Str" + eventName + "String_Node_Str"+ oldValue);
      continue;
    }
    if ("String_Node_Str".equals(newValue)) {
      PropertyChangeEvent nextevent=events[i + 1];
      jmsProviderPort=(String)nextevent.getNewValue();
    }
    if (event.getSource() instanceof JmsService) {
      if (eventName.equals(ServerTags.MASTER_BROKER)) {
        String oldMB=oldValue != null ? oldValue.toString() : null;
        String newMB=newValue != null ? newValue.toString() : null;
        _logger.log(Level.FINE,"String_Node_Str" + event.getSource() + "String_Node_Str"+ eventName+ "String_Node_Str"+ oldMB+ "String_Node_Str"+ newMB);
        if (newMB != null) {
          Server newMBServer=domain.getServerNamed(newMB);
          if (newMBServer != null) {
            Node node=domain.getNodeNamed(newMBServer.getNodeRef());
            String newMasterBrokerPort=JmsRaUtil.getJMSPropertyValue(newMBServer);
            if (newMasterBrokerPort == null)             newMasterBrokerPort=getDefaultJmsHost(jmsService).getPort();
            String newMasterBrokerHost=node.getNodeHost();
            aresourceAdapter.setMasterBroker(newMasterBrokerHost + "String_Node_Str" + newMasterBrokerPort);
          }
        }
      }
    }
    if (eventName.equals(ServerTags.SERVER_REF)) {
      String oldServerRef=oldValue != null ? oldValue.toString() : null;
      String newServerRef=newValue != null ? newValue.toString() : null;
      if (oldServerRef != null && newServerRef == null && !thisServer.isDas()) {
        _logger.log(Level.FINE,"String_Node_Str" + event.getSource() + "String_Node_Str"+ eventName+ "String_Node_Str"+ oldServerRef+ "String_Node_Str"+ null);
        String url=getBrokerList();
        aresourceAdapter.setClusterBrokerList(url);
        break;
      }
    }
    if (event.getSource() instanceof Server) {
      _logger.log(Level.FINE,"String_Node_Str" + event.getSource());
      Server changedServer=(Server)event.getSource();
      if (thisServer.isDas())       return null;
      if (jmsProviderPort != null) {
        String nodeName=changedServer.getNodeRef();
        String nodeHost=null;
        if (nodeName != null)         nodeHost=domain.getNodeNamed(nodeName).getNodeHost();
        String url=getBrokerList();
        url=url + "String_Node_Str" + nodeHost+ "String_Node_Str"+ jmsProviderPort;
        aresourceAdapter.setClusterBrokerList(url);
        break;
      }
    }
  }
  return unprocessedEvents.size() > 0 ? new UnprocessedChangeEvents(unprocessedEvents) : null;
}