< prev index next >

src/java.base/share/classes/jdk/internal/util/xml/impl/XMLStreamWriterImpl.java

Print this page
rev 52979 : 8215281: Use String.isEmpty() when applicable in java.base
Reviewed-by: TBD

*** 203,213 **** * Writes a start tag to the output. * @param localName local name of the tag, may not be null * @throws XMLStreamException */ public void writeStartElement(String localName) throws XMLStreamException { ! if (localName == null || localName.length() == 0) { throw new XMLStreamException("Local Name cannot be null or empty"); } _state = STATE_ELEMENT; if (_currentEle != null && _currentEle.getState() == ELEMENT_STARTTAG_OPEN) { --- 203,213 ---- * Writes a start tag to the output. * @param localName local name of the tag, may not be null * @throws XMLStreamException */ public void writeStartElement(String localName) throws XMLStreamException { ! if (localName == null || localName.isEmpty()) { throw new XMLStreamException("Local Name cannot be null or empty"); } _state = STATE_ELEMENT; if (_currentEle != null && _currentEle.getState() == ELEMENT_STARTTAG_OPEN) {
*** 418,428 **** // Write any pending data _writer.write(content, startWritePos, end - startWritePos); } private void writeXMLContent(String content) throws XMLStreamException { ! if ((content != null) && (content.length() > 0)) { writeXMLContent(content, _escapeCharacters, // boolean = escapeChars false); // false = escapeDoubleQuotes } } --- 418,428 ---- // Write any pending data _writer.write(content, startWritePos, end - startWritePos); } private void writeXMLContent(String content) throws XMLStreamException { ! if (content != null && !content.isEmpty()) { writeXMLContent(content, _escapeCharacters, // boolean = escapeChars false); // false = escapeDoubleQuotes } }
< prev index next >