<s> package org . eclipse . jdt . internal . core ; import java . text . NumberFormat ; import java . util . Date ; public class VerboseElementCache extends ElementCache { private Object beingAdded ; private String name ; public VerboseElementCache ( int size , String name ) { super ( size ) ; this . name = name ; } protected boolean makeSpace ( int space ) { if ( this . beingAdded == null ) return super . makeSpace ( space ) ; String fillingRatio = toStringFillingRation ( this . name ) ; boolean result = super . makeSpace ( space ) ; String newFillingRatio = toStringFillingRation ( this . name ) ; if ( ! fillingRatio . equals ( newFillingRatio ) ) { System . out . println ( Thread . currentThread ( ) + " " + new Date ( System . currentTimeMillis ( ) ) . toString ( ) ) ; System . out . println ( Thread . currentThread ( ) + "" + fillingRatio + " (NOW " + NumberFormat . getInstance ( ) . format ( fillingRatio ( ) ) + "% full)" ) ; System . out . println ( Thread . currentThread ( ) + "" + ( ( JavaElement ) this . beingAdded ) . toStringWithAncestors ( ) ) ; System . out . println ( ) ; } return result ; } public Object put ( Object key , Object value ) { try { if ( this . beingAdded == null ) this . beingAdded = key ; return super . put ( key , value ) ; } finally { if ( key . equals ( this . beingAdded ) ) this . beingAdded = null ; } } } </s>