Source:
<code>protected void processAutomationProvider(Bundle bundle) { synchronized (providerPortfolio) { for (Vendor vendor : providerPortfolio.keySet()) { if (vendor.getVendorSymbolicName().equals(bundle.getSymbolicName()) && !vendor.getVendorVersion().equals(bundle.getVersion().toString())) { List<String> portfolio = providerPortfolio.remove(vendor); if (portfolio != null && !portfolio.isEmpty()) { for (String uid : portfolio) { synchronized (providedObjectsHolder) { providedObjectsHolder.remove(uid); } } } break; } } } Enumeration<URL> urlEnum = null; try { urlEnum = bundle.findEntries(path, null, false); } catch (IllegalStateException e) { <START> logger.debug(String.format("Can't read from resource of bundle with ID {}. The bundle is uninstalled.", <END> bundle.getBundleId()), e); processAutomationProviderUninstalled(bundle); } if (urlEnum == null) { return; } Vendor vendor = new Vendor(bundle.getSymbolicName(), bundle.getVersion().toString()); while (urlEnum.hasMoreElements()) { URL url = urlEnum.nextElement(); String parserType = getParserType(url); Parser<E> parser = parsers.get(parserType); synchronized (waitingProviders) { List<URL> urlList = waitingProviders.get(bundle); if (parser != null) { if (urlList != null && urlList.remove(url) && urlList.isEmpty()) { waitingProviders.remove(bundle); } InputStreamReader reader = null; try { importData(vendor, parser, reader = new InputStreamReader(url.openStream())); } catch (IOException e) { logger.error( String.format("Can't read from resource of bundle with ID {}", bundle.getBundleId()), e); processAutomationProviderUninstalled(bundle); } finally { if (reader != null) { try { reader.close(); } catch (IOException ignore) { } } } } else if (parser == null) { if (urlList == null) { urlList = new ArrayList<URL>(); } urlList.add(url); waitingProviders.put(bundle, urlList); } } } }</code><technical_language>do String.format here? Formatting is done parameterized logging</technical_language>

Target:
protected void processAutomationProvider(Bundle bundle) { synchronized (providerPortfolio) { for (Vendor vendor : providerPortfolio.keySet()) { if (vendor.getVendorSymbolicName().equals(bundle.getSymbolicName())) { List<String> portfolio = providerPortfolio.remove(vendor); if (portfolio != null && !portfolio.isEmpty()) { for (String uid : portfolio) { synchronized (providedObjectsHolder) { providedObjectsHolder.remove(uid); } } } break; } } } Enumeration<URL> urlEnum = null; try { urlEnum = bundle.findEntries(path, null, true); } catch (IllegalStateException e) { logger.debug("Can't read from resource of bundle with ID {}. The bundle is uninstalled.", bundle.getBundleId(), e); processAutomationProviderUninstalled(bundle); } if (urlEnum == null) { return; } Vendor vendor = new Vendor(bundle.getSymbolicName(), bundle.getVersion().toString()); while (urlEnum.hasMoreElements()) { URL url = urlEnum.nextElement(); String parserType = getParserType(url); Parser<E> parser = parsers.get(parserType); synchronized (waitingProviders) { List<URL> urlList = waitingProviders.get(bundle); if (parser != null) { if (urlList != null && urlList.remove(url) && urlList.isEmpty()) { waitingProviders.remove(bundle); } InputStreamReader reader = null; try { importData(vendor, parser, reader = new InputStreamReader(url.openStream())); } catch (IOException e) { logger.error("Can't read from resource of bundle with ID {}", bundle.getBundleId(), e); processAutomationProviderUninstalled(bundle); } finally { if (reader != null) { try { reader.close(); } catch (IOException ignore) { } } } } else if (parser == null) { if (urlList == null) { urlList = new ArrayList<URL>(); } urlList.add(url); waitingProviders.put(bundle, urlList); } } } }