Changed predicates methods to use Collections2.filter rather than Sets.filter

pull/477/head
Amanda Anganes 11 years ago
parent f1357cceb4
commit e88c6c4943

@ -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<OAuth2AccessTokenEntity> getExpiredAccessTokens() {
return Sets.filter(Sets.newHashSet(tokenRepository.getAllAccessTokens()), isAccessTokenExpired);
return Collections2.filter(tokenRepository.getAllAccessTokens(), isAccessTokenExpired);
}
private Collection<OAuth2RefreshTokenEntity> getExpiredRefreshTokens() {
return Sets.filter(Sets.newHashSet(tokenRepository.getAllRefreshTokens()), isRefreshTokenExpired);
return Collections2.filter(tokenRepository.getAllRefreshTokens(), isRefreshTokenExpired);
}
/* (non-Javadoc)

@ -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<ApprovedSite> getExpired() {
return Sets.filter(Sets.newHashSet(approvedSiteRepository.getAll()), isExpired);
return Collections2.filter(approvedSiteRepository.getAll(), isExpired);
}
}

Loading…
Cancel
Save