protected function getObjectByClassname(/*# string */ $classname)
    {
        // mapping exists
        if (isset($this->mappings[$classname])) {
            $classname = $this->mappings[$classname];

            // is it a reference ? #changed
            if (false !== ($ref = $this->isReference($classname))) {
                $classname = $this->getReferenceValue($ref);

                // got a service object
                if (is_object($classname)) {
                    return $classname;
                }
            }
        }

        // try get service by $classname from container
        return $this->delegatedGet($classname);
    }