public synchronized ATermAppl makeAppl(AFun fun, ATerm[] args)
public ATermAppl makeAppl(AFun fun, ATerm[] args)
  public synchronized ATermAppl makeAppl(AFun fun, ATerm[] args)  {    ATerm term;    int hnr;    int idx;    HashedWeakRef prev, cur;    if (fun.getArity() != args.length) {      throw new IllegalArgumentException("arity does not match argument count: " +					 fun.getArity() + " != " + args.length);    }    hnr = ATermApplImpl.hashFunction(fun, args);    idx = hnr % term_table_size;    prev = null;    cur  = term_table[idx];    while (cur != null) {      term = (ATerm)cur.get();      if (term == null) {	// Found a reference to a garbage collected term, remove it to speed up lookups.	if (prev == null) {	  term_table[idx] = cur.next;	} else {	  prev.next = cur.next;	}      } else {	if (term.getType() == ATerm.APPL) {	  ATermAppl appl = (ATermAppl)term;	  if (appl.getAFun() == fun) {	    ATerm[] appl_args = appl.getArgumentArray();	    if (appl_args.length == args.length) {	      boolean found = true;	      for (int i=0; i<args.length; i++) {		if(appl_args[i] != args[i]){		  found = false;		  break;		}	      }	      if (found) {		return appl;	      }	    }	  }	}      }      cur = cur.next;    }        // No existing term found, so let's create one!    term = new ATermApplImpl(this, fun, args);    cur = new HashedWeakRef(term, term_table[idx]);    term_table[idx] = cur;    return (ATermAppl)term;  }