Commits

Anonymous committed d38c0a3

XWorkMapPropertyAccessor has static instance of XWorkConverter
o removed static instance to XWorkConverter

Issue Number: XW-492

git-svn-id: http://svn.opensymphony.com/svn/xwork/branches/2.0@1411e221344d-f017-0410-9bd5-d282ab1896d7

Comments (0)

Files changed (1)

src/java/com/opensymphony/xwork2/util/XWorkMapPropertyAccessor.java

     private static final String[] INDEX_ACCESS_PROPS = new String[]
             {"size", "isEmpty", "keys", "values"};
 
-    private static final XWorkConverter _converter = XWorkConverter.getInstance();
-
     public Object getProperty(Map context, Object target, Object name) throws OgnlException {
 
         if (_log.isDebugEnabled()) {
             if (lastClass == null || lastProperty == null) {
                 return super.getProperty(context, target, name);
             }
-            Class keyClass = _converter.getObjectTypeDeterminer()
+            Class keyClass = XWorkConverter.getInstance().getObjectTypeDeterminer()
                     .getKeyClass(lastClass, lastProperty);
 
             if (keyClass == null) {
                     context.get(InstantiatingNullHandler.CREATE_NULL_OBJECTS) != null
                     &&  XWorkConverter.getInstance()
                     .getObjectTypeDeterminer().shouldCreateIfNew(lastClass,lastProperty,target,null,false)) {
-                Class valueClass = _converter.getObjectTypeDeterminer().getElementClass(lastClass, lastProperty, key);
+                Class valueClass = XWorkConverter.getInstance().getObjectTypeDeterminer().getElementClass(lastClass, lastProperty, key);
 
                 try {
                     result = ObjectFactory.getObjectFactory().buildBean(valueClass, context);
          if (lastClass == null || lastProperty == null) {
              return value;
          }
-         Class elementClass = _converter.getObjectTypeDeterminer()
+         Class elementClass = XWorkConverter.getInstance().getObjectTypeDeterminer()
                  .getElementClass(lastClass, lastProperty, null);
          if (elementClass == null) {
              return value; // nothing is specified, we assume it will be the value passed in.
          }
-         return _converter.convertValue(context, value, elementClass);
+         return XWorkConverter.getInstance().convertValue(context, value, elementClass);
 }
 
     private Object getKey(Map context, Object name) {
             // commented out the above -- it makes absolutely no sense for when setting basic maps!
             return name;
         }
-        Class keyClass = _converter.getObjectTypeDeterminer()
+        Class keyClass = XWorkConverter.getInstance().getObjectTypeDeterminer()
                 .getKeyClass(lastClass, lastProperty);
         if (keyClass == null) {
             keyClass = java.lang.String.class;
         }
 
-        return _converter.convertValue(context, name, keyClass);
+        return XWorkConverter.getInstance().convertValue(context, name, keyClass);
 
     }
 }