Program: 91470
Project: 91470
Buggy source:
private void revalidateImpl(final RepositorySelection newRepoSelection){
  if (label.isDisposed() || !isCurrentPage())   return;
  final ListRemoteOperation listRemoteOp;
  try {
    final URIish uri=newRepoSelection.getURI();
    final Repository db=FileRepositoryBuilder.create(new File("String_Node_Str"));
    int timeout=Activator.getDefault().getPreferenceStore().getInt(UIPreferences.REMOTE_CONNECTION_TIMEOUT);
    listRemoteOp=new ListRemoteOperation(db,uri,timeout);
    if (credentials != null)     listRemoteOp.setCredentialsProvider(new EGitCredentialsProvider(credentials.getUser(),credentials.getPassword()));
    getContainer().run(true,true,new IRunnableWithProgress(){
      public void run(      IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
        listRemoteOp.run(monitor);
      }
    }
);
  }
 catch (  InvocationTargetException e) {
    Throwable why=e.getCause();
    transportError(why);
    if (showDetailedFailureDialog())     SourceBranchFailureDialog.show(getShell(),transportError);
    return;
  }
catch (  IOException e) {
    transportError(UIText.SourceBranchPage_cannotCreateTemp);
    return;
  }
catch (  InterruptedException e) {
    transportError(UIText.SourceBranchPage_remoteListingCancelled);
    return;
  }
  final Ref idHEAD=listRemoteOp.getRemoteRef(Constants.HEAD);
  head=null;
  boolean headIsMaster=false;
  final String masterBranchRef=Constants.R_HEADS + Constants.MASTER;
  for (  final Ref r : listRemoteOp.getRemoteRefs()) {
    final String n=r.getName();
    if (!n.startsWith(Constants.R_HEADS))     continue;
    availableRefs.add(r);
    if (idHEAD == null || headIsMaster)     continue;
    if (r.getObjectId().equals(idHEAD.getObjectId())) {
      headIsMaster=masterBranchRef.equals(r.getName());
      if (head == null || headIsMaster)       head=r;
    }
  }
  Collections.sort(availableRefs,new Comparator<Ref>(){
    public int compare(    final Ref o1,    final Ref o2){
      return o1.getName().compareTo(o2.getName());
    }
  }
);
  if (idHEAD != null && head == null) {
    head=idHEAD;
    availableRefs.add(0,idHEAD);
  }
  validatedRepoSelection=newRepoSelection;
  refsViewer.setInput(availableRefs);
  refsViewer.setAllChecked(true);
  checkPage();
  checkForEmptyRepo();
}

Fixed version (ground truth):
private void revalidateImpl(final RepositorySelection newRepoSelection){
  if (label.isDisposed() || !isCurrentPage())   return;
  final ListRemoteOperation listRemoteOp;
  final URIish uri=newRepoSelection.getURI();
  try {
    final Repository db=FileRepositoryBuilder.create(new File("String_Node_Str"));
    int timeout=Activator.getDefault().getPreferenceStore().getInt(UIPreferences.REMOTE_CONNECTION_TIMEOUT);
    listRemoteOp=new ListRemoteOperation(db,uri,timeout);
    if (credentials != null)     listRemoteOp.setCredentialsProvider(new EGitCredentialsProvider(credentials.getUser(),credentials.getPassword()));
    getContainer().run(true,true,new IRunnableWithProgress(){
      public void run(      IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
        listRemoteOp.run(monitor);
      }
    }
);
  }
 catch (  InvocationTargetException e) {
    Throwable why=e.getCause();
    transportError(why);
    if (showDetailedFailureDialog())     SourceBranchFailureDialog.show(getShell(),uri);
    return;
  }
catch (  IOException e) {
    transportError(UIText.SourceBranchPage_cannotCreateTemp);
    return;
  }
catch (  InterruptedException e) {
    transportError(UIText.SourceBranchPage_remoteListingCancelled);
    return;
  }
  final Ref idHEAD=listRemoteOp.getRemoteRef(Constants.HEAD);
  head=null;
  boolean headIsMaster=false;
  final String masterBranchRef=Constants.R_HEADS + Constants.MASTER;
  for (  final Ref r : listRemoteOp.getRemoteRefs()) {
    final String n=r.getName();
    if (!n.startsWith(Constants.R_HEADS))     continue;
    availableRefs.add(r);
    if (idHEAD == null || headIsMaster)     continue;
    if (r.getObjectId().equals(idHEAD.getObjectId())) {
      headIsMaster=masterBranchRef.equals(r.getName());
      if (head == null || headIsMaster)       head=r;
    }
  }
  Collections.sort(availableRefs,new Comparator<Ref>(){
    public int compare(    final Ref o1,    final Ref o2){
      return o1.getName().compareTo(o2.getName());
    }
  }
);
  if (idHEAD != null && head == null) {
    head=idHEAD;
    availableRefs.add(0,idHEAD);
  }
  validatedRepoSelection=newRepoSelection;
  refsViewer.setInput(availableRefs);
  refsViewer.setAllChecked(true);
  checkPage();
  checkForEmptyRepo();
}