Program: 115589
Project: 115589
Buggy source:
/** 
 * Get Application Runtime
 * @param applicationId Application Id
 * @return ApplicationInfoBean
 */
public static ApplicationInfoBean getApplicationRuntime(String applicationId) throws RestAPIException {
  ApplicationInfoBean applicationBean=null;
  ApplicationContext applicationContext=null;
  try {
    applicationContext=getAutoscalerServiceClient().getApplication(applicationId);
  }
 catch (  RemoteException e) {
    String message="String_Node_Str" + applicationId;
    log.error(message,e);
    throw new RestAPIException(message,e);
  }
catch (  RestAPIException e) {
    String message="String_Node_Str" + applicationId;
    log.error(message,e);
    throw new RestAPIException(message,e);
  }
  try {
    ApplicationManager.acquireReadLockForApplication(applicationId);
    Application application=ApplicationManager.getApplications().getApplication(applicationId);
    if (application.getInstanceContextCount() > 0 || (applicationContext != null && applicationContext.getStatus().equals("String_Node_Str"))) {
      if (application == null) {
        return null;
      }
    }
    applicationBean=ObjectConverter.convertApplicationToApplicationInstanceBean(application);
    for (    ApplicationInstanceBean instanceBean : applicationBean.getApplicationInstances()) {
      addClustersInstancesToApplicationInstanceBean(instanceBean,application);
      addGroupsInstancesToApplicationInstanceBean(instanceBean,application);
    }
  }
  finally {
    ApplicationManager.releaseReadLockForApplication(applicationId);
  }
  return applicationBean;
}

Fixed version (ground truth):
/** 
 * Get Application Runtime
 * @param applicationId Application Id
 * @return ApplicationInfoBean
 */
public static ApplicationInfoBean getApplicationRuntime(String applicationId) throws RestAPIException {
  ApplicationInfoBean applicationBean=null;
  ApplicationContext applicationContext=null;
  try {
    applicationContext=getAutoscalerServiceClient().getApplication(applicationId);
  }
 catch (  RemoteException e) {
    String message="String_Node_Str" + applicationId;
    log.error(message,e);
    throw new RestAPIException(message,e);
  }
catch (  RestAPIException e) {
    String message="String_Node_Str" + applicationId;
    log.error(message,e);
    throw new RestAPIException(message,e);
  }
  try {
    ApplicationManager.acquireReadLockForApplication(applicationId);
    Application application=ApplicationManager.getApplications().getApplication(applicationId);
    if (application.getInstanceContextCount() > 0 || (applicationContext != null && applicationContext.getStatus().equals("String_Node_Str"))) {
      if (application == null) {
        return null;
      }
      applicationBean=ObjectConverter.convertApplicationToApplicationInstanceBean(application);
      for (      ApplicationInstanceBean instanceBean : applicationBean.getApplicationInstances()) {
        addClustersInstancesToApplicationInstanceBean(instanceBean,application);
        addGroupsInstancesToApplicationInstanceBean(instanceBean,application);
      }
    }
  }
  finally {
    ApplicationManager.releaseReadLockForApplication(applicationId);
  }
  return applicationBean;
}