Skip to content

Commit 2dababc

Browse files
committed
Polishing.
Make fields final where applicable, move off deprecated API. See #1696
1 parent 0c8e7d9 commit 2dababc

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

src/main/java/org/springframework/data/couchbase/repository/query/N1qlCountQueryCreator.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protected N1QLExpression complete(N1QLExpression criteria, Sort sort) {
4545

4646
private static class CountParameterAccessor implements ParameterAccessor {
4747

48-
private ParameterAccessor delegate;
48+
private final ParameterAccessor delegate;
4949

5050
public CountParameterAccessor(ParameterAccessor delegate) {
5151
this.delegate = delegate;
@@ -85,7 +85,7 @@ public Iterator<Object> iterator() {
8585

8686
private static class CountPageable implements Pageable {
8787

88-
private Pageable delegate;
88+
private final Pageable delegate;
8989

9090
public CountPageable(Pageable delegate) {
9191
this.delegate = delegate;

src/main/java/org/springframework/data/couchbase/repository/query/ReactiveCouchbaseParameterAccessor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
import org.springframework.data.repository.query.ParametersParameterAccessor;
3030
import org.springframework.data.repository.util.ReactiveWrapperConverters;
31-
import org.springframework.data.repository.util.ReactiveWrappers;
31+
import org.springframework.data.util.ReactiveWrappers;
3232

3333
/**
3434
* Reactive {@link org.springframework.data.repository.query.ParametersParameterAccessor} implementation that subscribes

src/main/java/org/springframework/data/couchbase/repository/query/ReactiveCouchbaseQueryMethod.java

+4-7
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@
2929
import org.springframework.data.mapping.context.MappingContext;
3030
import org.springframework.data.projection.ProjectionFactory;
3131
import org.springframework.data.repository.core.RepositoryMetadata;
32-
import org.springframework.data.repository.util.ReactiveWrappers;
33-
import org.springframework.data.util.ClassTypeInformation;
32+
import org.springframework.data.util.ReactiveWrappers;
3433
import org.springframework.data.util.Lazy;
3534
import org.springframework.data.util.TypeInformation;
3635
import org.springframework.util.ClassUtils;
@@ -43,10 +42,9 @@
4342
*/
4443
public class ReactiveCouchbaseQueryMethod extends CouchbaseQueryMethod {
4544

46-
private static final ClassTypeInformation<Page> PAGE_TYPE = ClassTypeInformation.from(Page.class);
47-
private static final ClassTypeInformation<Slice> SLICE_TYPE = ClassTypeInformation.from(Slice.class);
45+
private static final TypeInformation<Page> PAGE_TYPE = TypeInformation.of(Page.class);
46+
private static final TypeInformation<Slice> SLICE_TYPE = TypeInformation.of(Slice.class);
4847

49-
private final Method method;
5048
private final Lazy<Boolean> isCollectionQueryCouchbase; // not to be confused with QueryMethod.isCollectionQuery
5149

5250
/**
@@ -64,7 +62,7 @@ public ReactiveCouchbaseQueryMethod(Method method, RepositoryMetadata metadata,
6462

6563
if (hasParameterOfType(method, Pageable.class)) {
6664

67-
TypeInformation<?> returnType = ClassTypeInformation.fromReturnTypeOf(method);
65+
TypeInformation<?> returnType = TypeInformation.fromReturnTypeOf(method);
6866

6967
boolean multiWrapper = ReactiveWrappers.isMultiValueType(returnType.getType());
7068
boolean singleWrapperWithWrappedPageableResult = ReactiveWrappers.isSingleValueType(returnType.getType())
@@ -89,7 +87,6 @@ public ReactiveCouchbaseQueryMethod(Method method, RepositoryMetadata metadata,
8987
}
9088
}
9189

92-
this.method = method;
9390
this.isCollectionQueryCouchbase = Lazy.of(() -> {
9491
boolean result = !(isPageQuery() || isSliceQuery())
9592
&& ReactiveWrappers.isMultiValueType(metadata.getReturnType(method).getType());

0 commit comments

Comments
 (0)