Program: 170312
Project: 170312
Buggy source:
/** 
 * Save armour data from an items NBT data into a file on the disk.
 * @param filePath 
 * @param filename The name of the file to save to.
 * @param player The player that pressed the save button.
 * @param publicFiles If true save to the public file list or false for the players private files.
 */
public void saveArmour(String fileName,String filePath,EntityPlayerMP player,boolean publicFiles){
  ItemStack stackInput=getStackInSlot(0);
  ItemStack stackOutput=getStackInSlot(1);
  if (stackInput == null) {
    return;
  }
  if (stackOutput != null) {
    return;
  }
  if (!(stackInput.getItem() instanceof ItemSkin)) {
    return;
  }
  if (!SkinNBTHelper.stackHasSkinData(stackInput)) {
    return;
  }
  SkinPointer skinPointer=SkinNBTHelper.getSkinPointerFromStack(stackInput);
  if (skinPointer == null) {
    return;
  }
  if (!publicFiles) {
    filePath="String_Node_Str" + player.getUniqueID().toString() + filePath;
  }
  Skin skin=CommonSkinCache.INSTANCE.getSkin(skinPointer);
  if (skin == null) {
    return;
  }
  LibraryFile file=new LibraryFile(fileName,filePath,skin.getSkinType());
  CommonSkinCache.INSTANCE.clearFileNameIdLink(file);
  if (!SkinIOUtils.saveSkinFromFileName(filePath,fileName + SkinIOUtils.SKIN_FILE_EXTENSION,skin)) {
    return;
  }
  if (ArmourersWorkshop.isDedicated()) {
    if (publicFiles) {
      ArmourersWorkshop.proxy.libraryManager.addFileToListType(new LibraryFile(fileName,filePath,skin.getSkinType()),LibraryFileType.SERVER_PUBLIC,player);
    }
 else {
      ArmourersWorkshop.proxy.libraryManager.addFileToListType(new LibraryFile(fileName,filePath,skin.getSkinType()),LibraryFileType.SERVER_PRIVATE,player);
    }
  }
 else {
    ArmourersWorkshop.proxy.libraryManager.addFileToListType(new LibraryFile(fileName,filePath,skin.getSkinType()),LibraryFileType.LOCAL,player);
  }
  this.decrStackSize(0,1);
  this.setInventorySlotContents(1,stackInput);
}

Fixed version (ground truth):
/** 
 * Save armour data from an items NBT data into a file on the disk.
 * @param filePath 
 * @param filename The name of the file to save to.
 * @param player The player that pressed the save button.
 * @param publicFiles If true save to the public file list or false for the players private files.
 */
public void saveArmour(String fileName,String filePath,EntityPlayerMP player,boolean publicFiles){
  ItemStack stackInput=getStackInSlot(0);
  ItemStack stackOutput=getStackInSlot(1);
  if (stackInput == null) {
    return;
  }
  if (stackOutput != null) {
    return;
  }
  if (!(stackInput.getItem() instanceof ItemSkin)) {
    return;
  }
  if (!SkinNBTHelper.stackHasSkinData(stackInput)) {
    return;
  }
  SkinPointer skinPointer=SkinNBTHelper.getSkinPointerFromStack(stackInput);
  if (skinPointer == null) {
    return;
  }
  if (!publicFiles) {
  }
  Skin skin=CommonSkinCache.INSTANCE.getSkin(skinPointer);
  if (skin == null) {
    return;
  }
  LibraryFile file=new LibraryFile(fileName,filePath,skin.getSkinType());
  CommonSkinCache.INSTANCE.clearFileNameIdLink(file);
  if (!SkinIOUtils.saveSkinFromFileName(filePath,fileName + SkinIOUtils.SKIN_FILE_EXTENSION,skin)) {
    return;
  }
  if (ArmourersWorkshop.isDedicated()) {
    if (publicFiles) {
      ArmourersWorkshop.proxy.libraryManager.addFileToListType(new LibraryFile(fileName,filePath,skin.getSkinType()),LibraryFileType.SERVER_PUBLIC,player);
    }
 else {
      ArmourersWorkshop.proxy.libraryManager.addFileToListType(new LibraryFile(fileName,filePath,skin.getSkinType()),LibraryFileType.SERVER_PRIVATE,player);
    }
  }
 else {
    ArmourersWorkshop.proxy.libraryManager.addFileToListType(new LibraryFile(fileName,filePath,skin.getSkinType()),LibraryFileType.LOCAL,player);
  }
  this.decrStackSize(0,1);
  this.setInventorySlotContents(1,stackInput);
}