--- a/src/java.base/share/classes/jdk/internal/util/xml/impl/XMLStreamWriterImpl.java Thu Dec 13 16:14:07 2018 +0100
+++ b/src/java.base/share/classes/jdk/internal/util/xml/impl/XMLStreamWriterImpl.java Thu Dec 13 15:31:05 2018 +0100
@@ -205,7 +205,7 @@
* @throws XMLStreamException
*/
public void writeStartElement(String localName) throws XMLStreamException {
- if (localName == null || localName.length() == 0) {
+ if (localName == null || localName.isEmpty()) {
throw new XMLStreamException("Local Name cannot be null or empty");
}
@@ -420,7 +420,7 @@
}
private void writeXMLContent(String content) throws XMLStreamException {
- if ((content != null) && (content.length() > 0)) {
+ if (content != null && !content.isEmpty()) {
writeXMLContent(content,
_escapeCharacters, // boolean = escapeChars
false); // false = escapeDoubleQuotes