Polishing

This commit is contained in:
Juergen Hoeller
2020-08-27 15:33:08 +02:00
parent f7440884c9
commit 2891dc6409
21 changed files with 104 additions and 110 deletions

View File

@@ -123,7 +123,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);
@@ -300,10 +300,10 @@ public class SimpleNamingContext implements Context {
private abstract static class AbstractNamingEnumeration<T> implements NamingEnumeration<T> {
private Iterator<T> iterator;
private final 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;