Use String.replace() with single char if possible
See gh-8089
This commit is contained in:
@@ -132,8 +132,8 @@ public class LaunchedURLClassLoader extends URLClassLoader {
|
||||
AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
|
||||
@Override
|
||||
public Object run() throws ClassNotFoundException {
|
||||
String packageEntryName = packageName.replace(".", "/") + "/";
|
||||
String classEntryName = className.replace(".", "/") + ".class";
|
||||
String packageEntryName = packageName.replace('.', '/') + "/";
|
||||
String classEntryName = className.replace('.', '/') + ".class";
|
||||
for (URL url : getURLs()) {
|
||||
try {
|
||||
URLConnection connection = url.openConnection();
|
||||
|
||||
@@ -359,7 +359,7 @@ public class PropertiesLauncher extends Launcher {
|
||||
|
||||
private String getProperty(String propertyKey, String manifestKey) throws Exception {
|
||||
if (manifestKey == null) {
|
||||
manifestKey = propertyKey.replace(".", "-");
|
||||
manifestKey = propertyKey.replace('.', '-');
|
||||
manifestKey = toCamelCase(manifestKey);
|
||||
}
|
||||
String property = SystemPropertyUtils.getProperty(propertyKey);
|
||||
|
||||
@@ -184,11 +184,11 @@ public abstract class SystemPropertyUtils {
|
||||
}
|
||||
if (propVal == null) {
|
||||
// Try with underscores.
|
||||
propVal = System.getenv(key.replace(".", "_"));
|
||||
propVal = System.getenv(key.replace('.', '_'));
|
||||
}
|
||||
if (propVal == null) {
|
||||
// Try uppercase with underscores as well.
|
||||
propVal = System.getenv(key.toUpperCase().replace(".", "_"));
|
||||
propVal = System.getenv(key.toUpperCase().replace('.', '_'));
|
||||
}
|
||||
if (propVal != null) {
|
||||
return propVal;
|
||||
|
||||
Reference in New Issue
Block a user