Program: 136233
Project: 136233
Buggy source:
/** 
 * 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);
}

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();
  LibraryNode libProvidingTypes=(LibraryNode)providerLibNode.getOwner();
  List<TypeUser> usersToUpdate=new ArrayList<TypeUser>();
  List<ExtensionOwner> extensionsToUpdate=new ArrayList<ExtensionOwner>();
  for (  Node user : providerLibNode.getChildren())   if (user instanceof TypeUserNode) {
    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());
  if (usersToUpdate.isEmpty() && extensionsToUpdate.isEmpty()) {
    DialogUserNotifier.openWarning("String_Node_Str","String_Node_Str");
    return;
  }
  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(libProvidingTypes,includeDrafts);
  }
 catch (  RepositoryException e1) {
    if (replacement == null)     try {
      replacement=rc.getLatestVersion(libProvidingTypes,includeDrafts);
    }
 catch (    RepositoryException e) {
      DialogUserNotifier.openWarning("String_Node_Str",e.getLocalizedMessage());
      return;
    }
  }
  if (replacement == null || replacement == libProvidingTypes) {
    DialogUserNotifier.openWarning("String_Node_Str","String_Node_Str");
    return;
  }
  question="String_Node_Str" + libProvidingTypes.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);
}