public static List findCandidateObjects(String objectname, String objecttype, Keyword matchtype) {
    { String barename = null;
      String modulename = null;
      Keyword kind = null;
      List results = List.newList();
      Symbol candidateobjectname = null;
      Module objectmodule = null;
      String upcasedobjectname = null;
      Iterator candidateterms = null;

      kind = kind;
      try {
        { Object [] caller_MV_returnarray = new Object[2];

          barename = Stella.parseStellaName(objectname, false, caller_MV_returnarray);
          modulename = ((String)(((StringWrapper)(caller_MV_returnarray[0])).wrapperValue));
          kind = ((Keyword)(caller_MV_returnarray[1]));
        }
      } catch (ReadException e000) {
        barename = objectname;
      }
      upcasedobjectname = Native.stringUpcase(barename);
      candidateterms = Logic.allNamedTerms(((Module)(((Context)(Stella.$CONTEXT$.get())))), false);
      if (modulename != null) {
        objectmodule = Stella.getStellaModule(modulename, true);
      }
      if (matchtype == OntosaurusUtil.KWD_EXACT) {
        { Stella_Object obj = null;
          Iterator iter000 = candidateterms;

          loop000 : while (iter000.nextP()) {
            obj = iter000.value;
            if (Stella_Object.isaP(obj, OntosaurusUtil.SGT_LOGIC_LOGIC_OBJECT)) {
              candidateobjectname = Logic.objectName(obj);
              if (candidateobjectname != null) {
                if (Stella.stringEqlP(candidateobjectname.symbolName, barename) &&
                    ((objectmodule == null) ||
                     (candidateobjectname.homeModule() == objectmodule))) {
                  results.push(((LogicObject)(obj)));
                  continue loop000;
                }
              }
              { LogicObject syn = null;
                Cons iter001 = Logic.getSynonyms(obj);

                loop001 : for (;!(iter001 == Stella.NIL); iter001 = iter001.rest) {
                  syn = ((LogicObject)(iter001.value));
                  candidateobjectname = Logic.objectName(syn);
                  if (candidateobjectname != null) {
                    if (Stella.stringEqlP(candidateobjectname.symbolName, barename) &&
                        ((objectmodule == null) ||
                         (candidateobjectname.homeModule() == objectmodule))) {
                      results.push(syn);
                      break loop001;
                    }
                  }
                }
              }
            }
          }
        }
      }
      else if (matchtype == OntosaurusUtil.KWD_CASE_INSENSITIVE) {
        { Stella_Object obj = null;
          Iterator iter002 = candidateterms;

          loop002 : while (iter002.nextP()) {
            obj = iter002.value;
            if (Stella_Object.isaP(obj, OntosaurusUtil.SGT_LOGIC_LOGIC_OBJECT)) {
              candidateobjectname = Logic.objectName(obj);
              if (candidateobjectname != null) {
                if (Stella.stringEqualP(candidateobjectname.symbolName, barename) &&
                    ((objectmodule == null) ||
                     (candidateobjectname.homeModule() == objectmodule))) {
                  results.push(((LogicObject)(obj)));
                  continue loop002;
                }
              }
              { LogicObject syn = null;
                Cons iter003 = Logic.getSynonyms(obj);

                loop003 : for (;!(iter003 == Stella.NIL); iter003 = iter003.rest) {
                  syn = ((LogicObject)(iter003.value));
                  candidateobjectname = Logic.objectName(syn);
                  if (candidateobjectname != null) {
                    if (Stella.stringEqualP(candidateobjectname.symbolName, barename) &&
                        ((objectmodule == null) ||
                         (candidateobjectname.homeModule() == objectmodule))) {
                      results.push(syn);
                      break loop003;
                    }
                  }
                }
              }
            }
          }
        }
      }
      else if (matchtype == OntosaurusUtil.KWD_SUBSTRING) {
        { Stella_Object obj = null;
          Iterator iter004 = candidateterms;

          loop004 : while (iter004.nextP()) {
            obj = iter004.value;
            if (Stella_Object.isaP(obj, OntosaurusUtil.SGT_LOGIC_LOGIC_OBJECT)) {
              candidateobjectname = Logic.objectName(obj);
              if (candidateobjectname != null) {
                if ((Native.stringSearch(Native.stringUpcase(candidateobjectname.symbolName), upcasedobjectname, 0) != Stella.NULL_INTEGER) &&
                    ((objectmodule == null) ||
                     (candidateobjectname.homeModule() == objectmodule))) {
                  results.push(((LogicObject)(obj)));
                  continue loop004;
                }
              }
              { LogicObject syn = null;
                Cons iter005 = Logic.getSynonyms(obj);

                loop005 : for (;!(iter005 == Stella.NIL); iter005 = iter005.rest) {
                  syn = ((LogicObject)(iter005.value));
                  candidateobjectname = Logic.objectName(syn);
                  if (candidateobjectname != null) {
                    if ((Native.stringSearch(Native.stringUpcase(candidateobjectname.symbolName), upcasedobjectname, 0) != Stella.NULL_INTEGER) &&
                        ((objectmodule == null) ||
                         (candidateobjectname.homeModule() == objectmodule))) {
                      results.push(syn);
                      break loop005;
                    }
                  }
                }
              }
            }
          }
        }
      }
      else if (matchtype == OntosaurusUtil.KWD_WILDCARD) {
        throw ((StellaException)(StellaException.newStellaException(":WILDCARD matching not implemented yet").fillInStackTrace()));
      }
      else if (matchtype == OntosaurusUtil.KWD_REGEX) {
        throw ((StellaException)(StellaException.newStellaException(":REGEX matching not implemented yet").fillInStackTrace()));
      }
      else {
        { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

          stream000.nativeStream.print("`" + matchtype + "' is not a valid case option");
          throw ((StellaException)(StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
        }
      }
      results.removeDuplicates();
      results.sort(Native.find_java_method("edu.isi.powerloom.logic.Logic", "logicFormLessP", new java.lang.Class [] {Native.find_java_class("edu.isi.stella.Stella_Object"), Native.find_java_class("edu.isi.stella.Stella_Object")}));
      return (results);
    }
  }