Program: 104335
Project: 104335
Buggy source:
public void run(){
  run=true;
  int timer=0;
  do {
    try {
      if (MouseInfo.getPointerInfo() != null) {
        Point currentPosition=MouseInfo.getPointerInfo().getLocation();
        if (!isNear(lastPosition,currentPosition)) {
          ProtocolProviderService[] pps=StatusUpdateActivator.getProtocolProviders();
          for (          ProtocolProviderService protocolProviderService : pps) {
            if (lastStates.get(protocolProviderService) != null) {
              PresenceStatus lastState=lastStates.get(protocolProviderService);
              OperationSetPresence presence=(OperationSetPresence)protocolProviderService.getOperationSet(OperationSetPresence.class);
              try {
                presence.publishPresenceStatus(lastState,"String_Node_Str");
              }
 catch (              IllegalArgumentException e) {
              }
catch (              IllegalStateException e) {
              }
catch (              OperationFailedException e) {
              }
              lastStates.remove(protocolProviderService);
            }
          }
          timer=getTimer() * 1000 * 60;
        }
 else {
          ProtocolProviderService[] pps=StatusUpdateActivator.getProtocolProviders();
          for (          ProtocolProviderService protocolProviderService : pps) {
            OperationSetPresence presence=(OperationSetPresence)protocolProviderService.getOperationSet(OperationSetPresence.class);
            PresenceStatus status=presence.getPresenceStatus();
            if (status.getStatus() < PresenceStatus.AVAILABLE_THRESHOLD) {
              break;
            }
            lastStates.put(protocolProviderService,presence.getPresenceStatus());
            PresenceStatus newStatus=findAwayStatus(presence);
            try {
              presence.publishPresenceStatus(newStatus,newStatus.getStatusName());
            }
 catch (            IllegalArgumentException e) {
            }
catch (            IllegalStateException e) {
            }
catch (            OperationFailedException e) {
            }
          }
          timer=IDLE_TIMER;
        }
        lastPosition=currentPosition;
      }
      Thread.sleep(timer);
    }
 catch (    InterruptedException e) {
    }
  }
 while (run && timer > 0);
}

Fixed version (ground truth):
public void run(){
  run=true;
  int timer=0;
  do {
    try {
      if (MouseInfo.getPointerInfo() != null) {
        Point currentPosition=MouseInfo.getPointerInfo().getLocation();
        if (!isNear(lastPosition,currentPosition)) {
          ProtocolProviderService[] pps=StatusUpdateActivator.getProtocolProviders();
          for (          ProtocolProviderService protocolProviderService : pps) {
            if (lastStates.get(protocolProviderService) != null) {
              PresenceStatus lastState=lastStates.get(protocolProviderService);
              OperationSetPresence presence=(OperationSetPresence)protocolProviderService.getOperationSet(OperationSetPresence.class);
              try {
                presence.publishPresenceStatus(lastState,"String_Node_Str");
              }
 catch (              IllegalArgumentException e) {
              }
catch (              IllegalStateException e) {
              }
catch (              OperationFailedException e) {
              }
              lastStates.remove(protocolProviderService);
            }
          }
          timer=getTimer() * 1000 * 60;
        }
 else {
          ProtocolProviderService[] pps=StatusUpdateActivator.getProtocolProviders();
          for (          ProtocolProviderService protocolProviderService : pps) {
            OperationSetPresence presence=(OperationSetPresence)protocolProviderService.getOperationSet(OperationSetPresence.class);
            PresenceStatus status=presence.getPresenceStatus();
            if (status.getStatus() < PresenceStatus.AVAILABLE_THRESHOLD) {
              continue;
            }
            lastStates.put(protocolProviderService,presence.getPresenceStatus());
            PresenceStatus newStatus=findAwayStatus(presence);
            try {
              if (newStatus != null) {
                presence.publishPresenceStatus(newStatus,newStatus.getStatusName());
              }
            }
 catch (            IllegalArgumentException e) {
            }
catch (            IllegalStateException e) {
            }
catch (            OperationFailedException e) {
            }
          }
          timer=IDLE_TIMER;
        }
        lastPosition=currentPosition;
      }
      Thread.sleep(timer);
    }
 catch (    InterruptedException e) {
    }
  }
 while (run && timer > 0);
}