if (url == null) url = getClass().getResource(javaProfile);
if (url == null) {  ClassLoader loader=getClass().getClassLoader(); url = loader==null ? ClassLoader.getSystemResource(javaProfile) : loader.getResource(javaProfile); }
	private Properties findVMProfile() {		Properties result = new Properties();		// Find the VM profile name using J2ME properties		String j2meConfig = properties.getProperty(Constants.J2ME_MICROEDITION_CONFIGURATION);		String j2meProfiles = properties.getProperty(Constants.J2ME_MICROEDITION_PROFILES);		String vmProfile = null;		if (j2meConfig != null && j2meConfig.length() > 0 && j2meProfiles != null && j2meProfiles.length() > 0) {			// save the vmProfile based off of the config and profile			// use the last profile; assuming that is the highest one			String[] j2meProfileList = ManifestElement.getArrayFromList(j2meProfiles, " "); //$NON-NLS-1$			if (j2meProfileList != null && j2meProfileList.length > 0)				vmProfile = j2meConfig + '_' + j2meProfileList[j2meProfileList.length - 1];		} else {			// No J2ME properties; use J2SE properties			// Note that the CDC spec appears not to require VM implementations to set the			// javax.microedition properties!!  So we will try to fall back to the 			// java.specification.name property, but this is pretty ridiculous!!			String javaSpecVersion = properties.getProperty("java.specification.version"); //$NON-NLS-1$			// set the profile and EE based off of the java.specification.version			// TODO We assume J2ME Foundation and J2SE here.  need to support other profiles J2EE ...			if (javaSpecVersion != null) {				StringTokenizer st = new StringTokenizer(javaSpecVersion, " _-"); //$NON-NLS-1$				javaSpecVersion = st.nextToken();				String javaSpecName = properties.getProperty("java.specification.name"); //$NON-NLS-1$				if ("J2ME Foundation Specification".equals(javaSpecName)) //$NON-NLS-1$					vmProfile = "CDC-" + javaSpecVersion + "_Foundation-" + javaSpecVersion; //$NON-NLS-1$ //$NON-NLS-2$				else					vmProfile = "J2SE-" + javaSpecVersion; //$NON-NLS-1$			}		}		URL url = null;		// check for the java profile property for a url		String propJavaProfile = System.getProperty(Constants.OSGI_JAVA_PROFILE);		if (propJavaProfile != null)			try {				// we assume a URL				url = new URL(propJavaProfile);			} catch (MalformedURLException e1) {				// TODO consider logging ...			}		if (url == null && vmProfile != null) {			// look for a profile in the system bundle based on the vm profile			String javaProfile = vmProfile + ".profile"; //$NON-NLS-1$			url = systemBundle.getEntry(javaProfile);			if (url == null)				url = getClass().getResource(javaProfile);		}		if (url != null) {			InputStream in = null;			try {				in = url.openStream();				result.load(new BufferedInputStream(in));			} catch (IOException e) {				// TODO consider logging ...			} finally {				if (in != null)					try {						in.close();					} catch (IOException ee) {						// do nothing					}			}		}		// set the profile name if it does not provide one		if (result.getProperty(Constants.OSGI_JAVA_PROFILE_NAME) == null)			if (vmProfile != null)				result.put(Constants.OSGI_JAVA_PROFILE_NAME, vmProfile.replace('_', '/'));			else				// last resort; default to the absolute minimum profile name				result.put(Constants.OSGI_JAVA_PROFILE_NAME, "OSGi/Minimum-1.0"); //$NON-NLS-1$		return result;	}