下面列出了怎么用java.util.PropertyResourceBundle的API类实例代码及写法,或者点击链接到github查看源代码。
/**
* Utility method to find the labels that have not yet been translated from the English original to another language
* The output (in the console) are the original english lables that need to be translated and set in the destination language
* @param toLanguage The language to check against english (so far it can be ES,PT or FR)
*/
private static void printMissingTranslations(String toLanguage){
PropertyResourceBundle originalEnglishLabels = (PropertyResourceBundle) ResourceBundle.getBundle(Messages.BUNDLE_NAME, Locale.ENGLISH);
PropertyResourceBundle translatedLabels = (PropertyResourceBundle) ResourceBundle.getBundle(Messages.BUNDLE_NAME, new Locale(toLanguage));
// Go through the contents of the original English labels and try to find the translation
// If the translation is not found then print the original to console
Enumeration<String> keys = originalEnglishLabels.getKeys();
String key = null;
while( keys.hasMoreElements() ){
key = keys.nextElement();
String translatedValue = (String) translatedLabels.handleGetObject(key);
if( translatedValue == null || translatedValue.length() == 0 ){
System.out.println( key + "=" + originalEnglishLabels.getString(key) );
}
}
}
/**
* Gets a resource bundle using the specified base name and locale, and the caller's class loader.
* @param bundle the base name of the resource bundle, a fully qualified class name
* @param locale the locale for which a resource bundle is desired
* @return a resource bundle for the given base name and locale
*/
public static ResourceBundle getResourceBundle(final String bundle, final Locale locale) {
return AccessController.doPrivileged(new PrivilegedAction<ResourceBundle>() {
public ResourceBundle run() {
try {
return PropertyResourceBundle.getBundle(bundle, locale);
} catch (MissingResourceException e) {
try {
return PropertyResourceBundle.getBundle(bundle, new Locale("en", "US"));
} catch (MissingResourceException e2) {
throw new MissingResourceException(
"Could not load any resource bundle by " + bundle, bundle, "");
}
}
}
});
}
public Bug6204853() {
String srcDir = System.getProperty("test.src", ".");
try (FileInputStream fis8859_1 =
new FileInputStream(new File(srcDir, "Bug6204853.properties"));
FileInputStream fisUtf8 =
new FileInputStream(new File(srcDir, "Bug6204853_Utf8.properties"));
InputStreamReader isrUtf8 = new InputStreamReader(fisUtf8, "UTF-8"))
{
PropertyResourceBundle bundleUtf8 = new PropertyResourceBundle(isrUtf8);
PropertyResourceBundle bundle = new PropertyResourceBundle(fis8859_1);
String[] arrayUtf8 = createKeyValueArray(bundleUtf8);
String[] array = createKeyValueArray(bundle);
if (!Arrays.equals(arrayUtf8, array)) {
throw new RuntimeException("PropertyResourceBundle constructed from a UTF-8 encoded property file is not equal to the one constructed from ISO-8859-1 encoded property file.");
}
} catch (FileNotFoundException fnfe) {
throw new RuntimeException(fnfe);
} catch (IOException ioe) {
throw new RuntimeException(ioe);
}
}
public Bug6204853() {
String srcDir = System.getProperty("test.src", ".");
try (FileInputStream fis8859_1 =
new FileInputStream(new File(srcDir, "Bug6204853.properties"));
FileInputStream fisUtf8 =
new FileInputStream(new File(srcDir, "Bug6204853_Utf8.properties"));
InputStreamReader isrUtf8 = new InputStreamReader(fisUtf8, "UTF-8"))
{
PropertyResourceBundle bundleUtf8 = new PropertyResourceBundle(isrUtf8);
PropertyResourceBundle bundle = new PropertyResourceBundle(fis8859_1);
String[] arrayUtf8 = createKeyValueArray(bundleUtf8);
String[] array = createKeyValueArray(bundle);
if (!Arrays.equals(arrayUtf8, array)) {
throw new RuntimeException("PropertyResourceBundle constructed from a UTF-8 encoded property file is not equal to the one constructed from ISO-8859-1 encoded property file.");
}
} catch (FileNotFoundException fnfe) {
throw new RuntimeException(fnfe);
} catch (IOException ioe) {
throw new RuntimeException(ioe);
}
}
private final String[] createKeyValueArray(PropertyResourceBundle b) {
List<String> keyValueList = new ArrayList<String>();
StringBuilder sb = new StringBuilder();
for (String key : b.keySet()) {
sb.setLength(0);
sb.append(key);
sb.append(" = ");
sb.append(b.getString(key));
keyValueList.add(sb.toString());
}
String[] keyValueArray = keyValueList.toArray(new String[0]);
Arrays.sort(keyValueArray);
return keyValueArray;
}
@Override
public ResourceBundle newBundle(String baseName, Locale locale, String format, ClassLoader loader, boolean reload)
throws IOException {
if ("java.properties".equals(format)) {
String bundleName = toBundleName(baseName, locale);
String resourceName = toResourceName(bundleName, "properties");
InputStream stream = getInputStream(loader, resourceName, reload);
if (stream == null) {
return null;
}
try (Reader reader = new InputStreamReader(stream, charset)) {
return new PropertyResourceBundle(reader);
}
}
throw new IllegalArgumentException("unknown format: " + format);
}
private final String[] createKeyValueArray(PropertyResourceBundle b) {
List<String> keyValueList = new ArrayList<String>();
StringBuilder sb = new StringBuilder();
for (String key : b.keySet()) {
sb.setLength(0);
sb.append(key);
sb.append(" = ");
sb.append(b.getString(key));
keyValueList.add(sb.toString());
}
String[] keyValueArray = keyValueList.toArray(new String[0]);
Arrays.sort(keyValueArray);
return keyValueArray;
}
/**
* Gets a resource bundle using the specified base name and locale, and the caller's class loader.
* @param bundle the base name of the resource bundle, a fully qualified class name
* @param locale the locale for which a resource bundle is desired
* @return a resource bundle for the given base name and locale
*/
public static ResourceBundle getResourceBundle(final String bundle, final Locale locale) {
return AccessController.doPrivileged(new PrivilegedAction<ResourceBundle>() {
public ResourceBundle run() {
try {
return PropertyResourceBundle.getBundle(bundle, locale);
} catch (MissingResourceException e) {
try {
return PropertyResourceBundle.getBundle(bundle, new Locale("en", "US"));
} catch (MissingResourceException e2) {
throw new MissingResourceException(
"Could not load any resource bundle by " + bundle, bundle, "");
}
}
}
});
}
public Bug6204853() {
String srcDir = System.getProperty("test.src", ".");
try (FileInputStream fis8859_1 =
new FileInputStream(new File(srcDir, "Bug6204853.properties"));
FileInputStream fisUtf8 =
new FileInputStream(new File(srcDir, "Bug6204853_Utf8.properties"));
InputStreamReader isrUtf8 = new InputStreamReader(fisUtf8, "UTF-8"))
{
PropertyResourceBundle bundleUtf8 = new PropertyResourceBundle(isrUtf8);
PropertyResourceBundle bundle = new PropertyResourceBundle(fis8859_1);
String[] arrayUtf8 = createKeyValueArray(bundleUtf8);
String[] array = createKeyValueArray(bundle);
if (!Arrays.equals(arrayUtf8, array)) {
throw new RuntimeException("PropertyResourceBundle constructed from a UTF-8 encoded property file is not equal to the one constructed from ISO-8859-1 encoded property file.");
}
} catch (FileNotFoundException fnfe) {
throw new RuntimeException(fnfe);
} catch (IOException ioe) {
throw new RuntimeException(ioe);
}
}
private final String[] createKeyValueArray(PropertyResourceBundle b) {
List<String> keyValueList = new ArrayList<String>();
StringBuilder sb = new StringBuilder();
for (String key : b.keySet()) {
sb.setLength(0);
sb.append(key);
sb.append(" = ");
sb.append(b.getString(key));
keyValueList.add(sb.toString());
}
String[] keyValueArray = keyValueList.toArray(new String[0]);
Arrays.sort(keyValueArray);
return keyValueArray;
}
public Bug6204853() {
String srcDir = System.getProperty("test.src", ".");
try (FileInputStream fis8859_1 =
new FileInputStream(new File(srcDir, "Bug6204853.properties"));
FileInputStream fisUtf8 =
new FileInputStream(new File(srcDir, "Bug6204853_Utf8.properties"));
InputStreamReader isrUtf8 = new InputStreamReader(fisUtf8, "UTF-8"))
{
PropertyResourceBundle bundleUtf8 = new PropertyResourceBundle(isrUtf8);
PropertyResourceBundle bundle = new PropertyResourceBundle(fis8859_1);
String[] arrayUtf8 = createKeyValueArray(bundleUtf8);
String[] array = createKeyValueArray(bundle);
if (!Arrays.equals(arrayUtf8, array)) {
throw new RuntimeException("PropertyResourceBundle constructed from a UTF-8 encoded property file is not equal to the one constructed from ISO-8859-1 encoded property file.");
}
} catch (FileNotFoundException fnfe) {
throw new RuntimeException(fnfe);
} catch (IOException ioe) {
throw new RuntimeException(ioe);
}
}
private final String[] createKeyValueArray(PropertyResourceBundle b) {
List<String> keyValueList = new ArrayList<String>();
StringBuilder sb = new StringBuilder();
for (String key : b.keySet()) {
sb.setLength(0);
sb.append(key);
sb.append(" = ");
sb.append(b.getString(key));
keyValueList.add(sb.toString());
}
String[] keyValueArray = keyValueList.toArray(new String[0]);
Arrays.sort(keyValueArray);
return keyValueArray;
}
/**
* Gets a resource bundle using the specified base name and locale, and the caller's class loader.
* @param bundle the base name of the resource bundle, a fully qualified class name
* @param locale the locale for which a resource bundle is desired
* @return a resource bundle for the given base name and locale
*/
public static ResourceBundle getResourceBundle(final String bundle, final Locale locale) {
return AccessController.doPrivileged(new PrivilegedAction<ResourceBundle>() {
public ResourceBundle run() {
try {
return PropertyResourceBundle.getBundle(bundle, locale);
} catch (MissingResourceException e) {
try {
return PropertyResourceBundle.getBundle(bundle, new Locale("en", "US"));
} catch (MissingResourceException e2) {
throw new MissingResourceException(
"Could not load any resource bundle by " + bundle, bundle, "");
}
}
}
});
}
/**
* Gets a resource bundle using the specified base name and locale, and the caller's class loader.
* @param bundle the base name of the resource bundle, a fully qualified class name
* @param locale the locale for which a resource bundle is desired
* @return a resource bundle for the given base name and locale
*/
public static ResourceBundle getResourceBundle(final String bundle, final Locale locale) {
return AccessController.doPrivileged(new PrivilegedAction<ResourceBundle>() {
public ResourceBundle run() {
try {
return PropertyResourceBundle.getBundle(bundle, locale);
} catch (MissingResourceException e) {
try {
return PropertyResourceBundle.getBundle(bundle, new Locale("en", "US"));
} catch (MissingResourceException e2) {
throw new MissingResourceException(
"Could not load any resource bundle by " + bundle, bundle, "");
}
}
}
});
}
@Override
public P2Attributes getAttributesFromBlob(final TempBlob tempBlob, final String extension)
throws IOException, AttributeParsingException
{
Builder p2AttributesBuilder = P2Attributes.builder();
Optional<Document> featureXmlOpt = documentJarExtractor.getSpecificEntity(tempBlob, extension, XML_FILE_NAME);
Optional<PropertyResourceBundle> propertiesOpt =
propertyParser.getBundleProperties(tempBlob, extension, FEATURE_PROPERTIES);
if (featureXmlOpt.isPresent()) {
Document document = featureXmlOpt.get();
String pluginId = extractValueFromDocument(XML_PLUGIN_NAME_PATH, document);
if (pluginId == null) {
pluginId = extractValueFromDocument(XML_PLUGIN_ID_PATH, document);
}
String componentName = normalizeComponentName(propertyParser.extractValueFromProperty(pluginId, propertiesOpt));
p2AttributesBuilder
.componentName(componentName)
.pluginName(
propertyParser.extractValueFromProperty(extractValueFromDocument(XML_NAME_PATH, document), propertiesOpt))
.componentVersion(extractValueFromDocument(XML_VERSION_PATH, document));
}
return p2AttributesBuilder.build();
}
@Override
public P2Attributes getAttributesFromBlob(final TempBlob tempBlob, final String extension)
throws IOException, AttributeParsingException
{
Builder p2AttributesBuilder = P2Attributes.builder();
Optional<Manifest> manifestJarEntity =
manifestJarExtractor.getSpecificEntity(tempBlob, extension, MANIFEST_FILE_PREFIX);
if (manifestJarEntity.isPresent()) {
Attributes mainManifestAttributes = manifestJarEntity.get().getMainAttributes();
String bundleLocalizationValue = mainManifestAttributes.getValue("Bundle-Localization");
Optional<PropertyResourceBundle> propertiesOpt =
propertyParser.getBundleProperties(tempBlob, extension,
bundleLocalizationValue == null ? BUNDLE_PROPERTIES : bundleLocalizationValue);
p2AttributesBuilder
.componentName(normalizeName(propertyParser
.extractValueFromProperty(mainManifestAttributes.getValue("Bundle-SymbolicName"), propertiesOpt)))
.pluginName(
propertyParser.extractValueFromProperty(mainManifestAttributes.getValue("Bundle-Name"), propertiesOpt))
.componentVersion(
propertyParser
.extractValueFromProperty(mainManifestAttributes.getValue("Bundle-Version"), propertiesOpt));
}
return p2AttributesBuilder.build();
}
/**
* Gets the property resolver for this configuration type used to expand property values within
* the checkstyle configuration.
*
* @param checkConfiguration
* the actual check configuration
* @return the property resolver
* @throws IOException
* error creating the property resolver
* @throws URISyntaxException
* if configuration file URL cannot be resolved
*/
protected PropertyResolver getPropertyResolver(ICheckConfiguration config,
CheckstyleConfigurationFile configFile) throws IOException, URISyntaxException {
MultiPropertyResolver multiResolver = new MultiPropertyResolver();
multiResolver.addPropertyResolver(new ResolvablePropertyResolver(config));
File f = URIUtil.toFile(configFile.getResolvedConfigFileURL().toURI());
if (f != null) {
multiResolver.addPropertyResolver(new StandardPropertyResolver(f.toString()));
} else {
multiResolver.addPropertyResolver(
new StandardPropertyResolver(configFile.getResolvedConfigFileURL().toString()));
}
multiResolver.addPropertyResolver(new ClasspathVariableResolver());
multiResolver.addPropertyResolver(new SystemPropertyResolver());
if (configFile.getAdditionalPropertiesBundleStream() != null) {
ResourceBundle bundle = new PropertyResourceBundle(
configFile.getAdditionalPropertiesBundleStream());
multiResolver.addPropertyResolver(new ResourceBundlePropertyResolver(bundle));
}
return multiResolver;
}
public Bug6204853() {
String srcDir = System.getProperty("test.src", ".");
try (FileInputStream fis8859_1 =
new FileInputStream(new File(srcDir, "Bug6204853.properties"));
FileInputStream fisUtf8 =
new FileInputStream(new File(srcDir, "Bug6204853_Utf8.properties"));
InputStreamReader isrUtf8 = new InputStreamReader(fisUtf8, "UTF-8"))
{
PropertyResourceBundle bundleUtf8 = new PropertyResourceBundle(isrUtf8);
PropertyResourceBundle bundle = new PropertyResourceBundle(fis8859_1);
String[] arrayUtf8 = createKeyValueArray(bundleUtf8);
String[] array = createKeyValueArray(bundle);
if (!Arrays.equals(arrayUtf8, array)) {
throw new RuntimeException("PropertyResourceBundle constructed from a UTF-8 encoded property file is not equal to the one constructed from ISO-8859-1 encoded property file.");
}
} catch (FileNotFoundException fnfe) {
throw new RuntimeException(fnfe);
} catch (IOException ioe) {
throw new RuntimeException(ioe);
}
}
private final String[] createKeyValueArray(PropertyResourceBundle b) {
List<String> keyValueList = new ArrayList<String>();
StringBuilder sb = new StringBuilder();
for (String key : b.keySet()) {
sb.setLength(0);
sb.append(key);
sb.append(" = ");
sb.append(b.getString(key));
keyValueList.add(sb.toString());
}
String[] keyValueArray = keyValueList.toArray(new String[0]);
Arrays.sort(keyValueArray);
return keyValueArray;
}
/**
* Gets a resource bundle using the specified base name and locale, and the caller's class loader.
* @param bundle the base name of the resource bundle, a fully qualified class name
* @param locale the locale for which a resource bundle is desired
* @return a resource bundle for the given base name and locale
*/
public static ResourceBundle getResourceBundle(final String bundle, final Locale locale) {
return AccessController.doPrivileged(new PrivilegedAction<ResourceBundle>() {
public ResourceBundle run() {
try {
return PropertyResourceBundle.getBundle(bundle, locale);
} catch (MissingResourceException e) {
try {
return PropertyResourceBundle.getBundle(bundle, new Locale("en", "US"));
} catch (MissingResourceException e2) {
throw new MissingResourceException(
"Could not load any resource bundle by " + bundle, bundle, "");
}
}
}
});
}
private void addData(FileOutputStream fos, PropertyResourceBundle bundle, PropertyResourceBundle backupBundle, String localeName, List <String> propertiesNames) throws IOException {
String propertyName;
String localizedString;
addData(fos, localeName, true);
Enumeration <String> en = bundle.getKeys();
for(int i=0;i<propertiesNames.size();i++) {
String str = null;
try {
str = bundle.getString(propertiesNames.get(i));
} catch (MissingResourceException e) {
if(backupBundle!=null) {
str = backupBundle.getString(propertiesNames.get(i));
}
}
str = changeJavaPropertyCounter(str);
addData(fos, str, true); // localized string as UNICODE
}
}
public Bug6204853() {
String srcDir = System.getProperty("test.src", ".");
try (FileInputStream fis8859_1 =
new FileInputStream(new File(srcDir, "Bug6204853.properties"));
FileInputStream fisUtf8 =
new FileInputStream(new File(srcDir, "Bug6204853_Utf8.properties"));
InputStreamReader isrUtf8 = new InputStreamReader(fisUtf8, "UTF-8"))
{
PropertyResourceBundle bundleUtf8 = new PropertyResourceBundle(isrUtf8);
PropertyResourceBundle bundle = new PropertyResourceBundle(fis8859_1);
String[] arrayUtf8 = createKeyValueArray(bundleUtf8);
String[] array = createKeyValueArray(bundle);
if (!Arrays.equals(arrayUtf8, array)) {
throw new RuntimeException("PropertyResourceBundle constructed from a UTF-8 encoded property file is not equal to the one constructed from ISO-8859-1 encoded property file.");
}
} catch (FileNotFoundException fnfe) {
throw new RuntimeException(fnfe);
} catch (IOException ioe) {
throw new RuntimeException(ioe);
}
}
/**
* Gets a resource bundle using the specified base name and locale, and the caller's class loader.
* @param bundle the base name of the resource bundle, a fully qualified class name
* @param locale the locale for which a resource bundle is desired
* @return a resource bundle for the given base name and locale
*/
public static ResourceBundle getResourceBundle(final String bundle, final Locale locale) {
return AccessController.doPrivileged(new PrivilegedAction<ResourceBundle>() {
public ResourceBundle run() {
try {
return PropertyResourceBundle.getBundle(bundle, locale);
} catch (MissingResourceException e) {
try {
return PropertyResourceBundle.getBundle(bundle, new Locale("en", "US"));
} catch (MissingResourceException e2) {
throw new MissingResourceException(
"Could not load any resource bundle by " + bundle, bundle, "");
}
}
}
});
}
public VirtualChestTranslation(VirtualChestPlugin plugin)
{
Locale locale = Locale.getDefault();
AssetManager assets = Sponge.getAssetManager();
logger = plugin.getLogger();
try
{
Asset asset = assets.getAsset(plugin, "i18n/" + locale.toString() + ".properties").orElse(assets.
getAsset(plugin, "i18n/en_US.properties").orElseThrow(() -> new IOException(I18N_ERROR)));
resourceBundle = new PropertyResourceBundle(new InputStreamReader(asset.getUrl().openStream(), Charsets.UTF_8));
}
catch (IOException e)
{
throw new RuntimeException(e);
}
}
public Bug6204853() {
String srcDir = System.getProperty("test.src", ".");
try (FileInputStream fis8859_1 =
new FileInputStream(new File(srcDir, "Bug6204853.properties"));
FileInputStream fisUtf8 =
new FileInputStream(new File(srcDir, "Bug6204853_Utf8.properties"));
InputStreamReader isrUtf8 = new InputStreamReader(fisUtf8, "UTF-8"))
{
PropertyResourceBundle bundleUtf8 = new PropertyResourceBundle(isrUtf8);
PropertyResourceBundle bundle = new PropertyResourceBundle(fis8859_1);
String[] arrayUtf8 = createKeyValueArray(bundleUtf8);
String[] array = createKeyValueArray(bundle);
if (!Arrays.equals(arrayUtf8, array)) {
throw new RuntimeException("PropertyResourceBundle constructed from a UTF-8 encoded property file is not equal to the one constructed from ISO-8859-1 encoded property file.");
}
} catch (FileNotFoundException fnfe) {
throw new RuntimeException(fnfe);
} catch (IOException ioe) {
throw new RuntimeException(ioe);
}
}
private final String[] createKeyValueArray(PropertyResourceBundle b) {
List<String> keyValueList = new ArrayList<String>();
StringBuilder sb = new StringBuilder();
for (String key : b.keySet()) {
sb.setLength(0);
sb.append(key);
sb.append(" = ");
sb.append(b.getString(key));
keyValueList.add(sb.toString());
}
String[] keyValueArray = keyValueList.toArray(new String[0]);
Arrays.sort(keyValueArray);
return keyValueArray;
}
public Bug6204853() {
String srcDir = System.getProperty("test.src", ".");
try (FileInputStream fis8859_1 =
new FileInputStream(new File(srcDir, "Bug6204853.properties"));
FileInputStream fisUtf8 =
new FileInputStream(new File(srcDir, "Bug6204853_Utf8.properties"));
InputStreamReader isrUtf8 = new InputStreamReader(fisUtf8, "UTF-8"))
{
PropertyResourceBundle bundleUtf8 = new PropertyResourceBundle(isrUtf8);
PropertyResourceBundle bundle = new PropertyResourceBundle(fis8859_1);
String[] arrayUtf8 = createKeyValueArray(bundleUtf8);
String[] array = createKeyValueArray(bundle);
if (!Arrays.equals(arrayUtf8, array)) {
throw new RuntimeException("PropertyResourceBundle constructed from a UTF-8 encoded property file is not equal to the one constructed from ISO-8859-1 encoded property file.");
}
} catch (FileNotFoundException fnfe) {
throw new RuntimeException(fnfe);
} catch (IOException ioe) {
throw new RuntimeException(ioe);
}
}
private final String[] createKeyValueArray(PropertyResourceBundle b) {
List<String> keyValueList = new ArrayList<String>();
StringBuilder sb = new StringBuilder();
for (String key : b.keySet()) {
sb.setLength(0);
sb.append(key);
sb.append(" = ");
sb.append(b.getString(key));
keyValueList.add(sb.toString());
}
String[] keyValueArray = keyValueList.toArray(new String[0]);
Arrays.sort(keyValueArray);
return keyValueArray;
}
public static void initLabels() {
// custom bundle to be able to read the UTF-8 Japanese property file
String name = "Labels";
if (Env.INSTANCE.getAppliLanguage() != null) {
switch (Env.INSTANCE.getAppliLanguage()) {
case JAPANESE:
name += "_ja_JP";
break;
case FRENCH:
name += "_fr_FR";
break;
case GERMAN:
name += "_de_DE";
break;
default:
break;
}
}
name += ".properties";
final InputStream stream = Resources.class.getResourceAsStream(name);
try {
LABEL_BUNDLE = new PropertyResourceBundle(new InputStreamReader(stream, "UTF-8"));
} catch (final Exception e) {
LOGGER.error("Failed to load resource bundle", e);
}
}
public Bug6204853() {
String srcDir = System.getProperty("test.src", ".");
try (FileInputStream fis8859_1 =
new FileInputStream(new File(srcDir, "Bug6204853.properties"));
FileInputStream fisUtf8 =
new FileInputStream(new File(srcDir, "Bug6204853_Utf8.properties"));
InputStreamReader isrUtf8 = new InputStreamReader(fisUtf8, "UTF-8"))
{
PropertyResourceBundle bundleUtf8 = new PropertyResourceBundle(isrUtf8);
PropertyResourceBundle bundle = new PropertyResourceBundle(fis8859_1);
String[] arrayUtf8 = createKeyValueArray(bundleUtf8);
String[] array = createKeyValueArray(bundle);
if (!Arrays.equals(arrayUtf8, array)) {
throw new RuntimeException("PropertyResourceBundle constructed from a UTF-8 encoded property file is not equal to the one constructed from ISO-8859-1 encoded property file.");
}
} catch (FileNotFoundException fnfe) {
throw new RuntimeException(fnfe);
} catch (IOException ioe) {
throw new RuntimeException(ioe);
}
}