Program: 10753
Project: 10753
Buggy source:
public void refreshUI(){
  logError(null);
  resizeTableColumns();
  canUpdate=false;
  CloudFoundryApplicationModule appModule=null;
  try {
    appModule=getUpdatedApplication();
  }
 catch (  CoreException ce) {
    logApplicationModuleFailureError("String_Node_Str");
  }
  refreshPublishState(appModule);
  if (appModule == null) {
    return;
  }
  updateServerNameDisplay(appModule);
  int state=appModule.getState();
  setCurrentStartDebugApplicationAction();
  instanceSpinner.setSelection(appModule.getInstanceCount());
  refreshApplicationDeploymentButtons(appModule);
  mappedURIsLink.setEnabled(state == IServer.STATE_STARTED);
  CloudApplication cloudApplication=appModule.getApplication();
  List<CloudService> services=new ArrayList<CloudService>();
  instanceSpinner.setEnabled(cloudApplication != null);
  instancesViewer.getTable().setEnabled(cloudApplication != null);
  instancesViewer.setInput(null);
  if (provideServices) {
    List<String> serviceNames=null;
    ApplicationDeploymentInfo deploymentInfo=appModule.getDeploymentInfo();
    if (deploymentInfo != null) {
      serviceNames=deploymentInfo.getServices();
    }
    if (serviceNames == null) {
      serviceNames=Collections.emptyList();
    }
    List<CloudService> allServices=editorPage.getServices();
    if (allServices != null) {
      for (      CloudService service : allServices) {
        if (serviceNames.contains(service.getName())) {
          services.add(service);
        }
      }
    }
    servicesViewer.setInput(services.toArray(new CloudService[services.size()]));
  }
  memoryCombo.setEnabled(cloudApplication != null);
  if (cloudApplication != null) {
    int appMemory=appModule.getApplication().getMemory();
    memoryCombo.removeAll();
    boolean found=false;
    int[] applicationMemoryChoices=editorPage.getApplicationMemoryChoices();
    if (applicationMemoryChoices != null) {
      for (      int option : applicationMemoryChoices) {
        memoryCombo.add(option + "String_Node_Str");
        if (option == appMemory) {
          int index=memoryCombo.getItemCount() - 1;
          memoryCombo.select(index);
          found=true;
        }
      }
      if (!found && appMemory != 0) {
        memoryCombo.add(appMemory + "String_Node_Str",0);
        memoryCombo.select(0);
      }
      memoryCombo.setEnabled(true);
    }
  }
  List<String> currentURIs=null;
  if (cloudApplication != null) {
    currentURIs=cloudApplication.getUris();
    ApplicationStats applicationStats=appModule.getApplicationStats();
    InstancesInfo instancesInfo=appModule.getInstancesInfo();
    if (applicationStats != null) {
      List<InstanceStats> statss=applicationStats.getRecords();
      List<InstanceInfo> infos=instancesInfo != null ? instancesInfo.getInstances() : null;
      InstanceStatsAndInfo[] statsAndInfos=new InstanceStatsAndInfo[statss.size()];
      for (int i=0; i < statss.size(); i++) {
        InstanceStats stats=statss.get(i);
        InstanceInfo info=null;
        if (infos != null && infos.size() > i) {
          info=infos.get(i);
        }
        statsAndInfos[i]=new InstanceStatsAndInfo(stats,info);
      }
      instancesViewer.setInput(statsAndInfos);
    }
  }
  if (currentURIs == null && !isPublished) {
    currentURIs=appModule.getDeploymentInfo() != null ? appModule.getDeploymentInfo().getUris() : null;
  }
  if (currentURIs == null) {
    currentURIs=Collections.emptyList();
  }
  if (!currentURIs.equals(URIs)) {
    URIs=currentURIs;
    mappedURIsLink.setText(getURIsAsLinkText(URIs));
    generalSection.getParent().layout(true,true);
    editorPage.reflow();
  }
  if (provideServices) {
    servicesDropListener.setModule(appModule);
    servicesViewer.refresh(true);
  }
  instancesViewer.refresh(true);
  canUpdate=true;
  if (appModule.getErrorMessage() != null) {
    editorPage.setMessage(appModule.getErrorMessage(),IMessageProvider.ERROR);
  }
 else {
    editorPage.setMessage(null,IMessageProvider.ERROR);
  }
}

Fixed version (ground truth):
public void refreshUI(){
  logError(null);
  resizeTableColumns();
  canUpdate=false;
  CloudFoundryApplicationModule appModule=null;
  try {
    appModule=getUpdatedApplication();
  }
 catch (  CoreException ce) {
    logApplicationModuleFailureError("String_Node_Str");
  }
  refreshPublishState(appModule);
  if (appModule == null) {
    return;
  }
  if (saveManifest != null) {
    ManifestParser parser=new ManifestParser(appModule,cloudServer);
    if (!parser.canWriteToManifest()) {
      saveManifest.setEnabled(false);
    }
 else {
      saveManifest.setEnabled(true);
    }
  }
  updateServerNameDisplay(appModule);
  int state=appModule.getState();
  setCurrentStartDebugApplicationAction();
  instanceSpinner.setSelection(appModule.getInstanceCount());
  refreshApplicationDeploymentButtons(appModule);
  mappedURIsLink.setEnabled(state == IServer.STATE_STARTED);
  CloudApplication cloudApplication=appModule.getApplication();
  List<CloudService> services=new ArrayList<CloudService>();
  instanceSpinner.setEnabled(cloudApplication != null);
  instancesViewer.getTable().setEnabled(cloudApplication != null);
  instancesViewer.setInput(null);
  if (provideServices) {
    List<String> serviceNames=null;
    ApplicationDeploymentInfo deploymentInfo=appModule.getDeploymentInfo();
    if (deploymentInfo != null) {
      serviceNames=deploymentInfo.getServices();
    }
    if (serviceNames == null) {
      serviceNames=Collections.emptyList();
    }
    List<CloudService> allServices=editorPage.getServices();
    if (allServices != null) {
      for (      CloudService service : allServices) {
        if (serviceNames.contains(service.getName())) {
          services.add(service);
        }
      }
    }
    servicesViewer.setInput(services.toArray(new CloudService[services.size()]));
  }
  memoryCombo.setEnabled(cloudApplication != null);
  if (cloudApplication != null) {
    int appMemory=appModule.getApplication().getMemory();
    memoryCombo.removeAll();
    boolean found=false;
    int[] applicationMemoryChoices=editorPage.getApplicationMemoryChoices();
    if (applicationMemoryChoices != null) {
      for (      int option : applicationMemoryChoices) {
        memoryCombo.add(option + "String_Node_Str");
        if (option == appMemory) {
          int index=memoryCombo.getItemCount() - 1;
          memoryCombo.select(index);
          found=true;
        }
      }
      if (!found && appMemory != 0) {
        memoryCombo.add(appMemory + "String_Node_Str",0);
        memoryCombo.select(0);
      }
      memoryCombo.setEnabled(true);
      memoryCombo.redraw();
    }
  }
  List<String> currentURIs=null;
  if (cloudApplication != null) {
    currentURIs=cloudApplication.getUris();
    ApplicationStats applicationStats=appModule.getApplicationStats();
    InstancesInfo instancesInfo=appModule.getInstancesInfo();
    if (applicationStats != null) {
      List<InstanceStats> statss=applicationStats.getRecords();
      List<InstanceInfo> infos=instancesInfo != null ? instancesInfo.getInstances() : null;
      InstanceStatsAndInfo[] statsAndInfos=new InstanceStatsAndInfo[statss.size()];
      for (int i=0; i < statss.size(); i++) {
        InstanceStats stats=statss.get(i);
        InstanceInfo info=null;
        if (infos != null && infos.size() > i) {
          info=infos.get(i);
        }
        statsAndInfos[i]=new InstanceStatsAndInfo(stats,info);
      }
      instancesViewer.setInput(statsAndInfos);
    }
  }
  if (currentURIs == null && !isPublished) {
    currentURIs=appModule.getDeploymentInfo() != null ? appModule.getDeploymentInfo().getUris() : null;
  }
  if (currentURIs == null) {
    currentURIs=Collections.emptyList();
  }
  if (!currentURIs.equals(URIs)) {
    URIs=currentURIs;
    mappedURIsLink.setText(getURIsAsLinkText(URIs));
    generalSection.getParent().layout(true,true);
    editorPage.reflow();
  }
  if (provideServices) {
    servicesDropListener.setModule(appModule);
    servicesViewer.refresh(true);
  }
  instancesViewer.refresh(true);
  canUpdate=true;
  if (appModule.getErrorMessage() != null) {
    editorPage.setMessage(appModule.getErrorMessage(),IMessageProvider.ERROR);
  }
 else {
    editorPage.setMessage(null,IMessageProvider.ERROR);
  }
}