Skip to content

Commit df6ca3d

Browse files
committed
Polishing.
Add missing Override annotations, consistently use literal tags for boolean values.
1 parent e15ea58 commit df6ca3d

20 files changed

+39
-40
lines changed

Diff for: src/main/java/org/springframework/data/auditing/AuditingHandlerSupport.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public AuditingHandlerSupport(PersistentEntities entities) {
6161
/**
6262
* Setter do determine if {@link Auditable#setCreatedDate(TemporalAccessor)}} and
6363
* {@link Auditable#setLastModifiedDate(TemporalAccessor)} shall be filled with the current Java time. Defaults to
64-
* {@code true}. One might set this to {@code false} to use database features to set entity time.
64+
* {@literal true}. One might set this to {@literal false} to use database features to set entity time.
6565
*
6666
* @param dateTimeForNow the dateTimeForNow to set
6767
*/
@@ -71,7 +71,7 @@ public void setDateTimeForNow(boolean dateTimeForNow) {
7171

7272
/**
7373
* Set this to true if you want to treat entity creation as modification and thus setting the current date as
74-
* modification date during creation, too. Defaults to {@code true}.
74+
* modification date during creation, too. Defaults to {@literal true}.
7575
*
7676
* @param modifyOnCreation if modification information shall be set on creation, too
7777
*/

Diff for: src/main/java/org/springframework/data/domain/Window.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ static <T> Window<T> from(List<T> items, IntFunction<? extends ScrollPosition> p
6868
int size();
6969

7070
/**
71-
* Returns {@code true} if this window contains no elements.
71+
* Returns {@literal true} if this window contains no elements.
7272
*
73-
* @return {@code true} if this window contains no elements
73+
* @return {@literal true} if this window contains no elements
7474
*/
7575
@Override
7676
boolean isEmpty();
@@ -102,7 +102,7 @@ default boolean isLast() {
102102
* Returns whether the underlying scroll mechanism can provide a {@link ScrollPosition} at {@code index}.
103103
*
104104
* @param index
105-
* @return {@code true} if a {@link ScrollPosition} can be created; {@code false} otherwise.
105+
* @return {@literal true} if a {@link ScrollPosition} can be created; {@literal false} otherwise.
106106
* @see #positionAt(int)
107107
*/
108108
default boolean hasPosition(int index) {

Diff for: src/main/java/org/springframework/data/expression/ValueExpression.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ default ExpressionDependencies getExpressionDependencies() {
4848
/**
4949
* Returns whether the expression is a literal expression (that doesn't actually require evaluation).
5050
*
51-
* @return {@code true} if the expression is a literal expression; {@code false} if the expression can yield a
51+
* @return {@literal true} if the expression is a literal expression; {@literal false} if the expression can yield a
5252
* different result upon {@link #evaluate(ValueEvaluationContext) evaluation}.
5353
*/
5454
boolean isLiteral();

Diff for: src/main/java/org/springframework/data/mapping/Alias.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
/**
2424
* A container object which may or may not contain a type alias value. If a value is present, {@code isPresent()} will
25-
* return {@code true} and {@link #getValue()} will return the value.
25+
* return {@literal true} and {@link #getValue()} will return the value.
2626
* <p>
2727
* Additional methods that depend on the presence or absence of a contained value are provided, such as
2828
* {@link #hasValue(Object)} or {@link #isPresent()}

Diff for: src/main/java/org/springframework/data/mapping/PersistentEntity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ default P getPersistentProperty(Class<? extends Annotation> annotationType) {
229229
* Returns whether the property is transient.
230230
*
231231
* @param property name of the property.
232-
* @return {@code true} if the property is transient. Applies only for existing properties. {@code false} if the
232+
* @return {@literal true} if the property is transient. Applies only for existing properties. {@literal false} if the
233233
* property does not exist or is not transient.
234234
* @since 3.3
235235
*/

Diff for: src/main/java/org/springframework/data/mapping/model/AnnotationBasedPersistentProperty.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,10 @@ public <A extends Annotation> A findPropertyOrOwnerAnnotation(Class<A> annotatio
264264
}
265265

266266
/**
267-
* Returns whether the property carries the an annotation of the given type.
267+
* Returns whether the property carries the annotation of the given type.
268268
*
269269
* @param annotationType the annotation type to look up.
270-
* @return
270+
* @return {@literal true} if the annotation is present, {@literal false} otherwise.
271271
*/
272272
@Override
273273
public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) {

Diff for: src/main/java/org/springframework/data/mapping/model/KotlinValueUtils.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ public Class<?> getParameterType() {
348348
}
349349

350350
/**
351-
* @return {@code true} if the value hierarchy applies boxing.
351+
* @return {@literal true} if the value hierarchy applies boxing.
352352
*/
353353
public boolean appliesBoxing() {
354354
return applyBoxing;

Diff for: src/main/java/org/springframework/data/mapping/model/PersistentEntityParameterValueProvider.java

+8-9
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@
2626

2727
/**
2828
* {@link ParameterValueProvider} based on a {@link PersistentEntity} to use a {@link PropertyValueProvider} to look up
29-
* the value of the property referenced by the given {@link Parameter}. Additionally, a
30-
* {@link DefaultSpELExpressionEvaluator} can be configured to get property value resolution trumped by a SpEL
31-
* expression evaluation.
29+
* the value of the property referenced by the given {@link Parameter}.
3230
*
3331
* @author Oliver Gierke
3432
* @author Johannes Englmeier
@@ -42,18 +40,13 @@ public class PersistentEntityParameterValueProvider<P extends PersistentProperty
4240
private final @Nullable Object parent;
4341

4442
public PersistentEntityParameterValueProvider(PersistentEntity<?, P> entity, PropertyValueProvider<P> provider,
45-
Object parent) {
43+
@Nullable Object parent) {
4644
this.entity = entity;
4745
this.provider = provider;
4846
this.parent = parent;
4947
}
5048

5149
@Override
52-
@Nullable
53-
private static Object getTransientDefault(Class<?> parameterType) {
54-
return parameterType.isPrimitive() ? ReflectionUtils.getPrimitiveDefault(parameterType) : null;
55-
}
56-
5750
@Nullable
5851
@SuppressWarnings("unchecked")
5952
public <T> T getParameterValue(Parameter<T, P> parameter) {
@@ -82,4 +75,10 @@ public <T> T getParameterValue(Parameter<T, P> parameter) {
8275

8376
return provider.getPropertyValue(property);
8477
}
78+
79+
@Nullable
80+
private static Object getTransientDefault(Class<?> parameterType) {
81+
return parameterType.isPrimitive() ? ReflectionUtils.getPrimitiveDefault(parameterType) : null;
82+
}
83+
8584
}

Diff for: src/main/java/org/springframework/data/projection/EntityProjection.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,14 @@ public TypeInformation<?> getActualDomainType() {
158158
}
159159

160160
/**
161-
* @return {@code true} if the {@link #getMappedType()} is a projection.
161+
* @return {@literal true} if the {@link #getMappedType()} is a projection.
162162
*/
163163
public boolean isProjection() {
164164
return projection;
165165
}
166166

167167
/**
168-
* @return {@code true} if the {@link #getMappedType()} is a closed projection.
168+
* @return {@literal true} if the {@link #getMappedType()} is a closed projection.
169169
*/
170170
public boolean isClosedProjection() {
171171
return isProjection()

Diff for: src/main/java/org/springframework/data/projection/EntityProjectionIntrospector.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -222,13 +222,13 @@ public interface ProjectionPredicate {
222222
*
223223
* @param target the target type.
224224
* @param underlyingType the underlying type.
225-
* @return {@code true} if the input argument matches the predicate, otherwise {@code false}.
225+
* @return {@literal true} if the input argument matches the predicate, otherwise {@literal false}.
226226
*/
227227
boolean test(Class<?> target, Class<?> underlyingType);
228228

229229
/**
230230
* Return a composed predicate that represents a short-circuiting logical AND of this predicate and another. When
231-
* evaluating the composed predicate, if this predicate is {@code false}, then the {@code other} predicate is not
231+
* evaluating the composed predicate, if this predicate is {@literal false}, then the {@code other} predicate is not
232232
* evaluated.
233233
* <p>
234234
* Any exceptions thrown during evaluation of either predicate are relayed to the caller; if evaluation of this

Diff for: src/main/java/org/springframework/data/repository/config/PropertiesBasedNamedQueriesFactoryBean.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class PropertiesBasedNamedQueriesFactoryBean extends PropertiesLoaderSupp
4747
* Set whether a shared singleton {@code PropertiesBasedNamedQueries} instance should be created, or rather a new
4848
* {@code PropertiesBasedNamedQueries} instance on each request.
4949
* <p>
50-
* Default is {@code true} (a shared singleton).
50+
* Default is {@literal true} (a shared singleton).
5151
*/
5252
public void setSingleton(boolean singleton) {
5353
this.singleton = singleton;

Diff for: src/main/java/org/springframework/data/repository/core/RepositoryMethodContextHolder.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class RepositoryMethodContextHolder {
3434

3535
/**
3636
* ThreadLocal holder for repository method associated with this thread. Will contain {@code null} unless the
37-
* "exposeMetadata" property on the controlling repository factory configuration has been set to {@code true}.
37+
* "exposeMetadata" property on the controlling repository factory configuration has been set to {@literal true}.
3838
*/
3939
private static final ThreadLocal<RepositoryMethodContext> currentMethod = new NamedThreadLocal<>(
4040
"Current Repository Method");

Diff for: src/main/java/org/springframework/data/repository/core/support/MethodLookup.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ public interface MethodLookup {
4949

5050
/**
5151
* Returns a composed {@link MethodLookup} that represents a concatenation of this predicate and another. When
52-
* evaluating the composed method lookup, if this lookup evaluates {@code true}, then the {@code other} method lookup
53-
* is not evaluated.
52+
* evaluating the composed method lookup, if this lookup evaluates {@literal true}, then the {@code other} method
53+
* lookup is not evaluated.
5454
*
5555
* @param other must not be {@literal null}.
5656
* @return the composed {@link MethodLookup}.

Diff for: src/main/java/org/springframework/data/spel/spi/Function.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public int getParameterCount() {
152152
* Checks if the encapsulated method has exactly the argument types as those passed as an argument.
153153
*
154154
* @param argumentTypes a list of {@link TypeDescriptor}s to compare with the argument types of the method
155-
* @return {@code true} if the types are equal, {@code false} otherwise.
155+
* @return {@literal true} if the types are equal, {@literal false} otherwise.
156156
*/
157157
public boolean supportsExact(List<TypeDescriptor> argumentTypes) {
158158
return ParameterTypes.of(argumentTypes).exactlyMatchParametersOf(method);
@@ -162,7 +162,7 @@ public boolean supportsExact(List<TypeDescriptor> argumentTypes) {
162162
* Checks whether this {@code Function} has the same signature as another {@code Function}.
163163
*
164164
* @param other the {@code Function} to compare {@code this} with.
165-
* @return {@code true} if name and argument list are the same.
165+
* @return {@literal true} if name and argument list are the same.
166166
*/
167167
public boolean isSignatureEqual(Function other) {
168168

Diff for: src/main/java/org/springframework/data/util/KotlinReflectionUtils.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public static Class<?> getReturnType(Method method) {
136136
* Returns whether the given {@link KType} is a {@link KClass#isValue() value} class.
137137
*
138138
* @param type the kotlin type to inspect.
139-
* @return {@code true} the type is a value class.
139+
* @return {@literal true} the type is a value class.
140140
* @since 3.2
141141
*/
142142
public static boolean isValueClass(KType type) {
@@ -148,7 +148,7 @@ public static boolean isValueClass(KType type) {
148148
* Returns whether the given class makes uses Kotlin {@link KClass#isValue() value} classes.
149149
*
150150
* @param type the kotlin type to inspect.
151-
* @return {@code true} when at least one property uses Kotlin value classes.
151+
* @return {@literal true} when at least one property uses Kotlin value classes.
152152
* @since 3.2
153153
*/
154154
public static boolean hasValueClassProperty(Class<?> type) {

Diff for: src/main/java/org/springframework/data/util/Predicates.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,18 @@ public interface Predicates {
5252
Predicate<Method> IS_BRIDGE_METHOD = Method::isBridge;
5353

5454
/**
55-
* A {@link Predicate} that yields always {@code true}.
55+
* A {@link Predicate} that yields always {@literal true}.
5656
*
57-
* @return a {@link Predicate} that yields always {@code true}.
57+
* @return a {@link Predicate} that yields always {@literal true}.
5858
*/
5959
static <T> Predicate<T> isTrue() {
6060
return t -> true;
6161
}
6262

6363
/**
64-
* A {@link Predicate} that yields always {@code false}.
64+
* A {@link Predicate} that yields always {@literal false}.
6565
*
66-
* @return a {@link Predicate} that yields always {@code false}.
66+
* @return a {@link Predicate} that yields always {@literal false}.
6767
*/
6868
static <T> Predicate<T> isFalse() {
6969
return t -> false;

Diff for: src/main/java/org/springframework/data/web/OffsetScrollPositionArgumentResolver.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public interface OffsetScrollPositionArgumentResolver extends HandlerMethodArgum
4242
* wrapped arguments in {@link java.util.Optional}.
4343
*
4444
* @param parameter the method parameter to resolve. This parameter must have previously been passed to
45-
* {@link #supportsParameter} which must have returned {@code true}.
45+
* {@link #supportsParameter} which must have returned {@literal true}.
4646
* @param mavContainer the ModelAndViewContainer for the current request
4747
* @param webRequest the current request
4848
* @param binderFactory a factory for creating {@link WebDataBinder} instances

Diff for: src/main/java/org/springframework/data/web/PageableArgumentResolver.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public interface PageableArgumentResolver extends HandlerMethodArgumentResolver
4040
* Resolves a {@link Pageable} method parameter into an argument value from a given request.
4141
*
4242
* @param parameter the method parameter to resolve. This parameter must have previously been passed to
43-
* {@link #supportsParameter} which must have returned {@code true}.
43+
* {@link #supportsParameter} which must have returned {@literal true}.
4444
* @param mavContainer the ModelAndViewContainer for the current request
4545
* @param webRequest the current request
4646
* @param binderFactory a factory for creating {@link WebDataBinder} instances

Diff for: src/main/java/org/springframework/data/web/SortArgumentResolver.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public interface SortArgumentResolver extends HandlerMethodArgumentResolver {
4040
* Resolves a {@link Sort} method parameter into an argument value from a given request.
4141
*
4242
* @param parameter the method parameter to resolve. This parameter must have previously been passed to
43-
* {@link #supportsParameter} which must have returned {@code true}.
43+
* {@link #supportsParameter} which must have returned {@literal true}.
4444
* @param mavContainer the ModelAndViewContainer for the current request
4545
* @param webRequest the current request
4646
* @param binderFactory a factory for creating {@link WebDataBinder} instances

Diff for: src/test/java/org/springframework/data/auditing/AuditingHandlerUnitTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ void setsAuditorIfConfigured() {
9696
}
9797

9898
/**
99-
* Checks that the advice does not set modification information on creation if the falg is set to {@code false}.
99+
* Checks that the advice does not set modification information on creation if the falg is set to {@literal false}.
100100
*/
101101
@Test
102102
void honoursModifiedOnCreationFlag() {

0 commit comments

Comments
 (0)