JAVA-847: Replaced !String.isEmpty() with String.length() != 0 to remove Java 6 dependency