 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
 package com.threerings.util {
-
-import flash.system.ApplicationDomain;
 
 import flash.utils.describeType;
 import flash.utils.getQualifiedClassName;

        return (getQualifiedClassName(obj1) == getQualifiedClassName(obj2));
    }

    public static function getClass (obj :Object, appDom :ApplicationDomain = null) :Class
    {
        return getClassByName(getQualifiedClassName(obj), appDom);
    }

    public static function getClassByName (cname :String, appDom :ApplicationDomain = null) :Class
    {
        try {
            cname = cname.replace("::", ".");
            if (appDom != null) {
                try {
                    var c :Class = appDom.getDefinition(cname) as Class;
                    if (c != null) {
                        return c;
                    }
                } catch (err :Error) {
                    // fall through
                }
            }
            return (getDefinitionByName(cname) as Class);

        } catch (error :ReferenceError) {
            var log :Log = Log.getLog(ClassUtil);

     * Return a new instance that is the same class as the specified
     * object. The class must have a zero-arg constructor.
     */
    public static function newInstance (obj :Object) :Object
    {
        var clazz :Class = getClass(obj);
        return new clazz();
    }

