rc = createRecipe(dbRecipe.name, dbRecipe.cls); setRecipeComponentProperties(dbRecipe, rc); ((RecipeBase)rc).resetModified(); ((RecipeBase)rc).installListeners();
rc = organizer.getRecipe(dbRecipe.name); if (rc == null) { rc = createRecipe(dbRecipe.name, dbRecipe.cls); setRecipeComponentProperties(dbRecipe, rc); ((RecipeBase)rc).resetModified(); ((RecipeBase)rc).installListeners(); } return rc;
  public RecipeComponent getDatabaseRecipe(String recipeId,                                           String recipeName) {    createLogger();        String query = null;    RecipeComponent rc = null;    try {      Connection conn = DBUtils.getConnection();      try {        Map substitutions = new HashMap();        substitutions.put(":recipe_id", recipeId);        Statement stmt = conn.createStatement();        query = DBUtils.getQuery("queryRecipe", substitutions);        ResultSet rs = stmt.executeQuery(query);        if (rs.next()) {          try {            DbRecipe dbRecipe =               new DbRecipe(rs.getString(2), Class.forName(rs.getString(3)));            getRecipeProperties(dbRecipe, conn, substitutions);            dbRecipe.name = recipeName;            rc = createRecipe(dbRecipe.name, dbRecipe.cls);            setRecipeComponentProperties(dbRecipe, rc);            ((RecipeBase)rc).resetModified();            ((RecipeBase)rc).installListeners();            //return rc;          } catch (ClassNotFoundException cnfe) {            if(log.isErrorEnabled()) {              log.error("for recipe", cnfe);            }          }        }        if(rc == null && log.isErrorEnabled()) {          log.error("Recipe not found: " + recipeId);        }        rs.close();        stmt.close();      } finally {        conn.close();      }    } catch (SQLException se) {      if(log.isErrorEnabled()) {        log.error("Caught SQL exception getting DBRecipe " + query, se);      }    }        return rc;  }