Program: 62417
Project: 62417
Buggy source:
@Override protected void onOK(){
  if (!verifyUserInput()) {
    Dialogs.showWarning(Bundle.MSG_Wrong_Value_Text());
    this.getJDialog().requestFocus();
  }
 else {
    String templateContent=this.templateContent.getText();
    if (!resolveTemplateProductCount(templateContent)) {
      Dialogs.showWarning(Bundle.MSG_Wrong_Usage_Array_Text());
      this.getJDialog().requestFocus();
    }
 else {
      Path backupCopy=null;
      Exception thrown=null;
      try {
        backupCopy=ToolAdapterIO.backupOperator(oldOperatorDescriptor);
        if (newOperatorDescriptor.getSourceProductCount() == 0) {
          Dialogs.showInformation("String_Node_Str","String_Node_Str");
        }
        if (!newOperatorDescriptor.isFromPackage()) {
          newOperatorDescriptor.setSource(ToolAdapterOperatorDescriptor.SOURCE_USER);
        }
        FileTemplate template=new FileTemplate(TemplateEngine.createInstance(newOperatorDescriptor,TemplateType.VELOCITY),newOperatorDescriptor.getAlias() + ToolAdapterConstants.TOOL_VELO_TEMPLATE_SUFIX);
        template.setContents(templateContent,true);
        newOperatorDescriptor.setTemplate(template);
        java.util.List<ToolParameterDescriptor> toolParameterDescriptors=newOperatorDescriptor.getToolParameterDescriptors();
        toolParameterDescriptors.stream().filter(param -> paramsTable.getBindingContext().getBinding(param.getName()) != null).filter(param -> paramsTable.getBindingContext().getBinding(param.getName()).getPropertyValue() != null).forEach(param -> {
          Object propertyValue=paramsTable.getBindingContext().getBinding(param.getName()).getPropertyValue();
          if (param.isParameter()) {
            String defaultValueString;
            if (propertyValue.getClass().isArray()) {
              defaultValueString=String.join(ArrayConverter.SEPARATOR,Arrays.stream((Object[])propertyValue).map(Object::toString).collect(Collectors.toList()));
            }
 else {
              defaultValueString=propertyValue.toString();
            }
            param.setDefaultValue(defaultValueString);
          }
        }
);
        java.util.List<ToolParameterDescriptor> remParameters=toolParameterDescriptors.stream().filter(param -> (ToolAdapterConstants.TOOL_SOURCE_PRODUCT_ID.equals(param.getName()) || ToolAdapterConstants.TOOL_SOURCE_PRODUCT_FILE.equals(param.getName()))).collect(Collectors.toList());
        newOperatorDescriptor.removeParamDescriptors(remParameters);
        if (rbMenuNew.isSelected()) {
          String customMenuLocationText=customMenuLocation.getText();
          if (customMenuLocationText != null && !customMenuLocationText.isEmpty()) {
            newOperatorDescriptor.setMenuLocation(customMenuLocationText);
          }
        }
        String menuLocation=newOperatorDescriptor.getMenuLocation();
        if (menuLocation != null && !menuLocation.startsWith("String_Node_Str")) {
          newOperatorDescriptor.setMenuLocation("String_Node_Str" + menuLocation);
        }
        newOperatorDescriptor.setBundles(bundleForm.applyChanges());
        AdapterWatcher.INSTANCE.suspend();
        if (currentOperation != OperationType.NEW) {
          ToolAdapterActionRegistrar.removeOperatorMenu(oldOperatorDescriptor);
        }
        ToolAdapterIO.saveAndRegisterOperator(newOperatorDescriptor);
        oldOperatorDescriptor=newOperatorDescriptor;
        AdapterWatcher.INSTANCE.resume();
        ToolAdapterIO.deleteFolder(backupCopy);
        super.setButtonID(ID_OK);
        super.hide();
      }
 catch (      TemplateException tex) {
        logger.warning(tex.getMessage());
        Dialogs.showError("String_Node_Str" + tex.toString() + "String_Node_Str");
        thrown=tex;
      }
catch (      Exception e) {
        logger.warning(e.getMessage());
        Dialogs.showError("String_Node_Str" + e.toString());
        thrown=e;
      }
 finally {
        if (thrown != null) {
          if (backupCopy != null) {
            try {
              ToolAdapterIO.restoreOperator(oldOperatorDescriptor,backupCopy);
            }
 catch (            IOException e) {
              logger.severe(e.getMessage());
              Dialogs.showError("String_Node_Str" + e.getMessage() + "String_Node_Str");
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override protected void onOK(){
  newOperatorDescriptor.setBundles(bundleForm.applyChanges());
  if (!verifyUserInput()) {
    Dialogs.showWarning(Bundle.MSG_Wrong_Value_Text());
    this.getJDialog().requestFocus();
  }
 else {
    String templateContent=this.templateContent.getText();
    if (!resolveTemplateProductCount(templateContent)) {
      Dialogs.showWarning(Bundle.MSG_Wrong_Usage_Array_Text());
      this.getJDialog().requestFocus();
    }
 else {
      Path backupCopy=null;
      Exception thrown=null;
      try {
        backupCopy=ToolAdapterIO.backupOperator(oldOperatorDescriptor);
        if (newOperatorDescriptor.getSourceProductCount() == 0) {
          Dialogs.showInformation("String_Node_Str","String_Node_Str");
        }
        if (!newOperatorDescriptor.isFromPackage()) {
          newOperatorDescriptor.setSource(ToolAdapterOperatorDescriptor.SOURCE_USER);
        }
        FileTemplate template=new FileTemplate(TemplateEngine.createInstance(newOperatorDescriptor,TemplateType.VELOCITY),newOperatorDescriptor.getAlias() + ToolAdapterConstants.TOOL_VELO_TEMPLATE_SUFIX);
        template.setContents(templateContent,true);
        newOperatorDescriptor.setTemplate(template);
        java.util.List<ToolParameterDescriptor> toolParameterDescriptors=newOperatorDescriptor.getToolParameterDescriptors();
        toolParameterDescriptors.stream().filter(param -> paramsTable.getBindingContext().getBinding(param.getName()) != null).filter(param -> paramsTable.getBindingContext().getBinding(param.getName()).getPropertyValue() != null).forEach(param -> {
          Object propertyValue=paramsTable.getBindingContext().getBinding(param.getName()).getPropertyValue();
          if (param.isParameter()) {
            String defaultValueString;
            if (propertyValue.getClass().isArray()) {
              defaultValueString=String.join(ArrayConverter.SEPARATOR,Arrays.stream((Object[])propertyValue).map(Object::toString).collect(Collectors.toList()));
            }
 else {
              defaultValueString=propertyValue.toString();
            }
            param.setDefaultValue(defaultValueString);
          }
        }
);
        java.util.List<ToolParameterDescriptor> remParameters=toolParameterDescriptors.stream().filter(param -> (ToolAdapterConstants.TOOL_SOURCE_PRODUCT_ID.equals(param.getName()) || ToolAdapterConstants.TOOL_SOURCE_PRODUCT_FILE.equals(param.getName()))).collect(Collectors.toList());
        newOperatorDescriptor.removeParamDescriptors(remParameters);
        if (rbMenuNew.isSelected()) {
          String customMenuLocationText=customMenuLocation.getText();
          if (customMenuLocationText != null && !customMenuLocationText.isEmpty()) {
            newOperatorDescriptor.setMenuLocation(customMenuLocationText);
          }
        }
        String menuLocation=newOperatorDescriptor.getMenuLocation();
        if (menuLocation != null && !menuLocation.startsWith("String_Node_Str")) {
          newOperatorDescriptor.setMenuLocation("String_Node_Str" + menuLocation);
        }
        AdapterWatcher.INSTANCE.suspend();
        if (currentOperation != OperationType.NEW) {
          ToolAdapterActionRegistrar.removeOperatorMenu(oldOperatorDescriptor);
        }
        ToolAdapterIO.saveAndRegisterOperator(newOperatorDescriptor);
        oldOperatorDescriptor=newOperatorDescriptor;
        AdapterWatcher.INSTANCE.resume();
        ToolAdapterIO.deleteFolder(backupCopy);
        super.setButtonID(ID_OK);
        super.hide();
      }
 catch (      TemplateException tex) {
        logger.warning(tex.getMessage());
        Dialogs.showError("String_Node_Str" + tex.toString() + "String_Node_Str");
        thrown=tex;
      }
catch (      Exception e) {
        logger.warning(e.getMessage());
        Dialogs.showError("String_Node_Str" + e.toString());
        thrown=e;
      }
 finally {
        if (thrown != null) {
          if (backupCopy != null) {
            try {
              ToolAdapterIO.restoreOperator(oldOperatorDescriptor,backupCopy);
            }
 catch (            IOException e) {
              logger.severe(e.getMessage());
              Dialogs.showError("String_Node_Str" + e.getMessage() + "String_Node_Str");
            }
          }
        }
      }
    }
  }
}