availableQueries.add(new StringRange(s));
if (! availableQueries.contains(new StringRange(s))) availableQueries.add(new StringRange(s));
  private static Set getAvailableQueries() {    Logger log = CSMART.createLogger("org.cougaar.tools.csmart.recipe.RecipeQueryProperty");    if (availableQueries == null) {      try {        availableQueries = new HashSet();        // Get the base queries        for (Iterator i = DBProperties.readQueryFile(PDbBase.QUERY_FILE).keySet().iterator();             i.hasNext(); ) {          String s = i.next().toString();          if (s.startsWith("recipeQuery"))            availableQueries.add(new StringRange(s));        }        // Get the user defined queries from recipeQueries.q	File rqfile = ConfigFinder.getInstance().locateFile(RecipeComponent.RECIPE_QUERY_FILE);	if (rqfile != null) {	  try {	    rQFileLastMod = rqfile.lastModified();	  } catch (SecurityException se) {	  }	}        try {	  // Must reRead -- calling addQueryFile effectively does that.	  // Alternatively, have a reRead method in DBProperties	  DBProperties dbp = DBProperties.readQueryFile(RecipeComponent.RECIPE_QUERY_FILE);	  dbp.addQueryFile(RecipeComponent.RECIPE_QUERY_FILE);	  for (Iterator i = dbp.keySet().iterator();               i.hasNext(); ) {            String s = i.next().toString();            if (s.startsWith("recipeQuery"))              availableQueries.add(new StringRange(s));          }        } catch (FileNotFoundException e) {          // this is normal if a user has no separate recipe query file.	  if (log.isDebugEnabled()) {	    log.debug("No " + RecipeComponent.RECIPE_QUERY_FILE + " to parse.");	  }        }                      } catch (IOException ioe) {        if(log.isErrorEnabled()) {          log.error("Exception", ioe);        }        availableQueries = Collections.EMPTY_SET;      }    } else {      if (log.isDebugEnabled()) {	log.debug("Not re-reading " + PDbBase.QUERY_FILE);      }      // Get the last modified date of the recipeQueries file.      // If it's the same now as it was before, dont re-read      File rqfile = ConfigFinder.getInstance().locateFile(RecipeComponent.RECIPE_QUERY_FILE);      if (rqfile != null) {	long newMod = 0l;	try {	  newMod = rqfile.lastModified();	} catch (SecurityException se) {	}	// If file wasnt modified, use what we have	if (newMod == rQFileLastMod) {	  if (log.isDebugEnabled()) {	    log.debug("Not re-reading unmodified" + RecipeComponent.RECIPE_QUERY_FILE);	  }	  return availableQueries;	}      }      // Re-read recipeQueries.q, allowing user to edit the query names there      try {        // Get the user defined queries from recipeQueries.q        try {	  // Must reRead -- calling addQueryFile effectively does that.	  // Alternatively, have a reRead method in DBProperties	  DBProperties dbp = DBProperties.readQueryFile(RecipeComponent.RECIPE_QUERY_FILE);	  dbp.addQueryFile(RecipeComponent.RECIPE_QUERY_FILE);	  for (Iterator i = dbp.keySet().iterator();               i.hasNext(); ) {            String s = i.next().toString();            if (s.startsWith("recipeQuery")) {	      // Add only if not already present	      if (! availableQueries.contains(new StringRange(s)))		availableQueries.add(new StringRange(s));	    }          }        } catch (FileNotFoundException e) {          // this is normal if a user has no separate recipe query file.	  if (log.isDebugEnabled()) {	    log.debug("No " + RecipeComponent.RECIPE_QUERY_FILE + " to parse.");	  }        }                      } catch (IOException ioe) {        if(log.isErrorEnabled()) {          log.error("Exception", ioe);        }      }    }    return availableQueries;  }