moved applyIndexedObject internal, now invoked inside forObject static factory method

This commit is contained in:
Keith Donald
2011-05-23 01:08:18 +00:00
parent 4d6a5849f7
commit 79f9d1cfc6
16 changed files with 77 additions and 93 deletions

View File

@@ -93,7 +93,7 @@ public class Indexer extends SpelNodeImpl {
Object possiblyConvertedKey = index;
possiblyConvertedKey = state.convertValue(index, targetObjectTypeDescriptor.getMapKeyTypeDescriptor());
Object o = ((Map<?, ?>) targetObject).get(possiblyConvertedKey);
return new TypedValue(o, targetObjectTypeDescriptor.getMapValueTypeDescriptor().applyIndexedObject(o));
return new TypedValue(o, targetObjectTypeDescriptor.getMapValueTypeDescriptor());
}
if (targetObject == null) {
@@ -105,7 +105,7 @@ public class Indexer extends SpelNodeImpl {
int idx = (Integer)state.convertValue(index, TypeDescriptor.valueOf(Integer.class));
if (targetObject.getClass().isArray()) {
Object arrayElement = accessArrayElement(targetObject, idx);
return new TypedValue(arrayElement, targetObjectTypeDescriptor.getElementTypeDescriptor().applyIndexedObject(arrayElement));
return new TypedValue(arrayElement, targetObjectTypeDescriptor.getElementTypeDescriptor());
} else if (targetObject instanceof Collection) {
Collection c = (Collection) targetObject;
if (idx >= c.size()) {
@@ -116,7 +116,7 @@ public class Indexer extends SpelNodeImpl {
int pos = 0;
for (Object o : c) {
if (pos == idx) {
return new TypedValue(o, targetObjectTypeDescriptor.getElementTypeDescriptor().applyIndexedObject(o));
return new TypedValue(o, targetObjectTypeDescriptor.getElementTypeDescriptor());
}
pos++;
}