Number port = (Number)portObj;
if (portObj == null) { throw new SmartFrogResolutionException("Unable to locate registry port from ", c); } Number port = (Number) portObj;
    protected static int getRegistryPort(ProcessCompound c)        throws SmartFrogException, RemoteException {        Object portObj=null;        try {            if (registryPort==-1) {                portObj = (c.sfResolveHere(SmartFrogCoreKeys.SF_ROOT_LOCATOR_PORT,false));                if (portObj==null) {                    throw new SmartFrogResolutionException(                        "Unable to locate registry port from ", c);                }                Number port = (Number)portObj;                registryPort = port.intValue();            }        } catch (ClassCastException ccex){            throw new SmartFrogResolutionException(                "Wrong object for "+SmartFrogCoreKeys.SF_ROOT_LOCATOR_PORT                +": "+portObj+", "+portObj.getClass().getName()+"", ccex, c);        }        return registryPort;    }