diff --git a/openid-connect-server/src/main/java/org/mitre/oauth2/service/impl/DefaultOAuth2ProviderTokenService.java b/openid-connect-server/src/main/java/org/mitre/oauth2/service/impl/DefaultOAuth2ProviderTokenService.java index fefa299a9..1d8ddffa6 100644 --- a/openid-connect-server/src/main/java/org/mitre/oauth2/service/impl/DefaultOAuth2ProviderTokenService.java +++ b/openid-connect-server/src/main/java/org/mitre/oauth2/service/impl/DefaultOAuth2ProviderTokenService.java @@ -51,6 +51,7 @@ import org.springframework.security.oauth2.provider.token.TokenEnhancer; import org.springframework.stereotype.Service; import com.google.common.base.Predicate; +import com.google.common.collect.Collections2; import com.google.common.collect.Sets; import com.nimbusds.jwt.JWTClaimsSet; import com.nimbusds.jwt.PlainJWT; @@ -413,11 +414,11 @@ public class DefaultOAuth2ProviderTokenService implements OAuth2TokenEntityServi }; private Collection getExpiredAccessTokens() { - return Sets.filter(Sets.newHashSet(tokenRepository.getAllAccessTokens()), isAccessTokenExpired); + return Collections2.filter(tokenRepository.getAllAccessTokens(), isAccessTokenExpired); } private Collection getExpiredRefreshTokens() { - return Sets.filter(Sets.newHashSet(tokenRepository.getAllRefreshTokens()), isRefreshTokenExpired); + return Collections2.filter(tokenRepository.getAllRefreshTokens(), isRefreshTokenExpired); } /* (non-Javadoc) diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/DefaultApprovedSiteService.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/DefaultApprovedSiteService.java index 72ea5dc6f..9c29093cf 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/DefaultApprovedSiteService.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/DefaultApprovedSiteService.java @@ -34,7 +34,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.google.common.base.Predicate; -import com.google.common.collect.Sets; +import com.google.common.collect.Collections2; /** * Implementation of the ApprovedSiteService @@ -166,7 +166,7 @@ public class DefaultApprovedSiteService implements ApprovedSiteService { }; private Collection getExpired() { - return Sets.filter(Sets.newHashSet(approvedSiteRepository.getAll()), isExpired); + return Collections2.filter(approvedSiteRepository.getAll(), isExpired); } }