@Override
		public ResourceBundle newBundle(String baseName, Locale locale,
				String format, ClassLoader loader, boolean reload)
				throws IOException {

			if (baseName == null || locale == null || format == null
					|| loader == null) {
				throw new NullPointerException();
			}

			if (!format.equals("xml")) {
				throw new IllegalArgumentException("format not supported ["
						+ format + "]");
			}

			final String bundleName = toBundleName(baseName, locale);
			final String resourceName = toResourceName(bundleName, format);

			InputStream is = null;
			if (reload) {
				URL url = loader.getResource(resourceName);
				if (url == null) {
					throw new IOException();
				}

				// throws IOException
				URLConnection connection = url.openConnection();
				connection.setUseCaches(false); // Disable caches to get fresh
												// data for reloading.

				// throws IOException
				is = connection.getInputStream();

			} else {
				is = loader.getResourceAsStream(resourceName);
				if (is == null) {
					throw new IOException();
				}
			}

			try {
				is = new BufferedInputStream(is);
				if (format.equals("xml")) {
					return new XMLResourceBundle(is);
				} else {
					assert false : "format not supported [" + format + "]";
					return null;
				}
			} finally {
				close(is);
			}

		}