if (baseSpec.startsWith(FILE_SCHEME)) baseURL = new File(baseSpec.substring(5)).toURL(); else
if (baseSpec.startsWith(FILE_SCHEME)) { File child = new File(baseSpec.substring(5)); baseURL = child.isAbsolute() ? child.toURL() : new File(parent, child.getPath()).toURL(); } else
	private static URL searchForBundle(String name, String parent) throws MalformedURLException {		URL url = null;		File fileLocation = null;		boolean reference = false;		try {			url = new URL(name);		} catch (MalformedURLException e) {			// TODO this is legacy support for non-URL names.  It should be removed eventually.			// if name was not a URL then construct one.  			// Assume it should be a reference and htat it is relative.  This support need not 			// be robust as it is temporary..			fileLocation = new File(parent, name);			url = new URL(REFERENCE_PROTOCOL, null, FILE_SCHEME + fileLocation.toString());			reference = true;		}		// if the name was a URL then see if it is relative.  If so, insert syspath.		if (!reference) {			URL baseURL = url;			// if it is a reference URL then strip off the reference: and set base to the file:...			if (url.getProtocol().equals(REFERENCE_PROTOCOL)) {				reference = true;				String baseSpec = url.getFile();				if (baseSpec.startsWith(FILE_SCHEME))					baseURL = new File(baseSpec.substring(5)).toURL();				else					baseURL = new URL(baseSpec);			}			fileLocation = new File(baseURL.getFile());			// if the location is relative, prefix it with the parent			if (!fileLocation.isAbsolute())				fileLocation = new File(parent, fileLocation.toString());		}		// If the result is a reference then search for the real result and 		// reconstruct the answer.		if (reference) {			String result = searchFor(fileLocation.getName(), new File(fileLocation.getParent()).getAbsolutePath());			if (result != null)				url = new URL(REFERENCE_PROTOCOL, null, FILE_SCHEME + result);			else				return null;		}		// finally we have something worth trying			try {			URLConnection result = url.openConnection();			result.connect();			return url;		} catch (IOException e) {			//			int i = location.lastIndexOf('_');			//			return i == -1? location : location.substring(0, i);			return null;		}	}