Skip to content

Commit 2370283

Browse files
hausenismsrmoore
authored andcommitted
fix bug mitreid-connect#1397 Attempting to execute an operation on a closed EntityManager.
1 parent 728410a commit 2370283

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

openid-connect-server/src/main/java/org/mitre/oauth2/repository/impl/JpaOAuth2TokenRepository.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -190,15 +190,15 @@ public Set<OAuth2AccessTokenEntity> getAccessTokensByUserName(String name) {
190190
TypedQuery<OAuth2AccessTokenEntity> query = manager.createNamedQuery(OAuth2AccessTokenEntity.QUERY_BY_NAME, OAuth2AccessTokenEntity.class);
191191
query.setParameter(OAuth2AccessTokenEntity.PARAM_NAME, name);
192192
List<OAuth2AccessTokenEntity> results = query.getResultList();
193-
return results != null ? new HashSet<>(query.getResultList()) : new HashSet<>();
193+
return results != null ? new HashSet<>(results) : new HashSet<>();
194194
}
195195

196196
@Override
197197
public Set<OAuth2RefreshTokenEntity> getRefreshTokensByUserName(String name) {
198198
TypedQuery<OAuth2RefreshTokenEntity> query = manager.createNamedQuery(OAuth2RefreshTokenEntity.QUERY_BY_NAME, OAuth2RefreshTokenEntity.class);
199199
query.setParameter(OAuth2RefreshTokenEntity.PARAM_NAME, name);
200200
List<OAuth2RefreshTokenEntity> results = query.getResultList();
201-
return results != null ? new HashSet<>(query.getResultList()) : new HashSet<>();
201+
return results != null ? new HashSet<>(results) : new HashSet<>();
202202
}
203203

204204
@Override

0 commit comments

Comments
 (0)