Skip to content

Commit

Permalink
HHH-15836 Cleanup unneccessary String <> Serializable casts in Timest…
Browse files Browse the repository at this point in the history
…ampsCacheEnabledImpl
  • Loading branch information
Sanne committed Dec 7, 2022
1 parent 7f350d6 commit 64d26d6
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/
package org.hibernate.cache.internal;

import java.io.Serializable;
import java.util.Collection;

import org.hibernate.cache.spi.RegionFactory;
Expand Down Expand Up @@ -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 );
}
Expand Down Expand Up @@ -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 );
}
Expand All @@ -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;
}
Expand All @@ -124,7 +123,7 @@ public boolean isUpToDate(
}

private boolean isSpaceOutOfDate(
Serializable space,
String space,
Long timestamp,
SharedSessionContractImplementor session,
StatisticsImplementor statistics) {
Expand Down Expand Up @@ -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;
}
Expand All @@ -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();
Expand Down

0 comments on commit 64d26d6

Please sign in to comment.