From 64d26d6ec975732a67571ddbe2327339f182b91a Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Wed, 7 Dec 2022 12:48:42 +0000 Subject: [PATCH] HHH-15836 Cleanup unneccessary String <> Serializable casts in TimestampsCacheEnabledImpl --- .../cache/internal/TimestampsCacheEnabledImpl.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/cache/internal/TimestampsCacheEnabledImpl.java b/hibernate-core/src/main/java/org/hibernate/cache/internal/TimestampsCacheEnabledImpl.java index 9a457889281d..e6be0dfe2703 100644 --- a/hibernate-core/src/main/java/org/hibernate/cache/internal/TimestampsCacheEnabledImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/cache/internal/TimestampsCacheEnabledImpl.java @@ -6,7 +6,6 @@ */ package org.hibernate.cache.internal; -import java.io.Serializable; import java.util.Collection; import org.hibernate.cache.spi.RegionFactory; @@ -55,7 +54,7 @@ public void preInvalidate( final SessionEventListenerManager eventListenerManager = session.getEventListenerManager(); final boolean debugEnabled = log.isDebugEnabled(); - for ( Serializable space : spaces ) { + for ( String space : spaces ) { if ( debugEnabled ) { log.debugf( "Pre-invalidating space [%s], timestamp: %s", space, ts ); } @@ -87,7 +86,7 @@ public void invalidate( final Long ts = session.getFactory().getCache().getRegionFactory().nextTimestamp(); final boolean debugEnabled = log.isDebugEnabled(); - for ( Serializable space : spaces ) { + for ( String space : spaces ) { if ( debugEnabled ) { log.debugf( "Invalidating space [%s], timestamp: %s", space, ts ); } @@ -114,7 +113,7 @@ public boolean isUpToDate( SharedSessionContractImplementor session) { final StatisticsImplementor statistics = session.getFactory().getStatistics(); - for ( Serializable space : spaces ) { + for ( String space : spaces ) { if ( isSpaceOutOfDate( space, timestamp, session, statistics ) ) { return false; } @@ -124,7 +123,7 @@ public boolean isUpToDate( } private boolean isSpaceOutOfDate( - Serializable space, + String space, Long timestamp, SharedSessionContractImplementor session, StatisticsImplementor statistics) { @@ -165,7 +164,7 @@ public boolean isUpToDate( SharedSessionContractImplementor session) { final StatisticsImplementor statistics = session.getFactory().getStatistics(); - for ( Serializable space : spaces ) { + for ( String space : spaces ) { if ( isSpaceOutOfDate( space, timestamp, session, statistics ) ) { return false; } @@ -174,7 +173,7 @@ public boolean isUpToDate( return true; } - private Long getLastUpdateTimestampForSpace(Serializable space, SharedSessionContractImplementor session) { + private Long getLastUpdateTimestampForSpace(String space, SharedSessionContractImplementor session) { Long ts = null; try { session.getEventListenerManager().cacheGetStart();