Merge branch '1.5.x'

This commit is contained in:
Stephane Nicoll
2017-01-25 11:02:32 +01:00
28 changed files with 56 additions and 56 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2012-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -131,8 +131,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();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2012-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -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);

View File

@@ -121,7 +121,7 @@ final class AsciiBytes {
}
public AsciiBytes append(String string) {
if (string == null || string.length() == 0) {
if (string == null || string.isEmpty()) {
return this;
}
return append(string.getBytes(UTF_8));

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2012-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -293,7 +293,7 @@ final class JarURLConnection extends java.net.JarURLConnection {
}
private String decode(String source) {
if (source.length() == 0 || (source.indexOf('%') < 0)) {
if (source.isEmpty() || (source.indexOf('%') < 0)) {
return source;
}
ByteArrayOutputStream bos = new ByteArrayOutputStream(source.length());
@@ -347,7 +347,7 @@ final class JarURLConnection extends java.net.JarURLConnection {
}
public boolean isEmpty() {
return this.name.length() == 0;
return this.name.isEmpty();
}
public String getContentType() {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2012-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -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;