private boolean isInDatabase(String name, Method dbCheckMethod) {
private boolean isInDatabase(String name) { if (databaseCheck == null) return false; if (dbCheckMethod == null) getDatabaseCheckMethod(); if (dbCheckMethod == null) return false;
  private boolean isInDatabase(String name, Method dbCheckMethod) {    boolean inDatabase = false;    Object[] args = new Object[1];    args[0] = name;    try {      Object result = dbCheckMethod.invoke(null, args);      if (result instanceof Boolean)        inDatabase = ((Boolean)result).booleanValue();      else        if(log.isErrorEnabled()) {          log.error("In Database Check returned unexpected result: " +                     inDatabase);        }    } catch (Exception e) {      if(log.isErrorEnabled()) {        log.error("Exception checking for unique name in database", e);      }    }    return inDatabase;  }