Program: 103260
Project: 103260
Buggy source:
/** 
 * The method is called by a ProtocolProvider implementation whenever a change in the registration state of the corresponding provider had occurred. The method is particularly interested in events stating that the SIP provider has unregistered so that it would fire status change events for all contacts in our buddy list.
 * @param evt ProviderStatusChangeEvent the event describing the statuschange.
 */
public void registrationStateChanged(RegistrationStateChangeEvent evt){
  if (evt.getNewState() == RegistrationState.UNREGISTERING || evt.getNewState() == RegistrationState.CONNECTION_FAILED) {
    if (keepAliveTimer != null) {
      keepAliveTimer.cancel();
      keepAliveTimer=null;
    }
  }
 else   if (evt.getNewState().equals(RegistrationState.REGISTERED)) {
    String keepAliveMethod=provider.getAccountID().getAccountPropertyString(ProtocolProviderServiceSipImpl.KEEP_ALIVE_METHOD);
    if (logger.isTraceEnabled())     logger.trace("String_Node_Str" + keepAliveMethod);
    if (keepAliveMethod != null && !keepAliveMethod.equalsIgnoreCase("String_Node_Str"))     return;
    int keepAliveInterval=provider.getAccountID().getAccountPropertyInt(ProtocolProviderServiceSipImpl.KEEP_ALIVE_INTERVAL,-1);
    if (logger.isTraceEnabled())     logger.trace("String_Node_Str" + keepAliveInterval);
    if (keepAliveInterval > 0 && !provider.getRegistrarConnection().isRegistrarless()) {
      if (keepAliveTimer == null)       keepAliveTimer=new Timer();
      if (logger.isDebugEnabled())       logger.debug("String_Node_Str");
      keepAliveTimer.schedule(new KeepAliveTask(),0,keepAliveInterval * 1000);
    }
  }
}

Fixed version (ground truth):
/** 
 * The method is called by a ProtocolProvider implementation whenever a change in the registration state of the corresponding provider had occurred. The method is particularly interested in events stating that the SIP provider has unregistered so that it would fire status change events for all contacts in our buddy list.
 * @param evt ProviderStatusChangeEvent the event describing the statuschange.
 */
public void registrationStateChanged(RegistrationStateChangeEvent evt){
  if (evt.getNewState() == RegistrationState.UNREGISTERING || evt.getNewState() == RegistrationState.CONNECTION_FAILED) {
    if (keepAliveTimer != null) {
      keepAliveTimer.cancel();
      keepAliveTimer=null;
    }
  }
 else   if (evt.getNewState().equals(RegistrationState.REGISTERED)) {
    String keepAliveMethod=provider.getAccountID().getAccountPropertyString(ProtocolProviderFactory.KEEP_ALIVE_METHOD);
    if (logger.isTraceEnabled())     logger.trace("String_Node_Str" + keepAliveMethod);
    if (keepAliveMethod != null && !keepAliveMethod.equalsIgnoreCase("String_Node_Str"))     return;
    int keepAliveInterval=provider.getAccountID().getAccountPropertyInt(ProtocolProviderFactory.KEEP_ALIVE_INTERVAL,-1);
    if (logger.isTraceEnabled())     logger.trace("String_Node_Str" + keepAliveInterval);
    if (keepAliveInterval > 0 && !provider.getRegistrarConnection().isRegistrarless()) {
      if (keepAliveTimer == null)       keepAliveTimer=new Timer();
      if (logger.isDebugEnabled())       logger.debug("String_Node_Str");
      keepAliveTimer.schedule(new KeepAliveTask(),0,keepAliveInterval * 1000);
    }
  }
}