You see a lot of these (this one is from DocumentImpl.cpp) if (namespaceURI == null || namespaceURI.length() == 0)
I don't know doing both is actually necessary, or a safety measure by someone who wasn't sure. However, if(namespaceURI.empty()) would be a whole lot cleaner.