Program: 46206
Project: 46206
Buggy source:
public void processVoiceChatMessage(WonderlandClientSender sender,WonderlandClientID clientID,VoiceChatMessage message){
  String group=message.getGroup();
  if (message instanceof VoiceChatInfoRequestMessage) {
    sendVoiceChatInfo(sender,clientID,group);
    return;
  }
  if (message instanceof VoiceChatBusyMessage) {
    VoiceChatBusyMessage msg=(VoiceChatBusyMessage)message;
    CommsManager cm=CommsManagerFactory.getCommsManager();
    WonderlandClientID id=cm.getWonderlandClientID(msg.getCaller().clientID);
    if (id == null) {
      logger.warning("String_Node_Str" + msg.getCaller());
      return;
    }
    sendVoiceChatBusyMessage(sender,id,msg);
    return;
  }
  VoiceManager vm=AppContext.getManager(VoiceManager.class);
  AudioGroup audioGroup=vm.getAudioGroup(group);
  if (message instanceof VoiceChatLeaveMessage) {
    if (audioGroup == null) {
      logger.info("String_Node_Str");
      return;
    }
    VoiceChatLeaveMessage msg=(VoiceChatLeaveMessage)message;
    Player player=vm.getPlayer(msg.getCallee().callID);
    if (player == null) {
      logger.warning("String_Node_Str" + msg.getCallee());
      if (audioGroup.getNumberOfPlayers() == 0) {
        endVoiceChat(vm,audioGroup);
      }
      sender.send(msg);
      return;
    }
    removePlayerFromAudioGroup(audioGroup,player);
    if (audioGroup.getNumberOfPlayers() <= 1) {
      endVoiceChat(vm,audioGroup);
    }
    sender.send(msg);
    vm.dump("String_Node_Str");
    return;
  }
  if (message instanceof VoiceChatEndMessage) {
    if (audioGroup == null) {
      logger.info("String_Node_Str");
      return;
    }
    endVoiceChat(vm,audioGroup);
    vm.dump("String_Node_Str");
    return;
  }
  if (message instanceof VoiceChatJoinAcceptedMessage == true) {
    if (audioGroup == null) {
      logger.warning("String_Node_Str" + group + "String_Node_Str");
      return;
    }
    VoiceChatJoinAcceptedMessage msg=(VoiceChatJoinAcceptedMessage)message;
    addPlayerToAudioGroup(vm,audioGroup,msg.getCallee(),msg.getChatType());
    sender.send(msg);
    return;
  }
  if (message instanceof VoiceChatHoldMessage == true) {
    VoiceChatHoldMessage msg=(VoiceChatHoldMessage)message;
    if (audioGroup == null) {
      logger.warning("String_Node_Str" + group + "String_Node_Str");
      return;
    }
    Player player=vm.getPlayer(msg.getCallee().callID);
    if (player == null) {
      logger.warning("String_Node_Str" + msg.getCallee().callID);
      return;
    }
    AudioGroupPlayerInfo playerInfo=audioGroup.getPlayerInfo(player);
    if (playerInfo == null) {
      logger.warning("String_Node_Str" + player);
      return;
    }
    AudioGroup livePlayerAudioGroup=vm.getVoiceManagerParameters().livePlayerAudioGroup;
    AudioGroup stationaryPlayerAudioGroup=vm.getVoiceManagerParameters().stationaryPlayerAudioGroup;
    if (msg.isOnHold()) {
      playerInfo.isSpeaking=false;
      audioGroup.setSpeakingAttenuation(player,0);
      audioGroup.setListenAttenuation(player,0);
      livePlayerAudioGroup.setSpeakingAttenuation(player,AudioGroup.DEFAULT_SPEAKING_ATTENUATION);
      livePlayerAudioGroup.setListenAttenuation(player,AudioGroup.DEFAULT_LISTEN_ATTENUATION);
      stationaryPlayerAudioGroup.setSpeakingAttenuation(player,AudioGroup.DEFAULT_SPEAKING_ATTENUATION);
      stationaryPlayerAudioGroup.setListenAttenuation(player,AudioGroup.DEFAULT_LISTEN_ATTENUATION);
    }
 else {
      playerInfo.isSpeaking=true;
      audioGroup.setSpeakingAttenuation(player,AudioGroup.DEFAULT_SPEAKING_ATTENUATION);
      audioGroup.setListenAttenuation(player,AudioGroup.DEFAULT_LISTEN_ATTENUATION);
      if (playerInfo.chatType.equals(ChatType.PUBLIC)) {
        livePlayerAudioGroup.setSpeakingAttenuation(player,AudioGroup.DEFAULT_SPEAKING_ATTENUATION);
        livePlayerAudioGroup.setListenAttenuation(player,AudioGroup.DEFAULT_LISTEN_ATTENUATION);
        stationaryPlayerAudioGroup.setListenAttenuation(player,AudioGroup.DEFAULT_LISTEN_ATTENUATION);
      }
 else {
        livePlayerAudioGroup.setSpeakingAttenuation(player,0);
        livePlayerAudioGroup.setListenAttenuation(player,AudioGroup.MINIMAL_LISTEN_ATTENUATION);
        stationaryPlayerAudioGroup.setListenAttenuation(player,AudioGroup.MINIMAL_LISTEN_ATTENUATION);
      }
    }
    sender.send(msg);
    return;
  }
  if (message instanceof VoiceChatJoinMessage == false) {
    logger.warning("String_Node_Str" + message);
    return;
  }
  VoiceChatJoinMessage msg=(VoiceChatJoinMessage)message;
  if (audioGroup == null) {
    AudioGroupSetup setup=new AudioGroupSetup();
    setup.spatializer=new FullVolumeSpatializer();
    setup.spatializer.setAttenuator(DefaultSpatializer.DEFAULT_MAXIMUM_VOLUME);
    setup.virtualPlayerListener=this;
    setup.audioGroupListener=this;
    audioGroup=vm.createAudioGroup(group,setup);
  }
  PresenceInfo[] calleeList=msg.getCalleeList();
  PresenceInfo caller=msg.getCaller();
  boolean added=addPlayerToAudioGroup(vm,audioGroup,caller,msg.getChatType());
  if (added) {
    sender.send(new VoiceChatJoinAcceptedMessage(group,caller,msg.getChatType()));
  }
  if (added == false && calleeList.length == 0) {
    endVoiceChat(vm,audioGroup);
    return;
  }
  logger.info("String_Node_Str" + group + "String_Node_Str"+ caller+ "String_Node_Str"+ msg.getPhoneNumber()+ "String_Node_Str"+ msg.getName());
  for (int i=0; i < calleeList.length; i++) {
    PresenceInfo info=calleeList[i];
    CellID cellID=calleeList[i].cellID;
    logger.fine("String_Node_Str" + calleeList[i]);
    String callID=calleeList[i].callID;
    Player player=vm.getPlayer(callID);
    if (player == null) {
      logger.warning("String_Node_Str" + callID);
      continue;
    }
    AudioGroupPlayerInfo playerInfo=audioGroup.getPlayerInfo(player);
    if (playerInfo != null && sameChatType(playerInfo.chatType,msg.getChatType())) {
      logger.fine("String_Node_Str" + info + "String_Node_Str"+ audioGroup);
      continue;
    }
    WonderlandClientID id=CommsManagerFactory.getCommsManager().getWonderlandClientID(info.clientID);
    if (id == null) {
      logger.warning("String_Node_Str" + info);
      continue;
    }
    Call call=player.getCall();
    if (call != null) {
      try {
        call.playTreatment("String_Node_Str");
      }
 catch (      IOException e) {
        logger.warning("String_Node_Str" + e.getMessage());
      }
    }
    logger.info("String_Node_Str" + info + "String_Node_Str"+ group+ "String_Node_Str"+ msg.getChatType());
    requestPlayerJoinAudioGroup(sender,id,group,caller,calleeList,msg.getChatType());
  }
  vm.dump("String_Node_Str");
  return;
}

Fixed version (ground truth):
public void processVoiceChatMessage(WonderlandClientSender sender,WonderlandClientID clientID,VoiceChatMessage message){
  String group=message.getGroup();
  if (message instanceof VoiceChatInfoRequestMessage) {
    sendVoiceChatInfo(sender,clientID,group);
    return;
  }
  if (message instanceof VoiceChatBusyMessage) {
    VoiceChatBusyMessage msg=(VoiceChatBusyMessage)message;
    CommsManager cm=CommsManagerFactory.getCommsManager();
    WonderlandClientID id=cm.getWonderlandClientID(msg.getCaller().clientID);
    if (id == null) {
      logger.warning("String_Node_Str" + msg.getCaller());
      return;
    }
    sendVoiceChatBusyMessage(sender,id,msg);
    return;
  }
  VoiceManager vm=AppContext.getManager(VoiceManager.class);
  AudioGroup audioGroup=vm.getAudioGroup(group);
  if (message instanceof VoiceChatLeaveMessage) {
    if (audioGroup == null) {
      logger.info("String_Node_Str");
      return;
    }
    VoiceChatLeaveMessage msg=(VoiceChatLeaveMessage)message;
    Player player=vm.getPlayer(msg.getCallee().callID);
    if (player == null) {
      logger.warning("String_Node_Str" + msg.getCallee());
      if (audioGroup.getNumberOfPlayers() == 0) {
        endVoiceChat(vm,audioGroup);
      }
      sender.send(msg);
      return;
    }
    removePlayerFromAudioGroup(audioGroup,player);
    if (audioGroup.getNumberOfPlayers() <= 1) {
      endVoiceChat(vm,audioGroup);
    }
    sender.send(msg);
    vm.dump("String_Node_Str");
    return;
  }
  if (message instanceof VoiceChatEndMessage) {
    if (audioGroup == null) {
      logger.info("String_Node_Str");
      return;
    }
    endVoiceChat(vm,audioGroup);
    vm.dump("String_Node_Str");
    return;
  }
  if (message instanceof VoiceChatJoinAcceptedMessage == true) {
    if (audioGroup == null) {
      logger.warning("String_Node_Str" + group + "String_Node_Str");
      return;
    }
    VoiceChatJoinAcceptedMessage msg=(VoiceChatJoinAcceptedMessage)message;
    addPlayerToAudioGroup(vm,audioGroup,msg.getCallee(),msg.getChatType());
    sender.send(msg);
    return;
  }
  if (message instanceof VoiceChatHoldMessage == true) {
    VoiceChatHoldMessage msg=(VoiceChatHoldMessage)message;
    if (audioGroup == null) {
      logger.warning("String_Node_Str" + group + "String_Node_Str");
      return;
    }
    Player player=vm.getPlayer(msg.getCallee().callID);
    if (player == null) {
      logger.warning("String_Node_Str" + msg.getCallee().callID);
      return;
    }
    AudioGroupPlayerInfo playerInfo=audioGroup.getPlayerInfo(player);
    if (playerInfo == null) {
      logger.warning("String_Node_Str" + player);
      return;
    }
    AudioGroup livePlayerAudioGroup=vm.getVoiceManagerParameters().livePlayerAudioGroup;
    AudioGroup stationaryPlayerAudioGroup=vm.getVoiceManagerParameters().stationaryPlayerAudioGroup;
    if (msg.isOnHold()) {
      playerInfo.isSpeaking=false;
      audioGroup.setSpeakingAttenuation(player,0);
      audioGroup.setListenAttenuation(player,0);
      livePlayerAudioGroup.setSpeakingAttenuation(player,AudioGroup.DEFAULT_SPEAKING_ATTENUATION);
      livePlayerAudioGroup.setListenAttenuation(player,AudioGroup.DEFAULT_LISTEN_ATTENUATION);
      stationaryPlayerAudioGroup.setSpeakingAttenuation(player,AudioGroup.DEFAULT_SPEAKING_ATTENUATION);
      stationaryPlayerAudioGroup.setListenAttenuation(player,AudioGroup.DEFAULT_LISTEN_ATTENUATION);
    }
 else {
      playerInfo.isSpeaking=true;
      audioGroup.setSpeakingAttenuation(player,AudioGroup.DEFAULT_SPEAKING_ATTENUATION);
      audioGroup.setListenAttenuation(player,AudioGroup.DEFAULT_LISTEN_ATTENUATION);
      if (playerInfo.chatType.equals(ChatType.PUBLIC)) {
        livePlayerAudioGroup.setSpeakingAttenuation(player,AudioGroup.DEFAULT_SPEAKING_ATTENUATION);
        livePlayerAudioGroup.setListenAttenuation(player,AudioGroup.DEFAULT_LISTEN_ATTENUATION);
        stationaryPlayerAudioGroup.setListenAttenuation(player,AudioGroup.DEFAULT_LISTEN_ATTENUATION);
      }
 else {
        livePlayerAudioGroup.setSpeakingAttenuation(player,0);
        livePlayerAudioGroup.setListenAttenuation(player,AudioGroup.MINIMAL_LISTEN_ATTENUATION);
        stationaryPlayerAudioGroup.setListenAttenuation(player,AudioGroup.MINIMAL_LISTEN_ATTENUATION);
      }
    }
    sender.send(msg);
    return;
  }
  if (message instanceof VoiceChatJoinMessage == false) {
    logger.warning("String_Node_Str" + message);
    return;
  }
  VoiceChatJoinMessage msg=(VoiceChatJoinMessage)message;
  if (audioGroup == null) {
    AudioGroupSetup setup=new AudioGroupSetup();
    setup.spatializer=new FullVolumeSpatializer();
    setup.spatializer.setAttenuator(DefaultSpatializer.DEFAULT_MAXIMUM_VOLUME);
    setup.virtualPlayerListener=this;
    setup.audioGroupListener=this;
    audioGroup=vm.createAudioGroup(group,setup);
  }
  PresenceInfo[] calleeList=msg.getCalleeList();
  PresenceInfo caller=msg.getCaller();
  boolean added=addPlayerToAudioGroup(vm,audioGroup,caller,msg.getChatType());
  if (added) {
    sender.send(new VoiceChatJoinAcceptedMessage(group,caller,msg.getChatType()));
  }
  if (added == false && (calleeList == null || calleeList.length == 0)) {
    endVoiceChat(vm,audioGroup);
    return;
  }
  logger.info("String_Node_Str" + group + "String_Node_Str"+ caller+ "String_Node_Str"+ msg.getPhoneNumber()+ "String_Node_Str"+ msg.getName());
  if (calleeList == null || calleeList.length == 0) {
    return;
  }
  for (int i=0; i < calleeList.length; i++) {
    PresenceInfo info=calleeList[i];
    CellID cellID=calleeList[i].cellID;
    logger.fine("String_Node_Str" + calleeList[i]);
    String callID=calleeList[i].callID;
    Player player=vm.getPlayer(callID);
    if (player == null) {
      logger.warning("String_Node_Str" + callID);
      continue;
    }
    AudioGroupPlayerInfo playerInfo=audioGroup.getPlayerInfo(player);
    if (playerInfo != null && sameChatType(playerInfo.chatType,msg.getChatType())) {
      logger.fine("String_Node_Str" + info + "String_Node_Str"+ audioGroup);
      continue;
    }
    WonderlandClientID id=CommsManagerFactory.getCommsManager().getWonderlandClientID(info.clientID);
    if (id == null) {
      logger.warning("String_Node_Str" + info);
      continue;
    }
    Call call=player.getCall();
    if (call != null) {
      try {
        call.playTreatment("String_Node_Str");
      }
 catch (      IOException e) {
        logger.warning("String_Node_Str" + e.getMessage());
      }
    }
    logger.info("String_Node_Str" + info + "String_Node_Str"+ group+ "String_Node_Str"+ msg.getChatType());
    requestPlayerJoinAudioGroup(sender,id,group,caller,calleeList,msg.getChatType());
  }
  vm.dump("String_Node_Str");
  return;
}