This is an automated email from the ASF dual-hosted git repository.

svenmeier pushed a commit to branch wicket-8.x
in repository https://gitbox.apache.org/repos/asf/wicket.git


The following commit(s) were added to refs/heads/wicket-8.x by this push:
     new ff7543a  WICKET-6631 corrected cache key
ff7543a is described below

commit ff7543a9db67afc4c927c150f00c0b5f72b05037
Author: Sven Meier <[email protected]>
AuthorDate: Wed Jan 16 15:51:03 2019 +0100

    WICKET-6631 corrected cache key
---
 .../injection/annot/AnnotProxyFieldValueFactory.java       | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git 
a/wicket-spring/src/main/java/org/apache/wicket/spring/injection/annot/AnnotProxyFieldValueFactory.java
 
b/wicket-spring/src/main/java/org/apache/wicket/spring/injection/annot/AnnotProxyFieldValueFactory.java
index 877a877..aec594b 100644
--- 
a/wicket-spring/src/main/java/org/apache/wicket/spring/injection/annot/AnnotProxyFieldValueFactory.java
+++ 
b/wicket-spring/src/main/java/org/apache/wicket/spring/injection/annot/AnnotProxyFieldValueFactory.java
@@ -190,19 +190,15 @@ public class AnnotProxyFieldValueFactory implements 
IFieldValueFactory
                if (Strings.isEmpty(name))
                {
                        Class<?> fieldType = field.getType();
-                       SimpleEntry<Class<?>, Class<?>> keyPair =
-                               new SimpleEntry<Class<?>, Class<?>>(fieldType, 
generic);
-
-                       name = beanNameCache.get(fieldType);
+                       
+                       SimpleEntry<Class<?>, Class<?>> key = new 
SimpleEntry<Class<?>, Class<?>>(fieldType, generic);
+                       name = beanNameCache.get(key);
                        if (name == null)
                        {
-                               name = 
getBeanNameOfClass(contextLocator.getSpringContext(), fieldType, 
-                                       generic, field.getName());
-
+                               name = 
getBeanNameOfClass(contextLocator.getSpringContext(), fieldType, generic, 
field.getName());
                                if (name != null)
                                {
-                                       
-                                       String tmpName = 
beanNameCache.putIfAbsent(keyPair, name);
+                                       String tmpName = 
beanNameCache.putIfAbsent(key, name);
                                        if (tmpName != null)
                                        {
                                                name = tmpName;

Reply via email to