Skip to content

Commit 61bf237

Browse files
schauderodrotbohm
authored andcommitted
DATAJPA-1233 - Polishing.
Cleaned up JavaDoc. Removed superfluous modifiers and initialisation code.
1 parent d016d2e commit 61bf237

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/main/java/org/springframework/data/jpa/repository/query/NamedQuery.java

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2008-2017 the original author or authors.
2+
* Copyright 2008-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -87,7 +87,8 @@ private NamedQuery(JpaQueryMethod method, EntityManager em) {
8787
/**
8888
* Returns whether the named query with the given name exists.
8989
*
90-
* @param em
90+
* @param em must not be {@literal null}.
91+
* @param queryName must not be {@literal null}.
9192
* @return
9293
*/
9394
private static boolean hasNamedQuery(EntityManager em, String queryName) {
@@ -112,7 +113,8 @@ private static boolean hasNamedQuery(EntityManager em, String queryName) {
112113
/**
113114
* Looks up a named query for the given {@link org.springframework.data.repository.query.QueryMethod}.
114115
*
115-
* @param method
116+
* @param method must not be {@literal null}.
117+
* @param em must not be {@literal null}.
116118
* @return
117119
*/
118120
@Nullable
@@ -154,7 +156,7 @@ protected Query doCreateQuery(Object[] values) {
154156
protected TypedQuery<Long> doCreateCountQuery(Object[] values) {
155157

156158
EntityManager em = getEntityManager();
157-
TypedQuery<Long> countQuery = null;
159+
TypedQuery<Long> countQuery;
158160

159161
if (namedCountQueryIsPresent) {
160162
countQuery = em.createNamedQuery(countQueryName, Long.class);

src/test/java/org/springframework/data/jpa/repository/query/ParameterBinderUnitTests.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,10 @@ static class User {
7272

7373
}
7474

75-
static interface SampleRepository {
75+
interface SampleRepository {
7676

7777
User useIndexedParameters(String lastname);
7878

79-
User indexedParameterWithSort(String lastname, Sort sort);
80-
8179
User valid(@Param("username") String username);
8280

8381
User validWithPageable(@Param("username") String username, Pageable pageable);

0 commit comments

Comments
 (0)