try { URLStreamHandler handler = (URLStreamHandler) clazz.newInstance();  if (handler instanceof ProtocolActivator) { ((ProtocolActivator) handler).start(context, adaptor); }  return handler; } catch (Exception e) { return null; }
if (result == null && parentFactory != null) result = parentFactory.createURLStreamHandler(protocol); return result;
	public URLStreamHandler createURLStreamHandler(String protocol) {		// if parent is present do parent lookup		if (parentFactory != null) {			URLStreamHandler parentHandler = parentFactory.createURLStreamHandler(protocol);			if (parentHandler != null) {				return parentHandler;			}		}				//first check for built in handlers		String builtInHandlers = secureAction.getProperty(PROTOCOL_HANDLER_PKGS);		Class clazz = getBuiltIn(protocol, builtInHandlers);		if (clazz != null)			return null; // let the VM handle it		//internal protocol handlers		String internalHandlerPkgs = secureAction.getProperty(Constants.INTERNAL_HANDLER_PKGS);		internalHandlerPkgs = internalHandlerPkgs == null ? INTERNAL_PROTOCOL_HANDLER_PKG : internalHandlerPkgs + '|' + INTERNAL_PROTOCOL_HANDLER_PKG;		clazz = getBuiltIn(protocol, internalHandlerPkgs);		if (clazz == null) {			//Now we check the service registry			//first check to see if the handler is in the cache			URLStreamHandlerProxy handler = (URLStreamHandlerProxy) proxies.get(protocol);			if (handler != null)				return (handler);			//look through the service registry for a URLStramHandler registered for this protocol			org.osgi.framework.ServiceReference[] serviceReferences = handlerTracker.getServiceReferences();			if (serviceReferences == null)				return null;			for (int i = 0; i < serviceReferences.length; i++) {				Object prop = serviceReferences[i].getProperty(URLConstants.URL_HANDLER_PROTOCOL);				if (!(prop instanceof String[]))					continue;				String[] protocols = (String[]) prop;				for (int j = 0; j < protocols.length; j++)					if (protocols[j].equals(protocol)) {						handler = new URLStreamHandlerProxy(protocol, serviceReferences[i], context);						proxies.put(protocol, handler);						return (handler);					}			}			return null;		}		// must be a built-in handler		try {			URLStreamHandler handler = (URLStreamHandler) clazz.newInstance();			if (handler instanceof ProtocolActivator) {				((ProtocolActivator) handler).start(context, adaptor);			}			return handler;		} catch (Exception e) {			return null;		}	}