Use String.isEmpty() instead of String.equals("")

This commit is contained in:
stsypanov
2019-11-05 17:47:19 +02:00
committed by Juergen Hoeller
parent bb2e3ce6d1
commit 1f3b595a03
5 changed files with 8 additions and 8 deletions

View File

@@ -126,7 +126,7 @@ public class SimpleNamingContext implements Context {
if (logger.isDebugEnabled()) {
logger.debug("Static JNDI lookup: [" + name + "]");
}
if ("".equals(name)) {
if (name.isEmpty()) {
return new SimpleNamingContext(this.root, this.boundObjects, this.environment);
}
Object found = this.boundObjects.get(name);
@@ -306,7 +306,7 @@ public class SimpleNamingContext implements Context {
private Iterator<T> iterator;
private AbstractNamingEnumeration(SimpleNamingContext context, String proot) throws NamingException {
if (!"".equals(proot) && !proot.endsWith("/")) {
if (!proot.isEmpty() && !proot.endsWith("/")) {
proot = proot + "/";
}
String root = context.root + proot;