if (cache_handlers) { final Class cls = (Class) ph_cache.get(protocol); if (cls != null) { try { return (URLStreamHandler) cls.newInstance(); } catch (Exception e) {  } } }
if (cache_handlers) { if ((ph = (URLStreamHandler) ph_cache.get(protocol)) != null) return ph; }
    private static synchronized URLStreamHandler getURLStreamHandler(            String protocol) {        // First, see if a protocol handler is in our cache        if (cache_handlers) {            final Class cls = (Class) ph_cache.get(protocol);            if (cls != null) {                try {                    return (URLStreamHandler) cls.newInstance();                } catch (Exception e) {                    // Do nothing                }            }        }        // Next check the factory and use that if set        if (factory != null) {            URLStreamHandler ph;            ph = factory.createURLStreamHandler(protocol);            if (ph != null) {                if (cache_handlers) {                    ph_cache.put(protocol, ph.getClass());                }                return (ph);            }        }        // Finally loop through our search path looking for a match        StringTokenizer st = new StringTokenizer(ph_search_path, "|");        while (st.hasMoreTokens()) {            String clsname = st.nextToken() + "." + protocol + ".Handler";            try {                final ClassLoader cl = Thread.currentThread()                        .getContextClassLoader();                final Class cls = cl.loadClass(clsname);                Object obj = cls.newInstance();                URLStreamHandler ph;                if (!(obj instanceof URLStreamHandler)) {                    continue;                } else {                    ph = (URLStreamHandler) obj;                }                if (cache_handlers) {                    ph_cache.put(protocol, cls);                }                return (ph);            } catch (Exception e) {                // Do nothing            }        }        // Still here, which is bad        return null;    }