public static Cons javaTranslateDefineMethodUnit(TranslationUnit unit) {
    { Object old$Localgensymtable$000 = Stella.$LOCALGENSYMTABLE$.get();
      Object old$Methodbeingwalked$000 = Stella.$METHODBEINGWALKED$.get();
      Object old$Currentdummyindex$000 = Stella.$CURRENTDUMMYINDEX$.get();
      Object old$Dummydeclarations$000 = Stella.$DUMMYDECLARATIONS$.get();

      try {
        Native.setSpecial(Stella.$LOCALGENSYMTABLE$, KeyValueList.newKeyValueList());
        Native.setSpecial(Stella.$METHODBEINGWALKED$, null);
        Native.setIntSpecial(Stella.$CURRENTDUMMYINDEX$, 0);
        Native.setSpecial(Stella.$DUMMYDECLARATIONS$, Stella.NIL);
        { MethodSlot method = ((MethodSlot)(unit.theObject));
          boolean unitisfunction = MethodSlot.javaMethodObjectIsFunctionP(method);
          Cons bodytree = ((Cons)(unit.codeRegister));
          Cons otree = Stella.NIL;
          Cons translatedmethodbody = null;

          if ((unit.translation != null) &&
              (!(unit.translation == null))) {
            otree = ((Cons)(unit.translation));
            unit.translation = Stella.NIL;
            return (otree);
          }
          Native.setSpecial(Stella.$METHODBEINGWALKED$, method);
          bodytree = Cons.deleteQuotedNullStatements(bodytree);
          if (!unitisfunction) {
            Native.setSpecial(Stella.$DUMMYDECLARATIONS$, Cons.cons(Cons.cons(((Symbol)(method.methodParameterNames().first())), Cons.cons(method.slotOwner, Cons.cons(Stella.SYM_STELLA_THIS, Stella.NIL))), ((Cons)(Stella.$DUMMYDECLARATIONS$.get()))));
          }
          if (method.abstractP) {
            translatedmethodbody = Stella.NIL;
          }
          else {
            {
              translatedmethodbody = Cons.cons(Stella.SYM_STELLA_JAVA_STATEMENTS, Cons.javaTranslateListOfTrees(bodytree).concatenate(Stella.NIL, Stella.NIL));
              if (!(((Cons)(Stella.$DUMMYDECLARATIONS$.get())) == Stella.NIL)) {
                translatedmethodbody = Cons.wrapMethodBodyWithJavaAuxiliaryDeclarations(translatedmethodbody, ((Cons)(Stella.$DUMMYDECLARATIONS$.get())));
              }
            }
          }
          if (((StringWrapper)(KeyValueList.dynamicSlotValue(method.dynamicSlots, Stella.SYM_STELLA_DOCUMENTATION, Stella.NULL_STRING_WRAPPER))).wrapperValue != null) {
            if (translatedmethodbody == Stella.NIL) {
              translatedmethodbody = Cons.list$(Cons.cons(Stella.SYM_STELLA_JAVA_STATEMENTS, Cons.cons(Cons.list$(Cons.cons(Stella.SYM_STELLA_JAVA_COMMENT, Cons.cons(StringWrapper.wrapString(((StringWrapper)(KeyValueList.dynamicSlotValue(method.dynamicSlots, Stella.SYM_STELLA_DOCUMENTATION, Stella.NULL_STRING_WRAPPER))).wrapperValue), Cons.cons(Stella.NIL, Stella.NIL)))), Cons.cons(Stella.NIL, Stella.NIL))));
            }
            else {
              translatedmethodbody.rest = Cons.cons(Cons.list$(Cons.cons(Stella.SYM_STELLA_JAVA_COMMENT, Cons.cons(StringWrapper.wrapString(((StringWrapper)(KeyValueList.dynamicSlotValue(method.dynamicSlots, Stella.SYM_STELLA_DOCUMENTATION, Stella.NULL_STRING_WRAPPER))).wrapperValue), Cons.cons(Stella.NIL, Stella.NIL)))), translatedmethodbody.rest.concatenate(Stella.NIL, Stella.NIL));
            }
          }
          otree = Cons.cons((unitisfunction ? Stella.SYM_STELLA_JAVA_FUNCTION : Stella.SYM_STELLA_JAVA_METHOD), MethodSlot.javaTranslateMethodSignature(method).concatenate(Cons.cons(translatedmethodbody, Stella.NIL), Stella.NIL));
          unit.translation = Stella.NIL;
          return (otree);
        }

      } finally {
        Stella.$DUMMYDECLARATIONS$.set(old$Dummydeclarations$000);
        Stella.$CURRENTDUMMYINDEX$.set(old$Currentdummyindex$000);
        Stella.$METHODBEINGWALKED$.set(old$Methodbeingwalked$000);
        Stella.$LOCALGENSYMTABLE$.set(old$Localgensymtable$000);
      }
    }
  }