Program: 177774
Project: 177774
Buggy source:
/** 
 * Called at application startup.
 * @param context
 */
public boolean checkRegistrations(Context context,SocializeSession session){
  boolean checked=false;
  if (appUtils.isNotificationsAvailable(context)) {
    if (config.getBooleanProperty(SocializeConfig.SOCIALIZE_CHECK_NOTIFICATIONS,true)) {
      if (logger != null && logger.isDebugEnabled()) {
        logger.debug("String_Node_Str");
      }
      boolean c2DMRegistered=notificationRegistrationSystem.isRegisteredC2DM(context);
      boolean socRegistered=notificationRegistrationSystem.isRegisteredSocialize(context,session.getUser());
      if (!c2DMRegistered || !socRegistered) {
        notificationRegistrationState.load(context);
        if (!c2DMRegistered && config.getBooleanProperty(SocializeConfig.GCM_REGISTRATION_ENABLED,true)) {
          if (notificationRegistrationSystem.isRegistrationPending()) {
            if (logger != null && logger.isDebugEnabled()) {
              logger.debug("String_Node_Str");
            }
          }
 else {
            if (logger != null && logger.isInfoEnabled()) {
              logger.info("String_Node_Str");
            }
            notificationRegistrationSystem.registerC2DMAsync(context);
          }
        }
 else         if (!socRegistered && !StringUtils.isEmpty(notificationRegistrationState.getC2DMRegistrationId())) {
          if (notificationRegistrationSystem.isSocializeRegistrationPending()) {
            if (logger != null && logger.isDebugEnabled()) {
              logger.debug("String_Node_Str");
            }
          }
 else {
            if (logger != null && logger.isInfoEnabled()) {
              logger.info("String_Node_Str");
            }
            notificationRegistrationSystem.registerSocialize(context,notificationRegistrationState.getC2DMRegistrationId());
          }
        }
      }
 else {
        if (logger != null && logger.isDebugEnabled()) {
          logger.debug("String_Node_Str");
        }
      }
      checked=true;
    }
 else {
      if (logger != null && logger.isWarnEnabled()) {
        logger.warn("String_Node_Str");
      }
    }
  }
 else {
    if (logger != null && logger.isInfoEnabled()) {
      logger.info("String_Node_Str");
    }
    checked=true;
  }
  return checked;
}

Fixed version (ground truth):
/** 
 * Called at application startup.
 * @param context
 */
public boolean checkRegistrations(Context context,SocializeSession session){
  boolean checked=false;
  if (appUtils.isNotificationsAvailable(context)) {
    if (config.getBooleanProperty(SocializeConfig.SOCIALIZE_CHECK_NOTIFICATIONS,true)) {
      if (logger != null && logger.isDebugEnabled()) {
        logger.debug("String_Node_Str");
      }
      boolean c2DMRegistered=notificationRegistrationSystem.isRegisteredC2DM(context);
      boolean socRegistered=notificationRegistrationSystem.isRegisteredSocialize(context,session.getUser());
      if (!c2DMRegistered || !socRegistered) {
        notificationRegistrationState.reload(context);
        c2DMRegistered=notificationRegistrationSystem.isRegisteredC2DM(context);
        socRegistered=notificationRegistrationSystem.isRegisteredSocialize(context,session.getUser());
        if (!c2DMRegistered || !socRegistered) {
          if (!c2DMRegistered && config.getBooleanProperty(SocializeConfig.GCM_REGISTRATION_ENABLED,true)) {
            if (notificationRegistrationSystem.isRegistrationPending()) {
              if (logger != null && logger.isDebugEnabled()) {
                logger.debug("String_Node_Str");
              }
            }
 else {
              if (logger != null && logger.isInfoEnabled()) {
                logger.info("String_Node_Str");
              }
              notificationRegistrationSystem.registerC2DMAsync(context);
            }
          }
 else           if (!socRegistered && !StringUtils.isEmpty(notificationRegistrationState.getC2DMRegistrationId())) {
            if (notificationRegistrationSystem.isSocializeRegistrationPending()) {
              if (logger != null && logger.isDebugEnabled()) {
                logger.debug("String_Node_Str");
              }
            }
 else {
              if (logger != null && logger.isInfoEnabled()) {
                logger.info("String_Node_Str");
              }
              notificationRegistrationSystem.registerSocialize(context,notificationRegistrationState.getC2DMRegistrationId());
            }
          }
        }
 else {
          if (logger != null && logger.isDebugEnabled()) {
            logger.debug("String_Node_Str");
          }
        }
      }
 else {
        if (logger != null && logger.isDebugEnabled()) {
          logger.debug("String_Node_Str");
        }
      }
      checked=true;
    }
 else {
      if (logger != null && logger.isWarnEnabled()) {
        logger.warn("String_Node_Str");
      }
    }
  }
 else {
    if (logger != null && logger.isInfoEnabled()) {
      logger.info("String_Node_Str");
    }
    checked=true;
  }
  return checked;
}