|
@@ -34,13 +34,22 @@ final class ImplicitPropertyAccessor extends ReadOnlyGenericPropertyAccessor {
|
34
|
34
|
private static final ConcurrentHashMap<String, MethodExecutor> CACHE =
|
35
|
35
|
new ConcurrentHashMap<String, MethodExecutor>();
|
36
|
36
|
|
|
37
|
+ private static final MethodExecutor NULL_ME = new MethodExecutor() {
|
|
38
|
+ @Override
|
|
39
|
+ public TypedValue execute(final EvaluationContext context, final Object target,
|
|
40
|
+ final Object... arguments) throws AccessException {
|
|
41
|
+ throw new UnsupportedOperationException("This method should never be called");
|
|
42
|
+ }
|
|
43
|
+ };
|
|
44
|
+
|
|
45
|
+ @Override
|
37
|
46
|
public boolean canRead(final EvaluationContext context,
|
38
|
47
|
final Object target, final String name)
|
39
|
48
|
throws AccessException {
|
40
|
49
|
Assert.notNull(target, "target is null");
|
41
|
50
|
String cacheKey = target.getClass().getName() + "." + name;
|
42
|
51
|
if (CACHE.containsKey(cacheKey)) {
|
43
|
|
- return CACHE.get(cacheKey) != null;
|
|
52
|
+ return CACHE.get(cacheKey) != NULL_ME;
|
44
|
53
|
}
|
45
|
54
|
|
46
|
55
|
for (MethodResolver mr : context.getMethodResolvers()) {
|
|
@@ -52,10 +61,11 @@ final class ImplicitPropertyAccessor extends ReadOnlyGenericPropertyAccessor {
|
52
|
61
|
}
|
53
|
62
|
}
|
54
|
63
|
|
55
|
|
- CACHE.putIfAbsent(cacheKey, null);
|
|
64
|
+ CACHE.putIfAbsent(cacheKey, NULL_ME);
|
56
|
65
|
return false;
|
57
|
66
|
}
|
58
|
67
|
|
|
68
|
+ @Override
|
59
|
69
|
public TypedValue read(final EvaluationContext context,
|
60
|
70
|
final Object target, final String name)
|
61
|
71
|
throws AccessException {
|