ATerm term; int hnr = ATermPlaceholderImpl.hashFunction(type); int idx = hnr % term_table_size;  HashedWeakRef prev, cur; prev = null; cur  = term_table[idx]; while (cur != null) { term = (ATerm)cur.get(); if (term == null) {  if (prev == null) { term_table[idx] = cur.next; } else { prev.next = cur.next; } } else { if (term.getType() == ATerm.PLACEHOLDER) { ATermPlaceholder ph = (ATermPlaceholder)term; if (ph.getPlaceholder() == type) { return ph; } } } cur = cur.next; }   term = new ATermPlaceholderImpl(this, type); cur = new HashedWeakRef(term, term_table[idx]); term_table[idx] = cur;  return (ATermPlaceholder)term;
return makePlaceholder(type, empty);
  public synchronized ATermPlaceholder makePlaceholder(ATerm type)  {    ATerm term;    int hnr = ATermPlaceholderImpl.hashFunction(type);    int idx = hnr % term_table_size;    HashedWeakRef prev, cur;    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.PLACEHOLDER) {	  ATermPlaceholder ph = (ATermPlaceholder)term;	  if (ph.getPlaceholder() == type) {	    return ph;	  }	}      }      cur = cur.next;    }        // No existing term found, so let's create one!    term = new ATermPlaceholderImpl(this, type);    cur = new HashedWeakRef(term, term_table[idx]);    term_table[idx] = cur;    return (ATermPlaceholder)term;  }