Skip to content
Permalink
Browse files

Backport selected refinements from the nullability efforts

Issue: SPR-15656
  • Loading branch information...
jhoeller committed Sep 26, 2017
1 parent 18a3322 commit 9fdc4404a5338c687776dc2d3066dc6b0281d1ed
Showing with 1,231 additions and 1,213 deletions.
  1. +8 −9 spring-aop/src/main/java/org/springframework/aop/TargetSource.java
  2. +10 −10 spring-aop/src/main/java/org/springframework/aop/aspectj/AbstractAspectJAdvice.java
  3. +10 −13 spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAdviceParameterNameDiscoverer.java
  4. +2 −5 spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/AbstractAutoProxyCreator.java
  5. +5 −13 spring-aop/src/main/java/org/springframework/aop/support/ComposablePointcut.java
  6. +1 −1 spring-aop/src/main/java/org/springframework/aop/support/NameMatchMethodPointcut.java
  7. +9 −18 spring-aop/src/main/java/org/springframework/aop/support/annotation/AnnotationMatchingPointcut.java
  8. +3 −5 spring-beans/src/main/java/org/springframework/beans/PropertyAccessor.java
  9. +17 −17 spring-beans/src/main/java/org/springframework/beans/factory/BeanFactory.java
  10. +5 −5 spring-beans/src/main/java/org/springframework/beans/factory/config/ServiceLocatorFactoryBean.java
  11. +75 −1 spring-beans/src/main/java/org/springframework/beans/factory/parsing/ReaderContext.java
  12. +3 −3 spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionDefaults.java
  13. +2 −3 spring-beans/src/main/java/org/springframework/beans/propertyeditors/ResourceBundleEditor.java
  14. +2 −3 spring-context-support/src/main/java/org/springframework/cache/jcache/JCacheCache.java
  15. +1 −9 ...ntext-support/src/main/java/org/springframework/cache/jcache/interceptor/JCacheAspectSupport.java
  16. +12 −12 spring-context-support/src/main/java/org/springframework/mail/MailMessage.java
  17. +6 −7 spring-context-support/src/main/java/org/springframework/mail/SimpleMailMessage.java
  18. +6 −6 ...ext/src/main/java/org/springframework/cache/config/AnnotationDrivenCacheBeanDefinitionParser.java
  19. +2 −2 spring-context/src/main/java/org/springframework/cache/config/CacheAdviceParser.java
  20. +1 −2 spring-context/src/main/java/org/springframework/cache/interceptor/CacheAspectSupport.java
  21. +1 −4 ...ontext/src/main/java/org/springframework/cache/interceptor/CacheOperationExpressionEvaluator.java
  22. +10 −13 spring-context/src/main/java/org/springframework/cache/interceptor/CacheProxyFactoryBean.java
  23. +14 −11 spring-context/src/main/java/org/springframework/cache/support/NoOpCache.java
  24. +1 −1 ...g-context/src/main/java/org/springframework/context/annotation/ComponentScanAnnotationParser.java
  25. +3 −3 spring-context/src/main/java/org/springframework/context/annotation/MBeanExportConfiguration.java
  26. +3 −6 spring-context/src/main/java/org/springframework/context/event/EventExpressionEvaluator.java
  27. +7 −8 spring-context/src/main/java/org/springframework/context/event/EventPublicationInterceptor.java
  28. +4 −12 ...ng-context/src/main/java/org/springframework/context/event/GenericApplicationListenerAdapter.java
  29. +4 −1 spring-context/src/main/java/org/springframework/context/expression/AnnotatedElementKey.java
  30. +22 −22 spring-context/src/main/java/org/springframework/context/expression/MapAccessor.java
  31. +2 −2 ...-context/src/main/java/org/springframework/context/expression/StandardBeanExpressionResolver.java
  32. +6 −6 spring-context/src/main/java/org/springframework/context/support/DefaultMessageSourceResolvable.java
  33. +3 −1 spring-context/src/main/java/org/springframework/context/support/MessageSourceAccessor.java
  34. +6 −6 spring-context/src/main/java/org/springframework/context/support/SimpleThreadScope.java
  35. +2 −2 spring-context/src/main/java/org/springframework/format/number/CurrencyStyleFormatter.java
  36. +1 −1 ...ntext/src/main/java/org/springframework/format/number/NumberFormatAnnotationFormatterFactory.java
  37. +2 −2 spring-context/src/main/java/org/springframework/format/number/NumberStyleFormatter.java
  38. +10 −0 .../src/main/java/org/springframework/instrument/classloading/glassfish/GlassFishLoadTimeWeaver.java
  39. +2 −4 ...n/java/org/springframework/instrument/classloading/weblogic/WebLogicClassPreProcessorAdapter.java
  40. +2 −3 .../src/main/java/org/springframework/instrument/classloading/websphere/WebSphereLoadTimeWeaver.java
  41. +10 −19 ...text/src/main/java/org/springframework/jmx/export/assembler/InterfaceBasedMBeanInfoAssembler.java
  42. +7 −9 ...ng-context/src/main/java/org/springframework/jmx/export/assembler/MetadataMBeanInfoAssembler.java
  43. +7 −6 spring-context/src/main/java/org/springframework/jmx/export/metadata/JmxMetadataUtils.java
  44. +3 −1 spring-context/src/main/java/org/springframework/jmx/export/metadata/ManagedMetric.java
  45. +2 −5 spring-context/src/main/java/org/springframework/jmx/export/naming/KeyNamingStrategy.java
  46. +4 −3 spring-context/src/main/java/org/springframework/jmx/support/MetricType.java
  47. +2 −2 spring-context/src/main/java/org/springframework/jmx/support/NotificationListenerHolder.java
  48. +6 −5 spring-context/src/main/java/org/springframework/scheduling/concurrent/ConcurrentTaskScheduler.java
  49. +11 −10 ...context/src/main/java/org/springframework/scheduling/concurrent/ExecutorConfigurationSupport.java
  50. +3 −3 spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskScheduler.java
  51. +3 −2 spring-context/src/main/java/org/springframework/scheduling/support/PeriodicTrigger.java
  52. +3 −3 spring-context/src/main/java/org/springframework/scripting/support/ScriptFactoryPostProcessor.java
  53. +12 −16 spring-context/src/main/java/org/springframework/validation/DefaultMessageCodesResolver.java
  54. +2 −3 spring-context/src/main/java/org/springframework/validation/FieldError.java
  55. +2 −2 spring-context/src/main/java/org/springframework/validation/ObjectError.java
  56. +2 −2 spring-core/src/main/java/org/springframework/core/MethodClassKey.java
  57. +2 −2 spring-core/src/main/java/org/springframework/core/ResolvableTypeProvider.java
  58. +6 −6 spring-core/src/main/java/org/springframework/core/SerializableTypeWrapper.java
  59. +3 −4 spring-core/src/main/java/org/springframework/core/annotation/AnnotatedElementUtils.java
  60. +25 −30 spring-core/src/main/java/org/springframework/core/annotation/AnnotationAttributes.java
  61. +2 −2 spring-core/src/main/java/org/springframework/core/convert/Property.java
  62. +5 −1 spring-core/src/main/java/org/springframework/core/convert/support/ByteBufferConverter.java
  63. +7 −3 spring-core/src/main/java/org/springframework/core/convert/support/CollectionToArrayConverter.java
  64. +3 −4 spring-core/src/main/java/org/springframework/core/env/ReadOnlySystemAttributesMap.java
  65. +4 −4 spring-core/src/main/java/org/springframework/core/io/ByteArrayResource.java
  66. +7 −7 spring-core/src/main/java/org/springframework/core/io/VfsUtils.java
  67. +1 −7 spring-core/src/main/java/org/springframework/util/FastByteArrayOutputStream.java
  68. +5 −9 spring-core/src/main/java/org/springframework/util/MethodInvoker.java
  69. +3 −7 spring-core/src/main/java/org/springframework/util/ReflectionUtils.java
  70. +1 −2 spring-core/src/main/java/org/springframework/util/TypeUtils.java
  71. +2 −2 spring-core/src/main/java/org/springframework/util/concurrent/FutureAdapter.java
  72. +8 −8 spring-expression/src/main/java/org/springframework/expression/AccessException.java
  73. +3 −4 spring-expression/src/main/java/org/springframework/expression/ConstructorExecutor.java
  74. +10 −10 spring-expression/src/main/java/org/springframework/expression/OperatorOverloader.java
  75. +2 −4 ...expression/src/main/java/org/springframework/expression/common/TemplateAwareExpressionParser.java
  76. +11 −15 spring-expression/src/main/java/org/springframework/expression/spel/ExpressionState.java
  77. +6 −7 spring-expression/src/main/java/org/springframework/expression/spel/SpelParserConfiguration.java
  78. +2 −2 spring-expression/src/main/java/org/springframework/expression/spel/ast/BeanReference.java
  79. +2 −2 spring-expression/src/main/java/org/springframework/expression/spel/ast/CompoundExpression.java
  80. +6 −6 spring-expression/src/main/java/org/springframework/expression/spel/ast/FunctionReference.java
  81. +2 −2 spring-expression/src/main/java/org/springframework/expression/spel/ast/Indexer.java
  82. +2 −2 spring-expression/src/main/java/org/springframework/expression/spel/ast/NullLiteral.java
  83. +2 −2 spring-expression/src/main/java/org/springframework/expression/spel/ast/OpAnd.java
  84. +2 −2 spring-expression/src/main/java/org/springframework/expression/spel/ast/OpPlus.java
  85. +3 −3 spring-expression/src/main/java/org/springframework/expression/spel/ast/Operator.java
  86. +1 −1 spring-expression/src/main/java/org/springframework/expression/spel/ast/OperatorMatches.java
  87. +19 −17 spring-expression/src/main/java/org/springframework/expression/spel/ast/SpelNodeImpl.java
  88. +7 −8 spring-expression/src/main/java/org/springframework/expression/spel/standard/SpelCompiler.java
  89. +4 −3 spring-expression/src/main/java/org/springframework/expression/spel/support/ReflectionHelper.java
  90. +5 −3 ...xpression/src/main/java/org/springframework/expression/spel/support/ReflectiveMethodExecutor.java
  91. +48 −47 ...pression/src/main/java/org/springframework/expression/spel/support/StandardEvaluationContext.java
  92. +4 −3 ...g-expression/src/main/java/org/springframework/expression/spel/support/StandardTypeConverter.java
  93. +1 −1 spring-jdbc/src/main/java/org/springframework/jdbc/datasource/LazyConnectionDataSourceProxy.java
  94. +2 −2 spring-jdbc/src/main/java/org/springframework/jdbc/datasource/init/ResourceDatabasePopulator.java
  95. +6 −9 spring-messaging/src/main/java/org/springframework/messaging/converter/ContentTypeResolver.java
  96. +2 −2 ...-messaging/src/main/java/org/springframework/messaging/converter/MarshallingMessageConverter.java
  97. +4 −1 ...ging/src/main/java/org/springframework/messaging/handler/DestinationPatternsMessageCondition.java
  98. +6 −3 ...java/org/springframework/messaging/handler/invocation/AbstractExceptionHandlerMethodResolver.java
  99. +6 −6 ...c/main/java/org/springframework/messaging/handler/invocation/HandlerMethodReturnValueHandler.java
  100. +1 −2 spring-messaging/src/main/java/org/springframework/messaging/simp/SimpAttributesContextHolder.java
  101. +9 −9 spring-messaging/src/main/java/org/springframework/messaging/simp/SimpSessionScope.java
  102. +8 −6 ...in/java/org/springframework/messaging/simp/annotation/support/SendToMethodReturnValueHandler.java
  103. +3 −3 ...a/org/springframework/messaging/simp/annotation/support/SubscriptionMethodReturnValueHandler.java
  104. +3 −3 ...ssaging/src/main/java/org/springframework/messaging/simp/broker/AbstractBrokerMessageHandler.java
  105. +3 −1 ...messaging/src/main/java/org/springframework/messaging/simp/broker/SimpleBrokerMessageHandler.java
  106. +1 −1 spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/DefaultStompSession.java
  107. +3 −2 spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompClientSupport.java
  108. +2 −1 spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompSession.java
  109. +6 −4 spring-messaging/src/main/java/org/springframework/messaging/simp/user/UserDestinationResult.java
  110. +10 −8 ...g-messaging/src/main/java/org/springframework/messaging/simp/user/UserRegistryMessageHandler.java
  111. +5 −4 ...ng-messaging/src/main/java/org/springframework/messaging/support/ExecutorSubscribableChannel.java
  112. +1 −1 spring-messaging/src/main/java/org/springframework/messaging/support/MessageHeaderAccessor.java
  113. +5 −3 spring-orm/src/main/java/org/springframework/orm/jpa/EntityManagerFactoryUtils.java
  114. +3 −10 spring-test/src/main/java/org/springframework/mock/web/MockFilterChain.java
  115. +1 −3 spring-test/src/main/java/org/springframework/mock/web/MockPageContext.java
  116. +11 −10 spring-test/src/main/java/org/springframework/test/context/transaction/TransactionContext.java
  117. +7 −7 spring-test/src/main/java/org/springframework/test/context/transaction/TransactionContextHolder.java
  118. +1 −2 spring-test/src/main/java/org/springframework/test/web/servlet/RequestBuilder.java
  119. +3 −3 spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebConnection.java
  120. +4 −5 spring-tx/src/main/java/org/springframework/jca/cci/object/EisOperation.java
  121. +27 −26 spring-web/src/main/java/org/springframework/http/ResponseEntity.java
  122. +3 −3 ...g-web/src/main/java/org/springframework/http/client/HttpComponentsStreamingClientHttpRequest.java
  123. +55 −56 spring-web/src/main/java/org/springframework/http/client/InterceptingAsyncClientHttpRequest.java
  124. +14 −7 spring-web/src/main/java/org/springframework/http/client/OkHttp3ClientHttpResponse.java
  125. +7 −10 ...b/src/main/java/org/springframework/http/converter/feed/AbstractWireFeedHttpMessageConverter.java
  126. +3 −3 ...g-web/src/main/java/org/springframework/web/accept/AbstractMappingContentNegotiationStrategy.java
  127. +11 −11 .../src/main/java/org/springframework/web/accept/ServletPathExtensionContentNegotiationStrategy.java
  128. +3 −4 spring-web/src/main/java/org/springframework/web/bind/EscapedErrors.java
  129. +3 −3 spring-web/src/main/java/org/springframework/web/context/request/NativeWebRequest.java
  130. +8 −8 spring-web/src/main/java/org/springframework/web/context/request/ServletWebRequest.java
  131. +2 −2 spring-web/src/main/java/org/springframework/web/filter/CharacterEncodingFilter.java
  132. +7 −6 spring-web/src/main/java/org/springframework/web/filter/DelegatingFilterProxy.java
  133. +0 −1 ...g-web/src/main/java/org/springframework/web/method/annotation/ExceptionHandlerMethodResolver.java
  134. +16 −14 spring-web/src/main/java/org/springframework/web/method/annotation/InitBinderDataBinderFactory.java
  135. +5 −7 spring-web/src/main/java/org/springframework/web/method/annotation/SessionAttributesHandler.java
  136. +7 −7 spring-web/src/main/java/org/springframework/web/method/support/UriComponentsContributor.java
  137. +9 −1 spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsFileUploadSupport.java
  138. +1 −2 spring-web/src/main/java/org/springframework/web/util/JavaScriptUtils.java
  139. +7 −7 spring-web/src/main/java/org/springframework/web/util/UriComponents.java
  140. +3 −8 spring-web/src/test/java/org/springframework/mock/web/test/MockFilterChain.java
  141. +1 −3 spring-web/src/test/java/org/springframework/mock/web/test/MockPageContext.java
  142. +11 −5 spring-webmvc/src/main/java/org/springframework/web/servlet/config/MvcNamespaceUtils.java
  143. +5 −5 ...bmvc/src/main/java/org/springframework/web/servlet/config/ViewControllerBeanDefinitionParser.java
  144. +6 −6 ...ebmvc/src/main/java/org/springframework/web/servlet/config/ViewResolversBeanDefinitionParser.java
  145. +2 −6 ...ebmvc/src/main/java/org/springframework/web/servlet/config/annotation/AsyncSupportConfigurer.java
  146. +27 −22 ...src/main/java/org/springframework/web/servlet/config/annotation/ContentNegotiationConfigurer.java
  147. +26 −19 .../main/java/org/springframework/web/servlet/config/annotation/DefaultServletHandlerConfigurer.java
  148. +1 −1 ...bmvc/src/main/java/org/springframework/web/servlet/config/annotation/InterceptorRegistration.java
  149. +7 −7 ...g-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/InterceptorRegistry.java
  150. +1 −2 ...-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/ViewResolverRegistry.java
  151. +5 −7 ...c/src/main/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupport.java
  152. +33 −32 spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerMapping.java
  153. +18 −16 ...bmvc/src/main/java/org/springframework/web/servlet/handler/HandlerExceptionResolverComposite.java
  154. +26 −21 ...bmvc/src/main/java/org/springframework/web/servlet/mvc/condition/AbstractNameValueExpression.java
  155. +4 −3 ...g-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/HeadersRequestCondition.java
  156. +1 −2 spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/NameValueExpression.java
  157. +4 −3 ...ng-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/ParamsRequestCondition.java
  158. +3 −3 spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/RequestMappingInfo.java
  159. +2 −2 ...ain/java/org/springframework/web/servlet/mvc/method/annotation/HttpHeadersReturnValueHandler.java
  160. +4 −4 ...main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerAdapter.java
  161. +1 −2 ...in/java/org/springframework/web/servlet/mvc/method/annotation/RequestResponseBodyAdviceChain.java
  162. +1 −2 ...springframework/web/servlet/mvc/method/annotation/UriComponentsBuilderMethodArgumentResolver.java
  163. +11 −9 ...-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/RedirectAttributesModelMap.java
  164. +2 −2 spring-webmvc/src/main/java/org/springframework/web/servlet/resource/GzipResourceResolver.java
  165. +3 −3 spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceTransformerSupport.java
  166. +1 −3 spring-webmvc/src/main/java/org/springframework/web/servlet/support/AbstractFlashMapManager.java
  167. +2 −2 spring-webmvc/src/main/java/org/springframework/web/servlet/tags/EscapeBodyTag.java
  168. +2 −3 spring-webmvc/src/main/java/org/springframework/web/servlet/tags/MessageTag.java
  169. +15 −13 spring-webmvc/src/main/java/org/springframework/web/servlet/tags/Param.java
  170. +2 −2 spring-webmvc/src/main/java/org/springframework/web/servlet/tags/UrlTag.java
  171. +2 −2 spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/ButtonTag.java
  172. +2 −4 spring-webmvc/src/main/java/org/springframework/web/servlet/view/AbstractUrlBasedView.java
  173. +19 −19 spring-webmvc/src/main/java/org/springframework/web/servlet/view/AbstractView.java
  174. +10 −10 spring-webmvc/src/main/java/org/springframework/web/servlet/view/ContentNegotiatingViewResolver.java
  175. +3 −3 spring-webmvc/src/main/java/org/springframework/web/servlet/view/freemarker/FreeMarkerConfig.java
  176. +6 −5 spring-webmvc/src/main/java/org/springframework/web/servlet/view/freemarker/FreeMarkerView.java
  177. +2 −2 spring-webmvc/src/main/java/org/springframework/web/servlet/view/groovy/GroovyMarkupConfigurer.java
  178. +1 −1 spring-webmvc/src/main/java/org/springframework/web/servlet/view/script/ScriptTemplateView.java
  179. +4 −4 spring-websocket/src/main/java/org/springframework/web/socket/adapter/NativeWebSocketSession.java
  180. +5 −3 spring-websocket/src/main/java/org/springframework/web/socket/client/WebSocketConnectionManager.java
  181. +2 −3 spring-websocket/src/main/java/org/springframework/web/socket/client/jetty/JettyWebSocketClient.java
  182. +3 −3 ...ng-websocket/src/main/java/org/springframework/web/socket/config/WebSocketMessageBrokerStats.java
  183. +6 −7 ...ket/src/main/java/org/springframework/web/socket/config/annotation/SockJsServiceRegistration.java
  184. +9 −20 ...va/org/springframework/web/socket/config/annotation/WebMvcStompWebSocketEndpointRegistration.java
  185. +2 −2 .../org/springframework/web/socket/config/annotation/WebSocketMessageBrokerConfigurationSupport.java
  186. +1 −3 spring-websocket/src/main/java/org/springframework/web/socket/messaging/SessionSubscribeEvent.java
  187. +1 −3 spring-websocket/src/main/java/org/springframework/web/socket/messaging/SessionUnsubscribeEvent.java
  188. +6 −6 ...c/main/java/org/springframework/web/socket/messaging/WebSocketAnnotationMethodMessageHandler.java
  189. +2 −2 ...c/main/java/org/springframework/web/socket/server/standard/ServletServerContainerFactoryBean.java
  190. +8 −4 ...ocket/src/main/java/org/springframework/web/socket/sockjs/client/AbstractClientSockJsSession.java
  191. +1 −1 ...websocket/src/main/java/org/springframework/web/socket/sockjs/client/DefaultTransportRequest.java
  192. +2 −8 ...cket/src/main/java/org/springframework/web/socket/sockjs/client/WebSocketClientSockJsSession.java
  193. +2 −2 .../src/main/java/org/springframework/web/socket/sockjs/transport/session/AbstractSockJsSession.java
  194. +8 −4 ...in/java/org/springframework/web/socket/sockjs/transport/session/WebSocketServerSockJsSession.java
@@ -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.
@@ -34,19 +34,17 @@

/**
* 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
*/
@@ -55,14 +53,15 @@
/**
* 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
*/
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
*/
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 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.
@@ -103,8 +103,8 @@ public static JoinPoint currentJoinPoint() {
private final AspectInstanceFactory aspectInstanceFactory;

/**
* The name of the aspect (ref bean) in which this advice was defined (used
* when determining advice precedence so that we can determine
* The name of the aspect (ref bean) in which this advice was defined
* (used when determining advice precedence so that we can determine
* whether two pieces of advice come from the same aspect).
*/
private String aspectName;
@@ -118,13 +118,13 @@ public static JoinPoint currentJoinPoint() {
* This will be non-null if the creator of this advice object knows the argument names
* and sets them explicitly
*/
private String[] argumentNames = null;
private String[] argumentNames;

/** Non-null if after throwing advice binds the thrown value */
private String throwingName = null;
private String throwingName;

/** Non-null if after returning advice binds the return value */
private String returningName = null;
private String returningName;

private Class<?> discoveredReturningType = Object.class;

@@ -295,8 +295,8 @@ protected void setReturningNameNoCheck(String name) {
}
catch (Throwable ex) {
throw new IllegalArgumentException("Returning name '" + name +
"' is neither a valid argument name nor the fully-qualified name of a Java type on the classpath. " +
"Root cause: " + ex);
"' is neither a valid argument name nor the fully-qualified " +
"name of a Java type on the classpath. Root cause: " + ex);
}
}
}
@@ -329,8 +329,8 @@ protected void setThrowingNameNoCheck(String name) {
}
catch (Throwable ex) {
throw new IllegalArgumentException("Throwing name '" + name +
"' is neither a valid argument name nor the fully-qualified name of a Java type on the classpath. " +
"Root cause: " + ex);
"' is neither a valid argument name nor the fully-qualified " +
"name of a Java type on the classpath. Root cause: " + ex);
}
}
}
@@ -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.
@@ -113,6 +113,7 @@
* returning {@code null} in the case that the parameter names cannot be discovered.
*
* @author Adrian Colyer
* @author Juergen Hoeller
* @since 2.0
*/
public class AspectJAdviceParameterNameDiscoverer implements ParameterNameDiscoverer {
@@ -154,23 +155,17 @@
}


/** The pointcut expression associated with the advice, as a simple String */
private String pointcutExpression;

private boolean raiseExceptions;

/**
* If the advice is afterReturning, and binds the return value, this is the parameter name used.
*/
/** If the advice is afterReturning, and binds the return value, this is the parameter name used */
private String returningName;

/**
* If the advice is afterThrowing, and binds the thrown value, this is the parameter name used.
*/
/** If the advice is afterThrowing, and binds the thrown value, this is the parameter name used */
private String throwingName;

/**
* The pointcut expression associated with the advice, as a simple String.
*/
private String pointcutExpression;

private Class<?>[] argumentTypes;

private String[] parameterNameBindings;
@@ -186,6 +181,7 @@ public AspectJAdviceParameterNameDiscoverer(String pointcutExpression) {
this.pointcutExpression = pointcutExpression;
}


/**
* Indicate whether {@link IllegalArgumentException} and {@link AmbiguousBindingException}
* must be thrown as appropriate in the case of failing to deduce advice parameter names.
@@ -213,6 +209,7 @@ public void setThrowingName(String throwingName) {
this.throwingName = throwingName;
}


/**
* Deduce the parameter names for an advice method.
* <p>See the {@link AspectJAdviceParameterNameDiscoverer class level javadoc}
@@ -474,7 +471,7 @@ else if (numAnnotationSlots == 1) {
* If the token starts meets Java identifier conventions, it's in.
*/
private String maybeExtractVariableName(String candidateToken) {
if (candidateToken == null || candidateToken.equals("")) {
if (!StringUtils.hasLength(candidateToken)) {
return null;
}
if (Character.isJavaIdentifierStart(candidateToken.charAt(0)) &&
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 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.
@@ -454,10 +454,7 @@ protected Object createProxy(
}

Advisor[] advisors = buildAdvisors(beanName, specificInterceptors);
for (Advisor advisor : advisors) {
proxyFactory.addAdvisor(advisor);
}

proxyFactory.addAdvisors(advisors);
proxyFactory.setTargetSource(targetSource);
customizeProxyFactory(proxyFactory);

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 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.
@@ -22,7 +22,6 @@
import org.springframework.aop.MethodMatcher;
import org.springframework.aop.Pointcut;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;

/**
* Convenient class for building up pointcuts. All methods return
@@ -188,21 +187,14 @@ public boolean equals(Object other) {
if (!(other instanceof ComposablePointcut)) {
return false;
}
ComposablePointcut that = (ComposablePointcut) other;
return ObjectUtils.nullSafeEquals(that.classFilter, this.classFilter) &&
ObjectUtils.nullSafeEquals(that.methodMatcher, this.methodMatcher);
ComposablePointcut otherPointcut = (ComposablePointcut) other;
return (this.classFilter.equals(otherPointcut.classFilter) &&
this.methodMatcher.equals(otherPointcut.methodMatcher));
}

@Override
public int hashCode() {
int code = 17;
if (this.classFilter != null) {
code = 37 * code + this.classFilter.hashCode();
}
if (this.methodMatcher != null) {
code = 37 * code + this.methodMatcher.hashCode();
}
return code;
return this.classFilter.hashCode() * 37 + this.methodMatcher.hashCode();
}

@Override
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 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.
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 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.
@@ -22,7 +22,6 @@
import org.springframework.aop.MethodMatcher;
import org.springframework.aop.Pointcut;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;

/**
* Simple Pointcut that looks for a specific Java 5 annotation
@@ -46,16 +45,15 @@
* @param classAnnotationType the annotation type to look for at the class level
*/
public AnnotationMatchingPointcut(Class<? extends Annotation> classAnnotationType) {
this.classFilter = new AnnotationClassFilter(classAnnotationType);
this.methodMatcher = MethodMatcher.TRUE;
this(classAnnotationType, false);
}

/**
* Create a new AnnotationMatchingPointcut for the given annotation type.
* @param classAnnotationType the annotation type to look for at the class level
* @param checkInherited whether to explicitly check the superclasses and
* interfaces for the annotation type as well (even if the annotation type
* is not marked as inherited itself)
* @param checkInherited whether to also check the superclasses and interfaces
* as well as meta-annotations for the annotation type
* @see AnnotationClassFilter#AnnotationClassFilter(Class, boolean)
*/
public AnnotationMatchingPointcut(Class<? extends Annotation> classAnnotationType, boolean checkInherited) {
this.classFilter = new AnnotationClassFilter(classAnnotationType, checkInherited);
@@ -109,21 +107,14 @@ public boolean equals(Object other) {
if (!(other instanceof AnnotationMatchingPointcut)) {
return false;
}
AnnotationMatchingPointcut that = (AnnotationMatchingPointcut) other;
return ObjectUtils.nullSafeEquals(that.classFilter, this.classFilter) &&
ObjectUtils.nullSafeEquals(that.methodMatcher, this.methodMatcher);
AnnotationMatchingPointcut otherPointcut = (AnnotationMatchingPointcut) other;
return (this.classFilter.equals(otherPointcut.classFilter) &&
this.methodMatcher.equals(otherPointcut.methodMatcher));
}

@Override
public int hashCode() {
int code = 17;
if (this.classFilter != null) {
code = 37 * code + this.classFilter.hashCode();
}
if (this.methodMatcher != null) {
code = 37 * code + this.methodMatcher.hashCode();
}
return code;
return this.classFilter.hashCode() * 37 + this.methodMatcher.hashCode();
}

@Override
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 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.
@@ -81,8 +81,6 @@
* (may be a nested path and/or an indexed/mapped property)
* @return the property type for the particular property,
* or {@code null} if not determinable
* @throws InvalidPropertyException if there is no such property or
* if the property isn't readable
* @throws PropertyAccessException if the property was valid but the
* accessor method failed
*/
@@ -95,8 +93,8 @@
* (may be a nested path and/or an indexed/mapped property)
* @return the property type for the particular property,
* or {@code null} if not determinable
* @throws InvalidPropertyException if there is no such property or
* if the property isn't readable
* @throws PropertyAccessException if the property was valid but the
* accessor method failed
*/
TypeDescriptor getPropertyTypeDescriptor(String propertyName) throws BeansException;

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 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.
@@ -158,6 +158,22 @@
*/
<T> T getBean(String name, Class<T> requiredType) throws BeansException;

/**
* Return an instance, which may be shared or independent, of the specified bean.
* <p>Allows for specifying explicit constructor arguments / factory method arguments,
* overriding the specified default arguments (if any) in the bean definition.
* @param name the name of the bean to retrieve
* @param args arguments to use when creating a bean instance using explicit arguments
* (only applied when creating a new instance as opposed to retrieving an existing one)
* @return an instance of the bean
* @throws NoSuchBeanDefinitionException if there is no such bean definition
* @throws BeanDefinitionStoreException if arguments have been given but
* the affected bean isn't a prototype
* @throws BeansException if the bean could not be created
* @since 2.5
*/
Object getBean(String name, Object... args) throws BeansException;

/**
* Return the bean instance that uniquely matches the given object type, if any.
* <p>This method goes into {@link ListableBeanFactory} by-type lookup territory
@@ -175,22 +191,6 @@
*/
<T> T getBean(Class<T> requiredType) throws BeansException;

/**
* Return an instance, which may be shared or independent, of the specified bean.
* <p>Allows for specifying explicit constructor arguments / factory method arguments,
* overriding the specified default arguments (if any) in the bean definition.
* @param name the name of the bean to retrieve
* @param args arguments to use when creating a bean instance using explicit arguments
* (only applied when creating a new instance as opposed to retrieving an existing one)
* @return an instance of the bean
* @throws NoSuchBeanDefinitionException if there is no such bean definition
* @throws BeanDefinitionStoreException if arguments have been given but
* the affected bean isn't a prototype
* @throws BeansException if the bean could not be created
* @since 2.5
*/
Object getBean(String name, Object... args) throws BeansException;

/**
* Return an instance, which may be shared or independent, of the specified bean.
* <p>Allows for specifying explicit constructor arguments / factory method arguments,

0 comments on commit 9fdc440

Please sign in to comment.
You can’t perform that action at this time.