Skip to content

Commit fe56aa6

Browse files
committed
Polishing
1 parent 88049e9 commit fe56aa6

File tree

11 files changed

+382
-362
lines changed

11 files changed

+382
-362
lines changed

spring-context/src/main/java/org/springframework/cache/interceptor/CacheAspectSupport.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 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.
@@ -313,9 +313,9 @@ else if (StringUtils.hasText(operation.getCacheManager())) {
313313
* @param expectedType type for the bean
314314
* @return the bean matching that name
315315
* @throws org.springframework.beans.factory.NoSuchBeanDefinitionException if such bean does not exist
316-
* @see CacheOperation#keyGenerator
317-
* @see CacheOperation#cacheManager
318-
* @see CacheOperation#cacheResolver
316+
* @see CacheOperation#getKeyGenerator()
317+
* @see CacheOperation#getCacheManager()
318+
* @see CacheOperation#getCacheResolver()
319319
*/
320320
protected <T> T getBean(String beanName, Class<T> expectedType) {
321321
if (this.beanFactory == null) {
@@ -353,8 +353,8 @@ protected Object execute(CacheOperationInvoker invoker, Object target, Method me
353353

354354
/**
355355
* Execute the underlying operation (typically in case of cache miss) and return
356-
* the result of the invocation. If an exception occurs it will be wrapped in
357-
* a {@link CacheOperationInvoker.ThrowableWrapper}: the exception can be handled
356+
* the result of the invocation. If an exception occurs it will be wrapped in a
357+
* {@link CacheOperationInvoker.ThrowableWrapper}: the exception can be handled
358358
* or modified but it <em>must</em> be wrapped in a
359359
* {@link CacheOperationInvoker.ThrowableWrapper} as well.
360360
* @param invoker the invoker handling the operation being cached

spring-context/src/main/java/org/springframework/cache/interceptor/CacheOperationSource.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2019 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.
@@ -27,13 +27,14 @@
2727
* source level, or elsewhere.
2828
*
2929
* @author Costin Leau
30+
* @author Juergen Hoeller
3031
* @since 3.1
3132
*/
3233
public interface CacheOperationSource {
3334

3435
/**
35-
* Return the collection of cache operations for this method, or {@code null}
36-
* if the method contains no <em>cacheable</em> annotations.
36+
* Return the collection of cache operations for this method,
37+
* or {@code null} if the method contains no <em>cacheable</em> annotations.
3738
* @param method the method to introspect
3839
* @param targetClass the target class (may be {@code null}, in which case
3940
* the declaring class of the method must be used)

spring-context/src/main/java/org/springframework/cache/interceptor/CompositeCacheOperationSource.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2019 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.
@@ -29,6 +29,7 @@
2929
* over a given array of {@code CacheOperationSource} instances.
3030
*
3131
* @author Costin Leau
32+
* @author Juergen Hoeller
3233
* @since 3.1
3334
*/
3435
@SuppressWarnings("serial")
@@ -42,7 +43,7 @@ public class CompositeCacheOperationSource implements CacheOperationSource, Seri
4243
* @param cacheOperationSources the CacheOperationSource instances to combine
4344
*/
4445
public CompositeCacheOperationSource(CacheOperationSource... cacheOperationSources) {
45-
Assert.notEmpty(cacheOperationSources, "cacheOperationSources array must not be empty");
46+
Assert.notEmpty(cacheOperationSources, "CacheOperationSource array must not be empty");
4647
this.cacheOperationSources = cacheOperationSources;
4748
}
4849

@@ -54,21 +55,21 @@ public final CacheOperationSource[] getCacheOperationSources() {
5455
return this.cacheOperationSources;
5556
}
5657

58+
5759
@Override
5860
@Nullable
5961
public Collection<CacheOperation> getCacheOperations(Method method, @Nullable Class<?> targetClass) {
6062
Collection<CacheOperation> ops = null;
61-
6263
for (CacheOperationSource source : this.cacheOperationSources) {
6364
Collection<CacheOperation> cacheOperations = source.getCacheOperations(method, targetClass);
6465
if (cacheOperations != null) {
6566
if (ops == null) {
6667
ops = new ArrayList<>();
6768
}
68-
6969
ops.addAll(cacheOperations);
7070
}
7171
}
7272
return ops;
7373
}
74+
7475
}

spring-context/src/main/java/org/springframework/scripting/support/StandardScriptFactory.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2019 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.
@@ -36,7 +36,7 @@
3636
/**
3737
* {@link org.springframework.scripting.ScriptFactory} implementation based
3838
* on the JSR-223 script engine abstraction (as included in Java 6+).
39-
* Supports JavaScript, Groovy, JRuby and other JSR-223 compliant engines.
39+
* Supports JavaScript, Groovy, JRuby, and other JSR-223 compliant engines.
4040
*
4141
* <p>Typically used in combination with a
4242
* {@link org.springframework.scripting.support.ScriptFactoryPostProcessor};
@@ -151,6 +151,7 @@ public Object getScriptedObject(ScriptSource scriptSource, @Nullable Class<?>...
151151
if (script instanceof Class ? !requestedIfc.isAssignableFrom((Class<?>) script) :
152152
!requestedIfc.isInstance(script)) {
153153
adaptationRequired = true;
154+
break;
154155
}
155156
}
156157
if (adaptationRequired) {

spring-core/src/main/java/org/springframework/lang/NonNull.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 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.
@@ -26,8 +26,9 @@
2626

2727
/**
2828
* A common Spring annotation to declare that annotated elements cannot be {@code null}.
29-
* Leverages JSR 305 meta-annotations to indicate nullability in Java to common tools with
30-
* JSR 305 support and used by Kotlin to infer nullability of Spring API.
29+
*
30+
* <p>Leverages JSR-305 meta-annotations to indicate nullability in Java to common
31+
* tools with JSR-305 support and used by Kotlin to infer nullability of Spring API.
3132
*
3233
* <p>Should be used at parameter, return value, and field level. Method overrides should
3334
* repeat parent {@code @NonNull} annotations unless they behave differently.

spring-core/src/main/java/org/springframework/lang/NonNullFields.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2019 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.
@@ -36,7 +36,7 @@
3636
*
3737
* @author Sebastien Deleuze
3838
* @since 5.0
39-
* @see NonNullFields
39+
* @see NonNullApi
4040
* @see Nullable
4141
* @see NonNull
4242
*/

spring-core/src/main/java/org/springframework/lang/Nullable.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 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.
@@ -27,8 +27,10 @@
2727

2828
/**
2929
* A common Spring annotation to declare that annotated elements can be {@code null} under
30-
* some circumstance. Leverages JSR 305 meta-annotations to indicate nullability in Java
31-
* to common tools with JSR 305 support and used by Kotlin to infer nullability of Spring API.
30+
* some circumstance.
31+
*
32+
* <p>Leverages JSR-305 meta-annotations to indicate nullability in Java to common
33+
* tools with JSR-305 support and used by Kotlin to infer nullability of Spring API.
3234
*
3335
* <p>Should be used at parameter, return value, and field level. Methods override should
3436
* repeat parent {@code @Nullable} annotations unless they behave differently.

0 commit comments

Comments
 (0)