Finds the named resource bundle for the specified base name and control.

@param baseName
the base name of a resource bundle
@param control
the control that control the access sequence
@return the named resource bundle

@since 1.6
356984
public static ResourceBundle getBundle(String baseName, ResourceBundle.Control control) {
        return getBundle(baseName, Locale.getDefault(), getLoader(), control);
    }
1317377
@Override
	public Reader getResource(JoinableResourceBundle bundle, String resourceName, boolean processingBundle) {

		Reader rd = null;
		if (!resourceName.contains(":")) {
			InputStream is = context.getResourceAsStream(resourceName);
			if (is != null) {
				rd = new InputStreamReader(is, charset);
			}
		}
		return rd;
	}
17880
@Override
	public ResourceBundlePathsIterator getGlobalResourceBundlePaths(String bundleId,
			ConditionalCommentCallbackHandler commentCallbackHandler, Map<String, String> variants) {

		List<JoinableResourceBundle> currentBundles = new ArrayList<>();
		for (JoinableResourceBundle bundle : globalBundles) {
			if (bundle.getId().equals(bundleId)) {
				currentBundles.add(bundle);
				break;
			}
		}
		return getBundleIterator(getDebugMode(), currentBundles, commentCallbackHandler, variants);
	}
675977
protected Enumeration<ResourceHandle> getResourceHandles(final String name)
    {
        return AccessController.doPrivileged(new PrivilegedAction<Enumeration<ResourceHandle>>()
        {
            @Override
            public Enumeration<ResourceHandle> run()
            {
                return URIClassLoader.this.finder.getResources(name);
            }
        }, this.acc);
    }
579019
public EditableResourceBundle getResourceBundle(Locale locale) {
		EditableResourceBundle localeBundle = bundles.get(locale);
		if(localeBundle==null) {
			ResourceBundle resourceBundle = ResourceBundle.getBundle(baseName, locale);
			if(!resourceBundle.getLocale().equals(locale)) throw new AssertionError("ResourceBundle not for this locale: "+locale);
			if(!(resourceBundle instanceof EditableResourceBundle)) throw new AssertionError("ResourceBundle is not a EditableResourceBundle: "+resourceBundle);
			localeBundle = (EditableResourceBundle)resourceBundle;
			if(localeBundle.getBundleSet()!=this) throw new AssertionError("EditableResourceBundle not for this EditableResourceBundleSet: "+localeBundle);
			if(!localeBundle.getBundleLocale().equals(locale)) throw new AssertionError("EditableResourceBundle not for this locale: "+locale);
			// EditableResourceBundle will have added the bundle to the bundles map.
		}
		return localeBundle;
	}
216324
@Override
	public Reader getResource(JoinableResourceBundle bundle, String resourceName, boolean processingBundle)
			throws ResourceNotFoundException {

		return getResource(bundle, resourceName, processingBundle, new ArrayList<Class<?>>());
	}
452589
@Override
   protected URL findResource(String name) {
      if (resourceCache.containsKey(name)) {
         return resourceCache.get(name);
      }

      for (WeakReference<Bundle> ref : bundles) {
         final Bundle bundle = ref.get();
         if (bundle != null && bundle.getState() == Bundle.ACTIVE) {
            try {
               final URL resource = bundle.getResource(name);
               if (resource != null) {
                  resourceCache.put(name, resource);
                  return resource;
               }
            } catch (Exception ignore) {
            }
         }
      }

      // TODO: Error?
      return null;
   }
1252813
def __get_base_bundle_url(self):
        
        return self.__serviceAccount.get_url() + '/' + \
            self.__serviceAccount.get_instance_id() + self.__BUNDLES_PATH
207014
@Pure
	public String getBasename(String defaultName) {
		if (Strings.isEmpty(this.basename)) {
			return defaultName;
		}
		return this.basename;
	}
525482
@Override
    public ICodeBaseEntry lookupResource(String resourceName) {
        ICodeBaseEntry delegateCodeBaseEntry = delegateCodeBase.lookupResource(resourceName);
        if (delegateCodeBaseEntry == null) {
            return null;
        }
        return new DelegatingCodeBaseEntry(this, delegateCodeBaseEntry);
    }
606938
public static <T> ServiceController<T> findService(ServiceRegistry registry, ServiceName name) {
        return (ServiceController<T>) registry.getService(name);
    }
965170
private void addBundle(String baseName, Locale locale, I_CmsResourceBundle bundle) {

        CmsResourceBundleLoader.addBundleToCache(baseName, locale, bundle);
    }
880536
private ResourceBundle findBundle(String baseName) {
    ResourceBundle resourceBundle = null;

    // first try to load the resource bundle with the specified locale
    ClassLoader cl = Thread.currentThread().getContextClassLoader();
    if (null != locale) {
      try {
        resourceBundle = ResourceBundle.getBundle(baseName, locale, cl);
      } catch (Exception e) {
        log.fatal("unable to load a default bundle: "+baseName+"_"+locale);
      }
      // check that the requested main locale matches the resource bundle's,
      // since we get the system fallback locale if no match is found
      if(!resourceBundle.getLocale().equals(locale)) {
        resourceBundle = null;
      }
    }

    // loop through the fall back locales until a bundle is found
    if (null == resourceBundle) {
      if(null != fallback) {
        while(fallback.hasMoreElements()) {
          Locale testLocale = (Locale) fallback.nextElement();
          log.debug("looking up locale "+testLocale);
          ResourceBundle testBundle = ResourceBundle.getBundle(baseName, testLocale, cl);
          String language = testBundle.getLocale().getLanguage();
          String country = testBundle.getLocale().getCountry();

          if (testBundle.getLocale().equals(testLocale)) {
            resourceBundle = testBundle;
            log.debug("found bundle for locale " +baseName+"_"+ testBundle.getLocale());
            break;
          } else if (testLocale.getLanguage().equals(language)) {
            if (testLocale.getCountry().equals(country)) {
              // language and country match which is good, keep looking for variant too
              resourceBundle = testBundle;
              log.debug("potential bundle: " + baseName + "_" + testBundle.getLocale());
              continue;
            } else {
              // only accept this if there is no better previous lookup
              if (null == resourceBundle) {
                resourceBundle = testBundle;
                log.debug("potential bundle: " + baseName+"_"+testBundle.getLocale());
              }
              continue;
            }
          }
        }
      }

      // make sure the resource bundle is loaded (should not happen)
      if (null == resourceBundle) {
        resourceBundle = ResourceBundle.getBundle(baseName);
        if (null != resourceBundle) {
          log.debug("system locale bundle taken: " + baseName + "_" + resourceBundle.getLocale());
        }
      }
    }

    return resourceBundle;
  }
981652
@Override
    @SuppressWarnings("unchecked")
    protected Enumeration<URL> findResources( final String name )
        throws IOException
    {
        Enumeration<URL> resources = m_bundle.getResources( name );
        // Bundle.getResources may return null, in such case return empty enumeration
        if( resources == null )
        {
            return EMPTY_URL_ENUMERATION;
        }
        else
        {
            return resources;
        }
    }
347499
public List<JoinableResourceBundle> getResourceBundles(Properties properties) {

		PropertiesConfigHelper props = new PropertiesConfigHelper(properties, resourceType);
		String fileExtension = "." + resourceType;

		// Initialize custom bundles
		List<JoinableResourceBundle> customBundles = new ArrayList<>();
		// Check if we should use the bundle names property or
		// find the bundle name using the bundle id declaration :
		// jawr.<type>.bundle.<name>.id
		if (null != props.getProperty(PropertiesBundleConstant.BUNDLE_FACTORY_CUSTOM_NAMES)) {
			StringTokenizer tk = new StringTokenizer(
					props.getProperty(PropertiesBundleConstant.BUNDLE_FACTORY_CUSTOM_NAMES), ",");
			while (tk.hasMoreTokens()) {
				customBundles
						.add(buildJoinableResourceBundle(props, tk.nextToken().trim(), fileExtension, rsReaderHandler));
			}
		} else {
			Iterator<String> bundleNames = props.getPropertyBundleNameSet().iterator();
			while (bundleNames.hasNext()) {
				customBundles
						.add(buildJoinableResourceBundle(props, bundleNames.next(), fileExtension, rsReaderHandler));
			}
		}

		// Initialize the bundles dependencies
		Iterator<String> bundleNames = props.getPropertyBundleNameSet().iterator();
		while (bundleNames.hasNext()) {
			String bundleName = (String) bundleNames.next();
			List<String> bundleNameDependencies = props.getCustomBundlePropertyAsList(bundleName,
					PropertiesBundleConstant.BUNDLE_FACTORY_CUSTOM_DEPENDENCIES);
			if (!bundleNameDependencies.isEmpty()) {
				JoinableResourceBundle bundle = getBundleFromName(bundleName, customBundles);
				List<JoinableResourceBundle> bundleDependencies = getBundlesFromName(bundleNameDependencies,
						customBundles);
				bundle.setDependencies(bundleDependencies);
			}
		}

		return customBundles;
	}
534264
public List<String> getCustomBundlePropertyAsList(String bundleName, String key) {
		List<String> propertiesList = new ArrayList<>();
		StringTokenizer tk = new StringTokenizer(getCustomBundleProperty(bundleName, key, ""), ",");
		while (tk.hasMoreTokens())
			propertiesList.add(tk.nextToken().trim());
		return propertiesList;
	}
539153
public Bundle getBundle(String symbolicName) {
		final String sourceMethod = "getBundle"; //$NON-NLS-1$
		boolean isTraceLogging = log.isLoggable(Level.FINER);
		if (isTraceLogging) {
			log.entering(FrameworkWiringBundleResolver.class.getName(), sourceMethod, new Object[]{symbolicName});
		}
		Bundle[] candidates = Platform.getBundles(symbolicName, null);
		if (isTraceLogging) {
			log.finer("candidate bundles = " + Arrays.toString(candidates)); //$NON-NLS-1$
		}
		if (candidates == null || candidates.length == 0) {
			if (isTraceLogging) {
				log.exiting(FrameworkWiringBundleResolver.class.getName(), sourceMethod, null);
			}
			return null;
		}
		if (candidates.length == 1) {
			// Only one choice, so return it
			if (isTraceLogging) {
				log.exiting(FrameworkWiringBundleResolver.class.getName(), sourceMethod, candidates[0]);
			}
			return candidates[0];
		}
		if (fw == null) {
			if (isTraceLogging) {
				log.finer("Framework wiring not available.  Returning bundle with latest version"); //$NON-NLS-1$
				log.exiting(FrameworkWiringBundleResolver.class.getName(), sourceMethod, candidates[0]);
			}
			return candidates[0];
		}
		Bundle result = null;
		// For each candidate bundle, check to see if it's wired, directly or indirectly, to the contributing bundle
		for (Bundle candidate : candidates) {
			Collection<Bundle> bundles = fw.getDependencyClosure(Arrays.asList(new Bundle[]{candidate}));
			for (Bundle bundle : bundles) {
				if (bundle.equals(contributingBundle)) {
					// found wired bundle.  Return the candidate.
					result = candidate;
					break;
				}
			}
			if (result != null) {
				break;
			}
		}
		if (result == null) {
			if (isTraceLogging) {
				log.finer("No wired bundle found amoung candidates.  Returning bundle with most recent version."); //$NON-NLS-1$
			}
			result =  candidates[0];
		}
		if (isTraceLogging) {
			log.exiting(FrameworkWiringBundleResolver.class.getName(), sourceMethod, result);
		}
		return result;
	}