private boolean impliesCodeSource( CodeSource codeSource )
    {
        ProtectionDomain pd = domain != null ? domain.get() : null;
        if( pd == null )
        {
            return false; // is void - why did I have true?
        }
        // The CodeSource is not normalized, if the PD was created by a domain
        // combiner it is likely that the CodeSource will have the same referent.
        CodeSource cs = pd.getCodeSource(); // Don't normalise CodeSource.
        if( cs == codeSource )
        {
            return true; // same reference.
        }
        if( cs == null )
        {
            return false; // Null cs indicates system domain, does not imply.
        }
        // Most won't get to here, since domain combiners shouldn't duplicate CodeSource.
        // But just in case...
        // Don't use CodeSource.equals() because that causes DNS Lookup.
        Certificate[] myCerts = cs.getCertificates();
        Certificate[] hisCerts = codeSource.getCertificates();
        if( myCerts != null && !Arrays.equals( myCerts, hisCerts ) )
        {
            return false;
        }
        try
        {
            URI myLocation = cs.getLocation().toURI();
            URI hisLocation = codeSource.getLocation().toURI();
            if( myLocation.equals( hisLocation ) )
            {
                return true;
            }
        }
        catch( URISyntaxException ex )
        {
            // We only compare URL if we can't compare URI
            URL myLocation = cs.getLocation();
            URL hisLocation = codeSource.getLocation();
            // Only use string representation to compare, DNS cache poisioning
            // presents a security risk, so URL.equals isn't used.
            if( myLocation.toExternalForm().equals( hisLocation.toExternalForm() ) )
            {
                return true;
            }
        }
        return false;
    }