提交 61e77b39 编写于 作者: N naoto

8044274: Proper property processing

Reviewed-by: okutsu
上级 1b940b2e
......@@ -2650,7 +2650,10 @@ public abstract class ResourceBundle {
} catch (ClassNotFoundException e) {
}
} else if (format.equals("java.properties")) {
final String resourceName = toResourceName(bundleName, "properties");
final String resourceName = toResourceName0(bundleName, "properties");
if (resourceName == null) {
return bundle;
}
final ClassLoader classLoader = loader;
final boolean reloadFlag = reload;
InputStream stream = null;
......@@ -2804,7 +2807,10 @@ public abstract class ResourceBundle {
}
boolean result = false;
try {
String resourceName = toResourceName(toBundleName(baseName, locale), format);
String resourceName = toResourceName0(toBundleName(baseName, locale), format);
if (resourceName == null) {
return result;
}
URL url = loader.getResource(resourceName);
if (url != null) {
long lastModified = 0;
......@@ -2938,6 +2944,15 @@ public abstract class ResourceBundle {
sb.append(bundleName.replace('.', '/')).append('.').append(suffix);
return sb.toString();
}
private String toResourceName0(String bundleName, String suffix) {
// application protocol check
if (bundleName.contains("://")) {
return null;
} else {
return toResourceName(bundleName, suffix);
}
}
}
private static class SingleFormatControl extends Control {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册