private T getCurrent ( T item ) { for ( String key : order ) { ConcurrentCache < Object , T > cache = caches . get ( key ) ; Object val = getValue ( key , item ) ; T tmp ; if ( val instanceof BigDecimal ) { val = ( ( BigDecimal ) val ) . longValue ( ) ; } tmp = cache . get ( val ) ; if ( tmp != null ) { if ( tmp instanceof CachedItem ) { if ( ( ( CachedItem ) tmp ) . isValidForCache ( ) ) { return tmp ; } } else { return tmp ; } } } return item ; }
Provides the current version of the specified item stored in the cache . If no item matches the passed in item then the passed in item is returned but not cached . This better be called from a synchronized block!