Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
200 commits
Select commit Hold shift + click to select a range
be0b671
Upgrade nio-multipart-parser to 1.1.0
rstoyanchev May 26, 2017
bc2e1b3
Correct the javadoc for ExchangeResult.getUrl()
wilkinsona May 26, 2017
2d37c96
Support for decoding @RequestPart content
rstoyanchev May 26, 2017
87598f4
Introduce null-safety of Spring Framework API
sdeleuze May 27, 2017
7efa0db
Merge pull request #1436 from wilkinsona/patch-2
snicoll May 27, 2017
1328c8f
Simplify CodecConfigurer related type names
rstoyanchev May 27, 2017
03b344b
Refactor DefaultCodecs implementation
rstoyanchev May 27, 2017
1383ad5
Reasonable defaults for MultipartHttpMessageWriter
rstoyanchev May 27, 2017
76b28a0
Fix grammatical errors in Testing chapter
sbrannen May 28, 2017
42d1ba0
Copy MockServerRequest to spring-test
poutsma May 29, 2017
beb7ed9
Polish
snicoll May 29, 2017
4b0dedc
Add ExtractingResponseErrorHandler
poutsma May 29, 2017
67bcef2
Polish MockServerHttpRequest|Response
rstoyanchev May 30, 2017
5dcfd84
MockServerHttpRequest and Response set cookie headers
rstoyanchev May 30, 2017
e06c4d5
Timeout Overrides in Messaging Templates
garyrussell May 26, 2017
abcc4ac
Fix composability issue in ExchangeMutatorWebFilter
rstoyanchev May 31, 2017
ad2c0f8
Improve @Nullable annotation
sdeleuze May 31, 2017
b47d713
Add missing @Nullable annotations on parameters
sdeleuze May 31, 2017
c3e6afb
Improve null-safety to fix some Spring Boot warnings
sdeleuze May 31, 2017
f9b319d
Revert Incorrect MessagingTemplate Change
garyrussell May 31, 2017
1f28825
Add more @Nullable parameters based on null usage
sdeleuze May 31, 2017
b494c53
Avoid defining nullability for non-relevant API
sdeleuze May 31, 2017
e81651b
Ignore empty Accept-Language header value
rstoyanchev Jun 1, 2017
94618c4
Polish doc on RequestMappingHandlerMapping#isHandler
QBNemo May 24, 2017
1412c2c
Fix sample code in WebFlux chapter
kazuki43zoo May 7, 2017
0ef1623
Optimize DefaultUserDestinationResolver.resolveDestination()
dreis2211 May 31, 2017
4a3f6e4
Polish
rstoyanchev Jun 1, 2017
d3e3365
Merge pull request #1439 from dreis2211/SPR-15602
rstoyanchev Jun 1, 2017
7894efd
Allow for null values in ExtractingResponseErrorHandler.hasError
poutsma Jun 1, 2017
8504084
Add package-info.java to mock.web.reactive.function.server
poutsma Jun 1, 2017
23a052c
Clear the buffer provided by Undertow before reading the request
violetagg Apr 24, 2017
e8d2c6c
AbstractListenerWriteProcessor/AbstractListenerWriteFlushProcessor er…
violetagg May 2, 2017
b93579a
Polish
rstoyanchev Jun 1, 2017
8ea5427
Allow for null query parameter values in ServerRequest
poutsma Jun 1, 2017
0557404
Throw exception for illegal PathMatch configurations
bclozel Jun 1, 2017
cf1bc81
Introduce LookupPath in WebFlux request routing
bclozel May 16, 2017
895fa2e
Add removeOnly mode to ForwardedHeaderFilter
rstoyanchev Jun 1, 2017
4d52590
Improve docs on forwarded headers
rstoyanchev Jun 2, 2017
74fb264
Fix LookupPath parsing
bclozel Jun 2, 2017
90df7dd
Add missing @Nullable annotation
sdeleuze Jun 2, 2017
a7020e4
Polish use of LookupPath
rstoyanchev Jun 2, 2017
d2685df
Add static factory/accessor methods to LookupPath
rstoyanchev Jun 2, 2017
4244df7
Consolidate matrix vars parsing in HttpRequestPathHelper
rstoyanchev Jun 2, 2017
77576ed
Fix PathPattern comparator result for wildcard suffix usage
aclement Jun 2, 2017
eae6378
Fixed reference
diguage Jun 3, 2017
a1a6157
Merge pull request #1444 from diguage/dev
snicoll Jun 3, 2017
5288641
Refactor duplicated code
diguage Jun 3, 2017
6e3a9cb
Polish "Refactor duplicated code"
snicoll Jun 4, 2017
ffc3f6d
Merge pull request #1445 from diguage:dev
snicoll Jun 4, 2017
f813712
Consistent use of @Nullable across the codebase (even for internals)
jhoeller Jun 7, 2017
a0bce61
Latest dependency updates (Undertow 1.4.16, Caffeine 2.5.2, JavaMail …
jhoeller Jun 7, 2017
510436b
Copy header values instead of header lists in DefaultClientRequestBui…
poutsma Jun 7, 2017
55b0fe1
Unwrap SpringValidatorAdapter (e.g. CustomValidatorBean) to native Va…
jhoeller Jun 7, 2017
7eaedf2
Debug-level log entry for any Jackson exception during canConvert
jhoeller Jun 7, 2017
c675424
Restore AnnotationUtils null argument support
philwebb Jun 7, 2017
72cd244
Make resolvePropertyName available to subclasses
philwebb Jun 8, 2017
e6f1950
Missing @Nullable annotations for findAnnotation/getValue/getDefaultV…
jhoeller Jun 8, 2017
bf66f45
Support overriding, removing headers in ClientRequest
poutsma Jun 8, 2017
ee5fa26
Protect against null return value from DataSource.getConnection()
jhoeller Jun 8, 2017
fd53d2a
Consistent use of @Nullable in spring-test
jhoeller Jun 8, 2017
8579ae6
Add comprehensive tests of Kotlin extensions
sdeleuze Jun 8, 2017
736bf1c
Fix Kotlin dependencies
sdeleuze Jun 8, 2017
86580b2
Polishing
sdeleuze Jun 8, 2017
b6c09fa
Disambiguate BodyExtractors/Inserters Kotlin function names
sdeleuze Jun 8, 2017
5e954dc
Use ParameterizedTypeReference in public-facing WebFlux APIs
poutsma Jun 7, 2017
b134501
Update to Reactor Bismuth-M2
rwinch Jun 9, 2017
a1ce324
Latest dependency updates (EclipseLink 2.6.5 RC2, JSON-B 1.0 RC2, Gso…
jhoeller Jun 9, 2017
c0550f7
Documented AbstractBeanFactory nullability warning
jhoeller Jun 9, 2017
ff2af66
PathPatternParser encodes patterns as it parses them
aclement Jun 9, 2017
95196e1
Use undecoded pathWithinApplication in WebFlux
rstoyanchev Jun 6, 2017
b65bfdb
Remove HttpRequestPathHelper
rstoyanchev Jun 7, 2017
cb60473
ResourceWebHandler uses MediaTypeFactory directly
rstoyanchev Jun 7, 2017
b0e8e7f
Refactor MappingContentTypeResolver implementations
rstoyanchev Jun 7, 2017
01a9251
Refactor RequestedContentTypeResolverBuilder
rstoyanchev Jun 9, 2017
f43ea96
Upgrade to Apache Johnzon 1.1.1
jhoeller Jun 11, 2017
e2e0410
Method-level javadoc on XmlReaderContext etc
jhoeller Jun 11, 2017
2d17411
Add RequestPath to http/server/reactive
rstoyanchev Jun 12, 2017
38a12ed
Expose RequestPath in ServerHttpRequest
rstoyanchev Jun 12, 2017
d337643
Add EditorConfig
diguage Jun 9, 2017
5df053c
Merge pull request #1455 from diguage:editor-config
snicoll Jun 12, 2017
dab7a7f
Refact iterator of Map with Java 8 forEach
diguage Jun 5, 2017
27aabb1
Polish "Refact iterator of Map with Java 8 forEach"
snicoll Jun 12, 2017
ca1e682
Merge pull request #1451 from diguage:lambda-map
snicoll Jun 12, 2017
c1d44d9
Use the diamond syntax
diguage Jun 5, 2017
a665da4
Merge pull request #1450 from diguage:diamond
snicoll Jun 12, 2017
3373a3f
Add Kotlin extensions for WebTestClient API
sdeleuze Jun 12, 2017
7085a30
Improve capacity calculcation in DefaultDataBuffer
poutsma Jun 12, 2017
9bf82dc
Add addAll(MultiValueMap)
poutsma Jun 12, 2017
424bc75
Remove headers(HttpHeaders)
poutsma Jun 12, 2017
2efa062
Use Map#forEach instead of Map#entrySet#forEach
diguage Jun 5, 2017
451b419
Polish "Use Map#forEach instead of Map#entrySet#forEach"
snicoll Jun 12, 2017
aca5eb7
Merge pull request #1449 from diguage:dev
snicoll Jun 12, 2017
6320976
Latest dependency updates (H2 1.4.196, Apache JSTL 1.2.5, HtmlUnit 2.27)
jhoeller Jun 12, 2017
14161d1
Protected applyLifecycleMethods in UrlBasedViewResolver
jhoeller Jun 12, 2017
3ae84d6
Consistent support for Charset/StandardCharsets in UriUtils etc
jhoeller Jun 12, 2017
1f0d107
Enable trailing slash matching by default
bclozel Jun 12, 2017
233c15b
Add PathPatternRegistry for handler mapping matching
bclozel Jun 12, 2017
47ec966
TargetSource.getTarget() is nullable again (for compatibility with Me…
jhoeller Jun 12, 2017
7381605
TargetSource.getTarget() is nullable again (for compatibility with Me…
jhoeller Jun 13, 2017
4b1478d
Replace relevant code with lambda
diguage Jun 7, 2017
fc64b80
Polish "Replace relevant code with lambda"
snicoll Jun 13, 2017
40df48f
Merge pull request #1454 from diguage:lambda
snicoll Jun 13, 2017
58242f2
Polish
snicoll Jun 13, 2017
7dd8dc6
Fixes for ignored tests after last week's nullability commit
jhoeller Jun 13, 2017
779deb0
Cleanup of duplicate semicolons
jhoeller Jun 13, 2017
aa28b6c
Upgrade to Kotlin 1.1.2-5
sdeleuze Jun 13, 2017
a0cea9a
Polishing
jhoeller Jun 13, 2017
72a8868
FreeMarker macros based on HTML output format (requires FreeMarker 2.…
jhoeller Jun 13, 2017
e0e6736
Introduce LocaleContextResolver in WebFlux
sdeleuze Jun 6, 2017
97909f2
Support date properties in Content-Disposition HTTP header
sdeleuze May 29, 2017
7018804
ServerRequest.path() should return raw path
poutsma Jun 13, 2017
1ef5f61
Refactor iterator of Map with Java8's Map.forEach
diguage Jun 13, 2017
1ab678a
Polish "Refactor iterator of Map with Java8's Map.forEach"
snicoll Jun 13, 2017
5e4e3fb
Merge pull request #1459 from diguage:lambda-map
snicoll Jun 13, 2017
223315f
Update to SonarQube 2.5
rwinch Jun 13, 2017
04d5a29
Remove KClass based Kotlin extensions
sdeleuze Jun 13, 2017
137fc48
Polishing
jhoeller Jun 13, 2017
7b5f96c
HttpComponentsAsyncClientHttpRequestFactory supports plain HttpAsyncC…
jhoeller Jun 14, 2017
97a97f9
RequestPath improvements
rstoyanchev Jun 14, 2017
1018bf7
Separate DefaultRequestPath/DefaultPathSegmentContainer
rstoyanchev Jun 14, 2017
97917aa
Add PathSegmentContainer subPath extracting method
rstoyanchev Jun 14, 2017
53e8ebe
Fix failing test (after previous commit)
rstoyanchev Jun 15, 2017
ef3e309
Adjust timeout in Spring MVC for reactive streaming
rstoyanchev Jun 15, 2017
67e482a
Fix ROOT_PATH constant to match recent changes
rstoyanchev Jun 15, 2017
4a21fb2
Fix root path test and add more test cases
rstoyanchev Jun 15, 2017
7e25127
Consistent nullability of headers Map and MessagePostProcessor
jhoeller Jun 15, 2017
d5f9ad0
Support ScriptEngine#eval(String, Bindings) in ScriptTemplateView
sdeleuze Jun 16, 2017
efb735a
SimpleRequestExpectationManager properly handles sequential requests …
jhoeller Jun 16, 2017
38db64e
Warn when Jackson + Kotlin are used without jackson-module-kotlin
sdeleuze Jun 16, 2017
a2e555d
Upgrade to Jackson 2.9.0.pr4
sdeleuze Jun 17, 2017
b14df2b
Fix a missing line of xml fragment
vincenthsin Jun 17, 2017
0e87a34
Merge pull request #1461 from freeman0432:master
snicoll Jun 17, 2017
018cc45
Upgrade to Groovy 2.5 beta 1
jhoeller Jun 19, 2017
52148a1
Consistently use CodecConfigurer for configuration
bclozel Jun 19, 2017
4a0597d
Replace WebClient.filter with Builder.filter
poutsma Jun 19, 2017
50fc8f4
Support Void response body type in WebClient
poutsma Jun 20, 2017
3b1d46b
Polishing
poutsma Jun 20, 2017
c244f33
Polishing
jhoeller Jun 20, 2017
535103c
Fine-tune HTTP/RMI Invoker exception handling
jhoeller Jun 20, 2017
a95cf07
Add WebTestClient.mutate()
poutsma Jun 20, 2017
0313363
Missing @Nullable annotations in WebFlux, in particular around locale…
jhoeller Jun 20, 2017
f092ae5
Conditionally apply Kotlin if not using JDK 9
rwinch Jun 13, 2017
59e9094
Rename CorsProcessor#processRequest to process
sdeleuze Jun 19, 2017
1e04cdf
Add CorsWebFilter
sdeleuze Jun 20, 2017
0a4d3c1
Jackson2JsonDecoder should support empty JSON array
poutsma Jun 21, 2017
4f39edc
Fix initialization issue with headers in DefaultWebClient
poutsma Jun 21, 2017
5c1d8c7
Leverage ZonedDateTime in HttpHeaders
sdeleuze Jun 21, 2017
ac68cc3
Ordered WebMvcConfigurer interceptor registrations
gdncomm-eko-k-khannedy Jun 3, 2017
782c595
Polish
rstoyanchev Jun 22, 2017
c37c59f
Consumer methods for WebHttpHandlerBuilder
rstoyanchev Jun 23, 2017
4db0ce1
Add MockServerConfigurer to WebTestClient
rstoyanchev Jun 23, 2017
8fc3b3b
Add WebTestClientConfigurer
rstoyanchev Jun 23, 2017
8ac29c8
Add cloneBuilder method on WebClient.Builder
bclozel Jun 22, 2017
12850c5
Fix test failure by using the new cloneBuilder method
rstoyanchev Jun 23, 2017
97390fd
Polish
rstoyanchev Jun 23, 2017
d57cd37
Upgrade to Kotlin 1.1.3
sdeleuze Jun 23, 2017
043c0ef
Same session after mutate for WebTestClient mock server
rstoyanchev Jun 23, 2017
ba3a12e
Use fixed GMT time-zone for WebSession Clock
sdeleuze Jun 26, 2017
155a1c6
AsyncHandlerInterceptor.afterConcurrentHandlingStarted declared as de…
jhoeller Jun 26, 2017
098ff6f
Compatibility with JDK 9 release candidate build (175)
jhoeller Jun 26, 2017
140542e
Polishing
jhoeller Jun 26, 2017
e0678ba
Add onError callback to DeferredResult
violetagg Jun 23, 2017
eb0479d
Polish
rstoyanchev Jun 26, 2017
5b8f7f5
Deprecate adapter classes for async interceptors
rstoyanchev Jun 26, 2017
9cb74b1
Enable suspend/resume on reactive TomcatWebSocketSession
violetagg Jan 18, 2017
cea1a0f
Polish
rstoyanchev Jun 26, 2017
41eaf03
Compatibility with covariant return type on JDK 9's ByteBuffer
jhoeller Jun 26, 2017
98642c7
Consistent ScriptTemplateView locale resolution via request
jhoeller Jun 26, 2017
87430f3
ListenableFuture provides CompletableFuture adaptation via completable()
jhoeller Jun 26, 2017
d728d59
Add missing license headers in Kotlin files
sdeleuze Jun 27, 2017
667437e
Polish
rstoyanchev Jun 27, 2017
b778f94
Made ObjectMapper field private with protected accessor
poutsma Jun 28, 2017
31e0e53
Leverage Jackson non-blocking parser
poutsma Jun 28, 2017
33f9991
Change spaces to tabs in build.gradle
poutsma Jun 28, 2017
b1f06fd
Polish
snicoll Jun 29, 2017
9d7b850
Delay DataBuffer release until stream is closed
poutsma Jun 29, 2017
58a5e7f
Proper closing of resources
poutsma Jun 29, 2017
67330df
Expose mapped handler as an exchange attribute
rstoyanchev Jun 29, 2017
cd64370
Update to reactor core 3.1.0.B-S with context update for monoSendOper…
Jun 29, 2017
9253fac
Refactor ServerWebExchange#getAttribute options
rstoyanchev Jun 29, 2017
7de6cfa
Refactor WebSession#getAttribute options
rstoyanchev Jun 29, 2017
8f4eb23
Remove use of Optional in SyncHandlerMethodArgumentResolver
rstoyanchev Jun 29, 2017
af69c5b
Upgrade to AspectJ 1.9 beta 6
jhoeller Jun 29, 2017
c4694c3
WebAsyncManager defensively ignores attribute type mismatch
jhoeller Jun 29, 2017
cc74a28
@Nullable all the way: null-safety at field level
jhoeller Jun 29, 2017
5f4d1a4
CronSequenceGenerator.isValidExpression actually validates cron fields
jhoeller Jun 29, 2017
5f020d1
Polish - the flag continueProcessing is not needed
violetagg Jun 30, 2017
b33d8c6
Merge pull request #1467 from violetagg/deferred-result-handle-error
jhoeller Jun 30, 2017
621df7c
Add ByteBuf leak detection @Rule
poutsma Jun 30, 2017
930f0f1
Add ServerRequest.cookies()
poutsma Jun 30, 2017
9afce23
WebSocketSession.getUri() may return null
jhoeller Jun 30, 2017
6534359
FactoryBean object cache cleared on shutdown
jhoeller Jun 30, 2017
fc3fcf0
Refactor PathSegmentContainer -> PathContainer
rstoyanchev Jun 27, 2017
26448a0
Rework matching to use PathContainer
aclement Jun 28, 2017
8581afa
WebFlux compiles after PathPattern/Container changes
rstoyanchev Jun 30, 2017
850083c
Polish
rstoyanchev Jun 30, 2017
a5e5478
Remove PathPatternComparator
rstoyanchev Jun 30, 2017
145eab9
Remove PathMatchResultComparator
rstoyanchev Jul 1, 2017
15cf9c1
Switch to ContainerPath variants in HandlerMapping's
rstoyanchev Jul 2, 2017
9528c35
Fix typo
rstoyanchev Jul 2, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*.{adoc,bat,groovy,html,java,js,jsp,kt,kts,md,properties,py,rb,sh,sql,svg,txt,xml,xsd}]
charset = utf-8

[*.{groovy,java,kt,kts,xml,xsd}]
indent_style = tab
indent_size = 4
continuation_indent_size = 8
end_of_line = lf
213 changes: 114 additions & 99 deletions build.gradle

Large diffs are not rendered by default.

Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 3 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Apr 10 21:20:52 CEST 2017
#Mon Jun 26 15:28:23 CEST 2017
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5.1-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
4 changes: 3 additions & 1 deletion import-into-idea.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The following has been tested against IntelliJ IDEA 2016.2.2

_Within your locally cloned spring-framework working directory:_

1. Precompile `spring-oxm` with `./gradlew cleanIdea :spring-oxm:compileTestJava`
1. Precompile `spring-oxm` with `./gradlew :spring-oxm:compileTestJava`
2. Import into IntelliJ (File -> New -> Project from Existing Sources -> Navigate to directory -> Select build.gradle)
3. When prompted exclude the `spring-aspects` module (or after the import via File-> Project Structure -> Modules)
4. Code away
Expand All @@ -20,6 +20,8 @@ IntelliJ IDEA. See http://youtrack.jetbrains.com/issue/IDEA-64446 for details. I
IntelliJ IDEA. Resolving this is a work in progress. If attempting to run all JUnit tests from within
IntelliJ IDEA, you will likely need to set the following VM options to avoid out of memory errors:
-XX:MaxPermSize=2048m -Xmx2048m -XX:MaxHeapSize=2048m
4. If you invoke "Rebuild Project" in the IDE, you'll have to generate some test
resources of the `spring-oxm` module again (`./gradlew :spring-oxm:compileTestJava`)


## Tips
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package org.aopalliance.aop;

import org.springframework.lang.Nullable;

/**
* Superclass for all AOP infrastructure exceptions.
* Unchecked, as such exceptions are fatal and end user
Expand All @@ -41,7 +43,7 @@ public AspectException(String message) {
* @param message the exception message
* @param cause the root cause, if any
*/
public AspectException(String message, Throwable cause) {
public AspectException(String message, @Nullable Throwable cause) {
super(message, cause);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package org.aopalliance.intercept;

import org.springframework.lang.Nullable;

/**
* Intercepts calls on an interface on its way to the target. These
* are nested "on top" of the target.
Expand Down Expand Up @@ -52,6 +54,7 @@ public interface MethodInterceptor extends Interceptor {
* @throws Throwable if the interceptors or the target object
* throws an exception
*/
@Nullable
Object invoke(MethodInvocation invocation) throws Throwable;

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

import java.lang.reflect.Method;

import org.springframework.lang.Nullable;

/**
* After returning advice is invoked only on normal method return, not if an
* exception is thrown. Such advice can see the return value, but cannot change it.
Expand All @@ -39,6 +41,6 @@ public interface AfterReturningAdvice extends AfterAdvice {
* allowed by the method signature. Otherwise the exception
* will be wrapped as a runtime exception.
*/
void afterReturning(Object returnValue, Method method, Object[] args, Object target) throws Throwable;
void afterReturning(@Nullable Object returnValue, Method method, Object[] args, @Nullable Object target) throws Throwable;

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

import java.lang.reflect.Method;

import org.springframework.lang.Nullable;

/**
* A specialized type of {@link MethodMatcher} that takes into account introductions
* when matching methods. If there are no introductions on the target class,
Expand All @@ -39,6 +41,6 @@ public interface IntroductionAwareMethodMatcher extends MethodMatcher {
* asking is the subject on one or more introductions; {@code false} otherwise
* @return whether or not this method matches statically
*/
boolean matches(Method method, Class<?> targetClass, boolean hasIntroductions);
boolean matches(Method method, @Nullable Class<?> targetClass, boolean hasIntroductions);

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

import java.lang.reflect.Method;

import org.springframework.lang.Nullable;

/**
* Advice invoked before a method is invoked. Such advices cannot
* prevent the method call proceeding, unless they throw a Throwable.
Expand All @@ -39,6 +41,6 @@ public interface MethodBeforeAdvice extends BeforeAdvice {
* allowed by the method signature. Otherwise the exception
* will be wrapped as a runtime exception.
*/
void before(Method method, Object[] args, Object target) throws Throwable;
void before(Method method, Object[] args, @Nullable Object target) throws Throwable;

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

import java.lang.reflect.Method;

import org.springframework.lang.Nullable;

/**
* Part of a {@link Pointcut}: Checks whether the target method is eligible for advice.
*
Expand Down Expand Up @@ -57,7 +59,7 @@ public interface MethodMatcher {
* the candidate class must be taken to be the method's declaring class)
* @return whether or not this method matches statically
*/
boolean matches(Method method, Class<?> targetClass);
boolean matches(Method method, @Nullable Class<?> targetClass);

/**
* Is this MethodMatcher dynamic, that is, must a final call be made on the
Expand Down Expand Up @@ -86,7 +88,7 @@ public interface MethodMatcher {
* @return whether there's a runtime match
* @see MethodMatcher#matches(Method, Class)
*/
boolean matches(Method method, Class<?> targetClass, Object... args);
boolean matches(Method method, @Nullable Class<?> targetClass, Object... args);


/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

import org.aopalliance.intercept.MethodInvocation;

import org.springframework.lang.Nullable;

/**
* Extension of the AOP Alliance {@link org.aopalliance.intercept.MethodInvocation}
* interface, allowing access to the proxy that the method invocation was made through.
Expand Down Expand Up @@ -73,14 +75,15 @@ public interface ProxyMethodInvocation extends MethodInvocation {
* @param key the name of the attribute
* @param value the value of the attribute, or {@code null} to reset it
*/
void setUserAttribute(String key, Object value);
void setUserAttribute(String key, @Nullable Object value);

/**
* Return the value of the specified user attribute.
* @param key the name of the attribute
* @return the value of the attribute, or {@code null} if not set
* @see #setUserAttribute
*/
@Nullable
Object getUserAttribute(String key);

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package org.springframework.aop;

import org.springframework.lang.Nullable;

/**
* Minimal interface for exposing the target class behind a proxy.
*
Expand All @@ -34,6 +36,7 @@ public interface TargetClassAware {
* (typically a proxy configuration or an actual proxy).
* @return the target Class, or {@code null} if not known
*/
@Nullable
Class<?> getTargetClass();

}
21 changes: 12 additions & 9 deletions spring-aop/src/main/java/org/springframework/aop/TargetSource.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*<
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,6 +16,8 @@

package org.springframework.aop;

import org.springframework.lang.Nullable;

/**
* A {@code TargetSource} is used to obtain the current "target" of
* an AOP invocation, which will be invoked via reflection if no around
Expand All @@ -29,24 +31,23 @@
* {@code TargetSources} directly: this is an AOP framework interface.
*
* @author Rod Johnson
* @author Juergen Hoeller
*/
public interface TargetSource extends TargetClassAware {

/**
* Return the type of targets returned by this {@link TargetSource}.
* <p>Can return {@code null}, although certain usages of a
* {@code TargetSource} might just work with a predetermined
* target class.
* <p>Can return {@code null}, although certain usages of a {@code TargetSource}
* might just work with a predetermined target class.
* @return the type of targets returned by this {@link TargetSource}
*/
@Override
Class<?> getTargetClass();

/**
* Will all calls to {@link #getTarget()} return the same object?
* <p>In that case, there will be no need to invoke
* {@link #releaseTarget(Object)}, and the AOP framework can cache
* the return value of {@link #getTarget()}.
* <p>In that case, there will be no need to invoke {@link #releaseTarget(Object)},
* and the AOP framework can cache the return value of {@link #getTarget()}.
* @return {@code true} if the target is immutable
* @see #getTarget
*/
Expand All @@ -55,14 +56,16 @@ public interface TargetSource extends TargetClassAware {
/**
* Return a target instance. Invoked immediately before the
* AOP framework calls the "target" of an AOP method invocation.
* @return the target object, which contains the joinpoint
* @return the target object which contains the joinpoint,
* or {@code null} if there is no actual target instance
* @throws Exception if the target object can't be resolved
*/
@Nullable
Object getTarget() throws Exception;

/**
* Release the given target object obtained from the
* {@link #getTarget()} method.
* {@link #getTarget()} method, if any.
* @param target object obtained from a call to {@link #getTarget()}
* @throws Exception if the object can't be released
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import java.io.Serializable;
import java.lang.reflect.Method;

import org.springframework.lang.Nullable;

/**
* Canonical MethodMatcher instance that matches all methods.
*
Expand All @@ -43,12 +45,12 @@ public boolean isRuntime() {
}

@Override
public boolean matches(Method method, Class<?> targetClass) {
public boolean matches(Method method, @Nullable Class<?> targetClass) {
return true;
}

@Override
public boolean matches(Method method, Class<?> targetClass, Object... args) {
public boolean matches(Method method, @Nullable Class<?> targetClass, Object... args) {
// Should never be invoked as isRuntime returns false.
throw new UnsupportedOperationException();
}
Expand Down
Loading