Program: 136252
Project: 136252
Buggy source:
private void updateLibrary(LibraryProviderNode providerLibNode){
  DefaultRepositoryController rc=(DefaultRepositoryController)mc.getRepositoryController();
  LibraryNode libToUpdate=(LibraryNode)providerLibNode.getParent();
  Set<LibraryNode> usedLibs=new HashSet<LibraryNode>();
  for (  Node n : providerLibNode.getChildren())   if (n instanceof TypeUserNode)   usedLibs.add(((TypeUserNode)n).getOwner().getAssignedType().getLibrary());
 else   if (n instanceof ExtensionUserNode)   usedLibs.add(((ExtensionUserNode)n).getOwner().getExtensionBase().getLibrary());
  String question="String_Node_Str";
  String[] buttons={"String_Node_Str","String_Node_Str","String_Node_Str"};
  int result=DialogUserNotifier.openQuestionWithButtons("String_Node_Str",question,buttons);
  boolean includeDrafts=false;
  if (result == 0)   includeDrafts=true;
 else   if (result == 2)   return;
  HashMap<LibraryNode,LibraryNode> replacementMap;
  try {
    replacementMap=rc.getVersionUpdateMap(new ArrayList<LibraryNode>(usedLibs),includeDrafts);
  }
 catch (  RepositoryException e1) {
    DialogUserNotifier.openWarning("String_Node_Str",e1.getLocalizedMessage());
    return;
  }
  LibraryNode targetLib=null;
  LibraryNode oldLib=null;
  for (  Entry<LibraryNode,LibraryNode> e : replacementMap.entrySet()) {
    targetLib=e.getValue();
    oldLib=e.getKey();
  }
  if (targetLib == null) {
    DialogUserNotifier.openWarning("String_Node_Str","String_Node_Str");
    return;
  }
  question="String_Node_Str" + oldLib.getNameWithPrefix() + "String_Node_Str"+ targetLib.getNameWithPrefix()+ "String_Node_Str";
  if (DialogUserNotifier.openQuestion("String_Node_Str",question))   libToUpdate.replaceAllUsers(replacementMap);
  libToUpdate.getWhereUsedHandler().refreshUsedByNode();
  mc.refresh(libToUpdate);
}

Fixed version (ground truth):
/** 
 * Update all the type users (children) to the latest version of the parent library. Also update extension owners. <p> Library Provider node lists all of the parent's type users that are assigned types from the owner library.
 * @param providerLibNode
 */
private void updateLibrary(LibraryProviderNode providerLibNode){
  DefaultRepositoryController rc=(DefaultRepositoryController)mc.getRepositoryController();
  LibraryNode libToUpdate=(LibraryNode)providerLibNode.getParent();
  List<TypeUser> usersToUpdate=new ArrayList<TypeUser>();
  List<ExtensionOwner> extensionsToUpdate=new ArrayList<ExtensionOwner>();
  for (  Node user : providerLibNode.getChildren())   if (user instanceof TypeUser) {
    if (!usersToUpdate.contains(((TypeUserNode)user).getOwner()))     usersToUpdate.add(((TypeUserNode)user).getOwner());
  }
 else   if (user instanceof ExtensionUserNode)   if (!extensionsToUpdate.contains(((ExtensionUserNode)user).getOwner()))   extensionsToUpdate.add(((ExtensionUserNode)user).getOwner());
  String question="String_Node_Str";
  String[] buttons={"String_Node_Str","String_Node_Str","String_Node_Str"};
  int result=DialogUserNotifier.openQuestionWithButtons("String_Node_Str",question,buttons);
  boolean includeDrafts=false;
  if (result == 0)   includeDrafts=true;
 else   if (result == 2)   return;
  LibraryNode replacement=null;
  try {
    replacement=rc.getLatestVersion((LibraryNode)providerLibNode.getOwner(),includeDrafts);
  }
 catch (  RepositoryException e1) {
    if (replacement == null)     try {
      replacement=rc.getLatestVersion((LibraryNode)providerLibNode.getParent(),includeDrafts);
    }
 catch (    RepositoryException e) {
      DialogUserNotifier.openWarning("String_Node_Str",e1.getLocalizedMessage());
      return;
    }
  }
  if (replacement == null || replacement == providerLibNode.getOwner()) {
    DialogUserNotifier.openWarning("String_Node_Str","String_Node_Str");
    return;
  }
  question="String_Node_Str" + providerLibNode.getOwner().getNameWithPrefix() + "String_Node_Str"+ replacement.getNameWithPrefix()+ "String_Node_Str";
  if (DialogUserNotifier.openQuestion("String_Node_Str",question)) {
    replacement.replaceAllUsers(usersToUpdate);
    replacement.replaceAllExtensions(extensionsToUpdate);
  }
  libToUpdate.getWhereUsedHandler().refreshUsedByNode();
  mc.refresh(libToUpdate);
}