private long calculateWeight ( final Entry e , final Object v ) { long _weight ; if ( v instanceof ExceptionWrapper ) { _weight = 1 ; } else { _weight = weigher . weigh ( e . getKey ( ) , v ) ; } if ( _weight < 0 ) { throw new IllegalArgumentException ( "weight must be positive." ) ; } return _weight ; }
Exceptions have the minimum weight .