fix some warnings in QueryResultsCacheImpl

This commit is contained in:
Gavin King 2022-01-29 10:48:23 +01:00
parent d86e9b6ab6
commit 3f1cc36c2a
1 changed files with 5 additions and 11 deletions

View File

@ -18,8 +18,6 @@ import org.hibernate.cache.spi.QueryResultsRegion;
import org.hibernate.cache.spi.SecondLevelCacheLogger;
import org.hibernate.cache.spi.TimestampsCache;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.internal.CoreLogging;
import org.hibernate.internal.CoreMessageLogger;
/**
* The standard implementation of the Hibernate QueryCache interface. Works
@ -30,7 +28,6 @@ import org.hibernate.internal.CoreMessageLogger;
* @author Steve Ebersole
*/
public class QueryResultsCacheImpl implements QueryResultsCache {
private static final CoreMessageLogger LOG = CoreLogging.messageLogger( QueryResultsCacheImpl.class );
private final QueryResultsRegion cacheRegion;
private final TimestampsCache timestampsCache;
@ -48,10 +45,9 @@ public class QueryResultsCacheImpl implements QueryResultsCache {
}
@Override
@SuppressWarnings({ "unchecked" })
public boolean put(
final QueryKey key,
final List results,
final List<?> results,
final SharedSessionContractImplementor session) throws HibernateException {
if ( SecondLevelCacheLogger.DEBUG_ENABLED ) {
SecondLevelCacheLogger.INSTANCE.debugf( "Caching query results in region: %s; timestamp=%s", cacheRegion.getName(), session.getTransactionStartTimestamp() );
@ -78,8 +74,7 @@ public class QueryResultsCacheImpl implements QueryResultsCache {
}
@Override
@SuppressWarnings({ "unchecked" })
public List get(
public List<?> get(
final QueryKey key,
final Set<String> spaces,
final SharedSessionContractImplementor session) throws HibernateException {
@ -110,8 +105,7 @@ public class QueryResultsCacheImpl implements QueryResultsCache {
}
@Override
@SuppressWarnings({ "unchecked" })
public List get(
public List<?> get(
final QueryKey key,
final String[] spaces,
final SharedSessionContractImplementor session) throws HibernateException {
@ -160,9 +154,9 @@ public class QueryResultsCacheImpl implements QueryResultsCache {
public static class CacheItem implements Serializable {
private final long timestamp;
private final List results;
private final List<?> results;
CacheItem(long timestamp, List results) {
CacheItem(long timestamp, List<?> results) {
this.timestamp = timestamp;
this.results = results;
}