HHH-15836 Cleanup unneccessary String <> Serializable casts in TimestampsCacheEnabledImpl

This commit is contained in:
Sanne Grinovero 2022-12-07 12:48:42 +00:00 committed by Sanne Grinovero
parent 23cff8bd10
commit cceac72a22
1 changed files with 6 additions and 7 deletions

View File

@ -6,7 +6,6 @@
*/ */
package org.hibernate.cache.internal; package org.hibernate.cache.internal;
import java.io.Serializable;
import java.util.Collection; import java.util.Collection;
import org.hibernate.cache.spi.RegionFactory; import org.hibernate.cache.spi.RegionFactory;
@ -55,7 +54,7 @@ public class TimestampsCacheEnabledImpl implements TimestampsCache {
final SessionEventListenerManager eventListenerManager = session.getEventListenerManager(); final SessionEventListenerManager eventListenerManager = session.getEventListenerManager();
final boolean debugEnabled = log.isDebugEnabled(); final boolean debugEnabled = log.isDebugEnabled();
for ( Serializable space : spaces ) { for ( String space : spaces ) {
if ( debugEnabled ) { if ( debugEnabled ) {
log.debugf( "Pre-invalidating space [%s], timestamp: %s", space, ts ); log.debugf( "Pre-invalidating space [%s], timestamp: %s", space, ts );
} }
@ -87,7 +86,7 @@ public class TimestampsCacheEnabledImpl implements TimestampsCache {
final Long ts = session.getFactory().getCache().getRegionFactory().nextTimestamp(); final Long ts = session.getFactory().getCache().getRegionFactory().nextTimestamp();
final boolean debugEnabled = log.isDebugEnabled(); final boolean debugEnabled = log.isDebugEnabled();
for ( Serializable space : spaces ) { for ( String space : spaces ) {
if ( debugEnabled ) { if ( debugEnabled ) {
log.debugf( "Invalidating space [%s], timestamp: %s", space, ts ); log.debugf( "Invalidating space [%s], timestamp: %s", space, ts );
} }
@ -114,7 +113,7 @@ public class TimestampsCacheEnabledImpl implements TimestampsCache {
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
final StatisticsImplementor statistics = session.getFactory().getStatistics(); final StatisticsImplementor statistics = session.getFactory().getStatistics();
for ( Serializable space : spaces ) { for ( String space : spaces ) {
if ( isSpaceOutOfDate( space, timestamp, session, statistics ) ) { if ( isSpaceOutOfDate( space, timestamp, session, statistics ) ) {
return false; return false;
} }
@ -124,7 +123,7 @@ public class TimestampsCacheEnabledImpl implements TimestampsCache {
} }
private boolean isSpaceOutOfDate( private boolean isSpaceOutOfDate(
Serializable space, String space,
Long timestamp, Long timestamp,
SharedSessionContractImplementor session, SharedSessionContractImplementor session,
StatisticsImplementor statistics) { StatisticsImplementor statistics) {
@ -165,7 +164,7 @@ public class TimestampsCacheEnabledImpl implements TimestampsCache {
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
final StatisticsImplementor statistics = session.getFactory().getStatistics(); final StatisticsImplementor statistics = session.getFactory().getStatistics();
for ( Serializable space : spaces ) { for ( String space : spaces ) {
if ( isSpaceOutOfDate( space, timestamp, session, statistics ) ) { if ( isSpaceOutOfDate( space, timestamp, session, statistics ) ) {
return false; return false;
} }
@ -174,7 +173,7 @@ public class TimestampsCacheEnabledImpl implements TimestampsCache {
return true; return true;
} }
private Long getLastUpdateTimestampForSpace(Serializable space, SharedSessionContractImplementor session) { private Long getLastUpdateTimestampForSpace(String space, SharedSessionContractImplementor session) {
Long ts = null; Long ts = null;
try { try {
session.getEventListenerManager().cacheGetStart(); session.getEventListenerManager().cacheGetStart();