Program: 115509
Project: 115509
Buggy source:
/** 
 * Get Application Runtime
 * @param applicationId Application Id
 * @return ApplicationInfoBean
 */
public static ApplicationInfoBean getApplicationRuntime(String applicationId,int tenantId) throws RestAPIException {
  ApplicationInfoBean applicationBean=null;
  ApplicationContext applicationContext=null;
  String applicationUuid=null;
  try {
    applicationUuid=getAutoscalerServiceClient().getApplicationByTenant(applicationId,tenantId).getApplicationUuid();
    applicationContext=getAutoscalerServiceClient().getApplication(applicationUuid);
  }
 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(applicationUuid);
    Application application=ApplicationManager.getApplications().getApplication(applicationUuid);
    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(applicationUuid);
  }
  return applicationBean;
}

Fixed version (ground truth):
/** 
 * Get Application Runtime
 * @param applicationId Application Id
 * @return ApplicationInfoBean
 */
public static ApplicationInfoBean getApplicationRuntime(String applicationId,int tenantId) throws RestAPIException {
  ApplicationInfoBean applicationBean=null;
  ApplicationContext applicationContext;
  String applicationUuid;
  try {
    applicationUuid=getAutoscalerServiceClient().getApplicationByTenant(applicationId,tenantId).getApplicationUuid();
    applicationContext=getAutoscalerServiceClient().getApplication(applicationUuid);
  }
 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(applicationUuid);
    Application application=ApplicationManager.getApplications().getApplication(applicationUuid);
    if (application == null) {
      return null;
    }
    if (application.getInstanceContextCount() > 0 || (applicationContext != null && applicationContext.getStatus().equals("String_Node_Str"))) {
      applicationBean=ObjectConverter.convertApplicationToApplicationInstanceBean(application);
      for (      ApplicationInstanceBean instanceBean : applicationBean.getApplicationInstances()) {
        addClustersInstancesToApplicationInstanceBean(instanceBean,application);
        addGroupsInstancesToApplicationInstanceBean(instanceBean,application);
      }
    }
  }
  finally {
    ApplicationManager.releaseReadLockForApplication(applicationUuid);
  }
  return applicationBean;
}