/** * Gets a string for the given key from system properties or resource * bundle. In case when bundle is not system and property doesn't exists * function try to find it in system bundle. * * @param key the key for the desired string * @param isSystem the flag for identification of the system bundle * @return the string for the given key or null if resource is missing */ private String string(final String key, final boolean isSystem) { final String searchKey = key.replaceAll(" ", "_"); String result = System.getProperty(searchKey); if (result == null) { try { result = bundle.getString(searchKey); } catch (MissingResourceException e) { if (!isSystem) { LOG.log(Level.FINE, e.getMessage(), e.getCause()); } } } if (result == null && !isSystem) { result = get(SYSTEM_BASE_NAME).string(key, true); } return result; } }