History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: PSL-269
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Jens Halm
Reporter: Ben London
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Parsley Core

DefaultContext - getAllObjectsByType returns an array of definitions instead of an array of objects

Created: 04/Oct/09 01:54 PM   Updated: 09/Jun/10 09:10 AM
Component/s: Core IOC Container
Affects Version/s: 2.0.0, 2.0.1
Fix Version/s: 2.1.0


 Description  « Hide
The function getAllObjectsByType in org.spicefactory.parsley.core.context.impl.DefaultContext returns the incorrect array. The method reads:

public function getAllObjectsByType (type:Class) : Array {
                checkState();
                var defs:Array = _registry.getAllDefinitionsByType(type);
                var objects:Array = new Array();
                for each (var def:RootObjectDefinition in defs) {
                        objects.push(getInstance(def));
                }
                return defs;
        }

But should in fact be:

public function getAllObjectsByType (type:Class) : Array {
                checkState();
                var defs:Array = _registry.getAllDefinitionsByType(type);
                var objects:Array = new Array();
                for each (var def:RootObjectDefinition in defs) {
                        objects.push(getInstance(def));
                }
                return objects;
        }

The function correctly builds up and array of objects from the definitions but the returns the definitions instead of the objects.

 All   Comments   Change History      Sort Order:
There are no comments yet on this issue.