Program: 179508
Project: 179508
Buggy source:
/** 
 * An android utility function that registers a messenger for all the available network events. The event object will be passed to the Messenger whenever any event occurs, using the  message.what parameter to describe what type of event it is. The message.what parameter is and integer representation of the EventType enum in this class.
 * @param eventMessenger
 */
public void registerMessenger(final Messenger eventMessenger){
  linkedMessengers.add(eventMessenger);
  addListener(ConnectionEstablishedListener.class,new ConnectionEstablishedListener(){
    public void EventOccured(    NetworkEvent e){
      try {
        isConnected=true;
        eventMessenger.send(Message.obtain(null,EventType.CONNECTION_ESTABLISHED.ordinal(),e));
      }
 catch (      RemoteException e1) {
        Log.e(NetworkVariables.TAG,"String_Node_Str",e1);
      }
    }
  }
);
  addListener(ConnectionLostListener.class,new ConnectionLostListener(){
    public void EventOccured(    NetworkEvent e){
      try {
        isConnected=false;
        eventMessenger.send(Message.obtain(null,EventType.CONNECTION_LOST.ordinal(),e));
      }
 catch (      RemoteException e1) {
        Log.e(NetworkVariables.TAG,"String_Node_Str",e1);
      }
    }
  }
);
  addListener(ConnectionFailedListener.class,new ConnectionFailedListener(){
    public void EventOccured(    NetworkEvent e){
      try {
        eventMessenger.send(Message.obtain(null,EventType.CONNECTION_FAILED.ordinal(),e));
      }
 catch (      RemoteException e1) {
        Log.e(NetworkVariables.TAG,"String_Node_Str",e1);
      }
    }
  }
);
  addListener(DirectMessageListener.class,new DirectMessageListener(){
    public void EventOccured(    NetworkEvent e){
      try {
        eventMessenger.send(Message.obtain(null,EventType.DIRECT_MESSAGE_RECEIVED.ordinal(),e));
      }
 catch (      RemoteException e1) {
        Log.e(NetworkVariables.TAG,"String_Node_Str",e1);
      }
    }
  }
);
  addListener(GamestateReceivedListener.class,new GamestateReceivedListener(){
    public void EventOccured(    NetworkEvent e){
      try {
        eventMessenger.send(Message.obtain(null,EventType.GAMESTATE_RECEIVED.ordinal(),e));
      }
 catch (      RemoteException e1) {
        Log.e(NetworkVariables.TAG,"String_Node_Str",e1);
      }
    }
  }
);
  addListener(LatencyUpdateListener.class,new LatencyUpdateListener(){
    public void EventOccured(    NetworkEvent e){
      try {
        eventMessenger.send(Message.obtain(null,EventType.LATENCY_UPDATE_RECEIVED.ordinal(),e));
      }
 catch (      RemoteException e1) {
        Log.e(NetworkVariables.TAG,"String_Node_Str",e1);
      }
    }
  }
);
  addListener(PartialGamestateReceivedListener.class,new PartialGamestateReceivedListener(){
    public void EventOccured(    NetworkEvent e){
      try {
        eventMessenger.send(Message.obtain(null,EventType.PARTIAL_GAMESTATE_RECEIVED.ordinal(),e));
      }
 catch (      RemoteException e1) {
        Log.e(NetworkVariables.TAG,"String_Node_Str",e1);
      }
    }
  }
);
  addListener(RequestReceivedListener.class,new RequestReceivedListener(){
    public void EventOccured(    NetworkEvent e){
      try {
        eventMessenger.send(Message.obtain(null,EventType.REQUEST_RECEIVED.ordinal(),e));
      }
 catch (      RemoteException e1) {
        Log.e(NetworkVariables.TAG,"String_Node_Str",e1);
      }
    }
  }
);
  addListener(UnknownMessageTypeReceivedListener.class,new UnknownMessageTypeReceivedListener(){
    public void EventOccured(    NetworkEvent e){
      try {
        eventMessenger.send(Message.obtain(null,EventType.UNKNOWN_MESSAGE_TYPE_RECEIVED.ordinal(),e));
      }
 catch (      RemoteException e1) {
        Log.e(NetworkVariables.TAG,"String_Node_Str",e1);
      }
    }
  }
);
  addListener(UpdateReceivedListener.class,new UpdateReceivedListener(){
    public void EventOccured(    NetworkEvent e){
      try {
        eventMessenger.send(Message.obtain(null,EventType.UPDATE_RECEIVED.ordinal(),e));
      }
 catch (      RemoteException e1) {
        Log.e(NetworkVariables.TAG,"String_Node_Str",e1);
      }
    }
  }
);
  addListener(PlayerRegisteredListener.class,new PlayerRegisteredListener(){
    public void EventOccured(    NetworkEvent e){
      try {
        eventMessenger.send(Message.obtain(null,EventType.PLAYER_REGISTERED.ordinal(),e));
      }
 catch (      RemoteException e1) {
        Log.e(NetworkVariables.TAG,"String_Node_Str",e1);
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * An android utility function that registers a messenger for all the available network events. The event object will be passed to the Messenger whenever any event occurs, using the  message.what parameter to describe what type of event it is. The message.what parameter is and integer representation of the EventType enum in this class.
 * @param eventMessenger
 */
public void registerMessenger(final Messenger eventMessenger){
  linkedMessengers.add(eventMessenger);
  addListener(ConnectionEstablishedListener.class,new ConnectionEstablishedListener(){
    public void EventOccured(    NetworkEvent e){
      try {
        isConnected=true;
        eventMessenger.send(Message.obtain(null,EventType.CONNECTION_ESTABLISHED.ordinal(),e));
      }
 catch (      RemoteException e1) {
        Log.e(NetworkVariables.TAG,"String_Node_Str",e1);
      }
    }
  }
);
  addListener(ConnectionLostListener.class,new ConnectionLostListener(){
    public void EventOccured(    NetworkEvent e){
      try {
        isConnected=false;
        eventMessenger.send(Message.obtain(null,EventType.CONNECTION_LOST.ordinal(),e));
      }
 catch (      RemoteException e1) {
        Log.e(NetworkVariables.TAG,"String_Node_Str",e1);
      }
    }
  }
);
  addListener(ConnectionFailedListener.class,new ConnectionFailedListener(){
    public void EventOccured(    NetworkEvent e){
      try {
        isConnected=false;
        eventMessenger.send(Message.obtain(null,EventType.CONNECTION_FAILED.ordinal(),e));
      }
 catch (      RemoteException e1) {
        Log.e(NetworkVariables.TAG,"String_Node_Str",e1);
      }
    }
  }
);
  addListener(DirectMessageListener.class,new DirectMessageListener(){
    public void EventOccured(    NetworkEvent e){
      try {
        eventMessenger.send(Message.obtain(null,EventType.DIRECT_MESSAGE_RECEIVED.ordinal(),e));
      }
 catch (      RemoteException e1) {
        Log.e(NetworkVariables.TAG,"String_Node_Str",e1);
      }
    }
  }
);
  addListener(GamestateReceivedListener.class,new GamestateReceivedListener(){
    public void EventOccured(    NetworkEvent e){
      try {
        eventMessenger.send(Message.obtain(null,EventType.GAMESTATE_RECEIVED.ordinal(),e));
      }
 catch (      RemoteException e1) {
        Log.e(NetworkVariables.TAG,"String_Node_Str",e1);
      }
    }
  }
);
  addListener(LatencyUpdateListener.class,new LatencyUpdateListener(){
    public void EventOccured(    NetworkEvent e){
      try {
        eventMessenger.send(Message.obtain(null,EventType.LATENCY_UPDATE_RECEIVED.ordinal(),e));
      }
 catch (      RemoteException e1) {
        Log.e(NetworkVariables.TAG,"String_Node_Str",e1);
      }
    }
  }
);
  addListener(PartialGamestateReceivedListener.class,new PartialGamestateReceivedListener(){
    public void EventOccured(    NetworkEvent e){
      try {
        eventMessenger.send(Message.obtain(null,EventType.PARTIAL_GAMESTATE_RECEIVED.ordinal(),e));
      }
 catch (      RemoteException e1) {
        Log.e(NetworkVariables.TAG,"String_Node_Str",e1);
      }
    }
  }
);
  addListener(RequestReceivedListener.class,new RequestReceivedListener(){
    public void EventOccured(    NetworkEvent e){
      try {
        eventMessenger.send(Message.obtain(null,EventType.REQUEST_RECEIVED.ordinal(),e));
      }
 catch (      RemoteException e1) {
        Log.e(NetworkVariables.TAG,"String_Node_Str",e1);
      }
    }
  }
);
  addListener(UnknownMessageTypeReceivedListener.class,new UnknownMessageTypeReceivedListener(){
    public void EventOccured(    NetworkEvent e){
      try {
        eventMessenger.send(Message.obtain(null,EventType.UNKNOWN_MESSAGE_TYPE_RECEIVED.ordinal(),e));
      }
 catch (      RemoteException e1) {
        Log.e(NetworkVariables.TAG,"String_Node_Str",e1);
      }
    }
  }
);
  addListener(UpdateReceivedListener.class,new UpdateReceivedListener(){
    public void EventOccured(    NetworkEvent e){
      try {
        eventMessenger.send(Message.obtain(null,EventType.UPDATE_RECEIVED.ordinal(),e));
      }
 catch (      RemoteException e1) {
        Log.e(NetworkVariables.TAG,"String_Node_Str",e1);
      }
    }
  }
);
  addListener(PlayerRegisteredListener.class,new PlayerRegisteredListener(){
    public void EventOccured(    NetworkEvent e){
      try {
        eventMessenger.send(Message.obtain(null,EventType.PLAYER_REGISTERED.ordinal(),e));
      }
 catch (      RemoteException e1) {
        Log.e(NetworkVariables.TAG,"String_Node_Str",e1);
      }
    }
  }
);
}