RecipeComponent recipeCopy = (RecipeComponent)recipe.copy(newName);
final RecipeComponent recipeCopy = (RecipeComponent)recipe.copy(newName); GUIUtils.timeConsumingTaskStart(organizer); try { new Thread("DuplicateRecipe") { public void run() { recipeCopy.saveToDatabase(); GUIUtils.timeConsumingTaskEnd(organizer); } }.start(); } catch (RuntimeException re) { if(log.isErrorEnabled()) { log.error("Runtime exception duplicating recipe", re); } GUIUtils.timeConsumingTaskEnd(organizer); }
  public RecipeComponent copyRecipe(RecipeComponent recipe) {    DefaultMutableTreeNode node =       (DefaultMutableTreeNode)findNode(recipe).getParent();    String newName = generateRecipeName(recipe.getRecipeName());    RecipeComponent recipeCopy = (RecipeComponent)recipe.copy(newName);    workspace.setSelection(addRecipeToWorkspace(recipeCopy, node));    return recipeCopy;  }