diff --git a/checkstyle.xml b/checkstyle.xml index 02dfeb6..50bb568 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -95,6 +95,17 @@ + + + + + + + + + + + diff --git a/pom.xml b/pom.xml index 5ee651a..c10622e 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,6 @@ 10.12.5 4.8.1 6.55.0 - 2.38.0 8.4.3 @@ -194,18 +193,6 @@ - - com.diffplug.spotless - spotless-maven-plugin - ${spotless.version} - - - - 1.8 - - - - diff --git a/src/main/java/org/htmlunit/xpath/NodeSetDTM.java b/src/main/java/org/htmlunit/xpath/NodeSetDTM.java index 88d6eca..355e1be 100644 --- a/src/main/java/org/htmlunit/xpath/NodeSetDTM.java +++ b/src/main/java/org/htmlunit/xpath/NodeSetDTM.java @@ -166,7 +166,8 @@ public int previousNode() { /** {@inheritDoc} */ @Override - public void detach() {} + public void detach() { + } /** {@inheritDoc} */ @Override @@ -222,8 +223,7 @@ public void addNode(final int n) { * @throws RuntimeException thrown if this NodeSetDTM is not of a mutable type. */ public void addNodes(final DTMIterator iterator) { - if (null != iterator) // defensive to fix a bug that Sanjiva reported. - { + if (null != iterator) { // defensive to fix a bug that Sanjiva reported. int obj; while (DTM.NULL != (obj = iterator.nextNode())) { @@ -268,7 +268,8 @@ public void addNodeInDocOrder(final int node, final boolean test, final XPathCon if (i != -2) { insertElementAt(node, i + 1); } - } else { + } + else { final int insertIndex = this.size(); boolean foundit = false; diff --git a/src/main/java/org/htmlunit/xpath/axes/WalkerFactory.java b/src/main/java/org/htmlunit/xpath/axes/WalkerFactory.java index 7f9c4c4..a79c9f9 100644 --- a/src/main/java/org/htmlunit/xpath/axes/WalkerFactory.java +++ b/src/main/java/org/htmlunit/xpath/axes/WalkerFactory.java @@ -70,7 +70,8 @@ static AxesWalker loadWalkers( // walker.setAnalysis(analysis); if (null == firstWalker) { firstWalker = walker; - } else { + } + else { prevWalker.setNextWalker(walker); walker.setPrevWalker(prevWalker); } @@ -137,7 +138,8 @@ else if (walksChildrenOnly(analysis) && isOneStep) { // Use simple child iteration without any test. iter = new ChildIterator(analysis); - } else { + } + else { if (DEBUG_ITERATOR_CREATION) diagnoseIterator("ChildTestIterator", analysis, compiler); // Else use simple node test iteration with predicate test. @@ -151,7 +153,8 @@ else if (isOneStep && walksAttributes(analysis)) { // Then use a simple iteration of the attributes, with node test // and predicate testing. iter = new AttributeIterator(compiler, opPos, analysis); - } else if (isOneStep && !walksFilteredList(analysis)) { + } + else if (isOneStep && !walksFilteredList(analysis)) { if (!walksNamespaces(analysis) && (walksInDocOrder(analysis) || isSet(analysis, BIT_PARENT))) { if (false || DEBUG_ITERATOR_CREATION) @@ -160,7 +163,8 @@ else if (isOneStep && walksAttributes(analysis)) { // Then use a simple iteration of the attributes, with node test // and predicate testing. iter = new OneStepIteratorForward(compiler, opPos, analysis); - } else { + } + else { if (false || DEBUG_ITERATOR_CREATION) diagnoseIterator("OneStepIterator", analysis, compiler); @@ -190,14 +194,16 @@ else if (isOptimizableForDescendantIterator(compiler, firstStepPos) if (DEBUG_ITERATOR_CREATION) diagnoseIterator("DescendantIterator", analysis, compiler); iter = new DescendantIterator(compiler, opPos, analysis); - } else { + } + else { if (isNaturalDocOrder(compiler, firstStepPos, analysis)) { if (false || DEBUG_ITERATOR_CREATION) { diagnoseIterator("WalkingIterator", analysis, compiler); } iter = new WalkingIterator(compiler, opPos, analysis, true); - } else { + } + else { // if (DEBUG_ITERATOR_CREATION) // diagnoseIterator("MatchPatternIterator", analysis, compiler); // @@ -272,8 +278,7 @@ public static int getAxisFromStep(final Compiler compiler, final int stepOpCodeP * @return One of BIT_ANCESTOR, etc. */ public static int getAnalysisBitFromAxes(final int axis) { - switch (axis) // Generate new traverser - { + switch (axis) { // Generate new traverser case Axis.ANCESTOR: return BIT_ANCESTOR; case Axis.ANCESTORORSELF: @@ -613,8 +618,7 @@ private static int analyze(final Compiler compiler, int stepOpCodePos) new Object[] {Integer.toString(stepType)})); } - if (OpCodes.NODETYPE_NODE == compiler.getOp(stepOpCodePos + 3)) // child::node() - { + if (OpCodes.NODETYPE_NODE == compiler.getOp(stepOpCodePos + 3)) { // child::node() analysisResult |= BIT_NODETEST_ANY; } @@ -678,8 +682,8 @@ static StepPattern loadSteps(final Compiler compiler, int stepOpCodePos) if (null == firstStep) { firstStep = step; - } else { - + } + else { // prevStep.setNextWalker(step); step.setRelativePathPattern(prevStep); } @@ -752,7 +756,8 @@ static StepPattern loadSteps(final Compiler compiler, int stepOpCodePos) else if (Axis.DESCENDANT == pat.getAxis()) pat.setAxis(Axis.DESCENDANTORSELF); pat = attrPat; - } else if (Axis.CHILD == pat.getAxis()) { + } + else if (Axis.CHILD == pat.getAxis()) { // In this case just change the axis. // pat.setWhatToShow(whatToShow); pat.setAxis(Axis.ATTRIBUTE); @@ -993,7 +998,8 @@ private static AxesWalker createDefaultWalker( if (simpleInit) { ai.initNodeTest(DTMFilter.SHOW_ALL); - } else { + } + else { final int whatToShow = compiler.getWhatToShow(opPos); if ((0 diff --git a/src/main/java/org/htmlunit/xpath/compiler/Lexer.java b/src/main/java/org/htmlunit/xpath/compiler/Lexer.java index f64b94a..dfb41de 100644 --- a/src/main/java/org/htmlunit/xpath/compiler/Lexer.java +++ b/src/main/java/org/htmlunit/xpath/compiler/Lexer.java @@ -101,8 +101,7 @@ void tokenize(final String pat, final List targetStrings) char c = pat.charAt(i); switch (c) { - case '\"': - { + case '\"': { if (startSubstring != -1) { isNum = false; isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName); @@ -110,7 +109,8 @@ void tokenize(final String pat, final List targetStrings) if (-1 != posOfNSSep) { posOfNSSep = mapNSTokens(pat, startSubstring, posOfNSSep, i); - } else { + } + else { addToTokenQueue(pat.substring(startSubstring, i)); } } @@ -124,7 +124,8 @@ void tokenize(final String pat, final List targetStrings) addToTokenQueue(pat.substring(startSubstring, i + 1)); startSubstring = -1; - } else { + } + else { m_processor.error(XPATHErrorResources.ER_EXPECTED_DOUBLE_QUOTE, null); } } @@ -137,7 +138,8 @@ void tokenize(final String pat, final List targetStrings) if (-1 != posOfNSSep) { posOfNSSep = mapNSTokens(pat, startSubstring, posOfNSSep, i); - } else { + } + else { addToTokenQueue(pat.substring(startSubstring, i)); } } @@ -151,7 +153,8 @@ void tokenize(final String pat, final List targetStrings) addToTokenQueue(pat.substring(startSubstring, i + 1)); startSubstring = -1; - } else { + } + else { m_processor.error(XPATHErrorResources.ER_EXPECTED_SINGLE_QUOTE, null); } break; @@ -166,7 +169,8 @@ void tokenize(final String pat, final List targetStrings) if (-1 != posOfNSSep) { posOfNSSep = mapNSTokens(pat, startSubstring, posOfNSSep, i); - } else { + } + else { addToTokenQueue(pat.substring(startSubstring, i)); } @@ -210,14 +214,17 @@ void tokenize(final String pat, final List targetStrings) if (-1 != posOfNSSep) { posOfNSSep = mapNSTokens(pat, startSubstring, posOfNSSep, i); - } else { + } + else { addToTokenQueue(pat.substring(startSubstring, i)); } startSubstring = -1; - } else if (('/' == c) && isStartOfPat) { + } + else if (('/' == c) && isStartOfPat) { isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName); - } else if ('*' == c) { + } + else if ('*' == c) { isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName); isAttrName = false; } @@ -234,7 +241,8 @@ void tokenize(final String pat, final List targetStrings) if ((')' == c) || (']' == c)) { nesting--; - } else if (('(' == c) || ('[' == c)) { + } + else if (('(' == c) || ('[' == c)) { nesting++; } @@ -264,7 +272,8 @@ void tokenize(final String pat, final List targetStrings) if (-1 == startSubstring) { startSubstring = i; isNum = Character.isDigit(c); - } else if (isNum) { + } + else if (isNum) { isNum = Character.isDigit(c); } } @@ -277,15 +286,19 @@ void tokenize(final String pat, final List targetStrings) if ((-1 != posOfNSSep) || ((m_namespaceContext != null) && (m_namespaceContext.handlesNullPrefixes()))) { posOfNSSep = mapNSTokens(pat, startSubstring, posOfNSSep, nChars); - } else { + } + else { addToTokenQueue(pat.substring(startSubstring, nChars)); } } if (0 == m_compiler.getTokenQueueSize()) { m_processor.error(XPATHErrorResources.ER_EMPTY_EXPRESSION, null); - } else if (null != targetStrings) { - recordTokenString(targetStrings); + } + else { + if (null != targetStrings) { + recordTokenString(targetStrings); + } } m_processor.m_queueMark = 0; @@ -350,7 +363,8 @@ private void resetTokenMark(final int mark) { if (m_processor.m_queueMark < qsz) { m_processor.m_token = (String) m_compiler.getTokenQueue().get(m_processor.m_queueMark++); m_processor.m_tokenChar = m_processor.m_token.charAt(0); - } else { + } + else { m_processor.m_token = null; m_processor.m_tokenChar = 0; } @@ -370,7 +384,8 @@ final int getKeywordToken(final String key) { final Integer itok = (Integer) Keywords.getKeyWord(key); tok = (null != itok) ? itok.intValue() : 0; - } catch (NullPointerException | ClassCastException npe) { + } + catch (NullPointerException | ClassCastException npe) { tok = 0; } @@ -413,7 +428,8 @@ private void recordTokenString(final List targetStrings) { default: targetStrings.add(PseudoNames.PSEUDONAME_ANY); } - } else { + } + else { if (m_processor.tokenIs('@')) { tokPos++; @@ -477,10 +493,12 @@ private int mapNSTokens( } uName = m_namespaceContext.getNamespaceForPrefix(prefix); } - } catch (final ClassCastException cce) { + } + catch (final ClassCastException cce) { uName = m_namespaceContext.getNamespaceForPrefix(prefix); } - } else { + } + else { uName = prefix; } @@ -491,7 +509,8 @@ private int mapNSTokens( final String s = pat.substring(posOfNSSep + 1, posOfScan); if (s.length() > 0) addToTokenQueue(s); - } else { + } + else { m_processor.error(XPATHErrorResources.ER_PREFIX_MUST_RESOLVE, new String[] {prefix}); } diff --git a/src/main/java/org/htmlunit/xpath/patterns/StepPattern.java b/src/main/java/org/htmlunit/xpath/patterns/StepPattern.java index 2833864..f9ae329 100644 --- a/src/main/java/org/htmlunit/xpath/patterns/StepPattern.java +++ b/src/main/java/org/htmlunit/xpath/patterns/StepPattern.java @@ -206,7 +206,8 @@ public void calcScore() { if ((getPredicateCount() > 0) || (null != m_relativePathPattern)) { m_score = SCORE_OTHER; - } else super.calcScore(); + } + else super.calcScore(); if (null == m_targetString) calcTargetString(); } @@ -299,19 +300,23 @@ private boolean checkProximityPosition( try { if (XObject.CLASS_NUMBER == pred.getType()) { throw new Error("Why: Should never have been called"); - } else if (!pred.boolWithSideEffects()) { + } + else if (!pred.boolWithSideEffects()) { pass = false; break; } - } finally { + } + finally { pred.detach(); } - } finally { + } + finally { xctxt.popPredicatePos(); } } - } finally { + } + finally { xctxt.popSubContextList(); } @@ -319,11 +324,13 @@ private boolean checkProximityPosition( if (pos < 1) return false; } - } finally { + } + finally { xctxt.popCurrentNode(); } } - } catch (final javax.xml.transform.TransformerException se) { + } + catch (final javax.xml.transform.TransformerException se) { // TODO: should keep throw sax exception... throw new java.lang.RuntimeException(se.getMessage()); @@ -375,19 +382,23 @@ private int getProximityPosition( break; } - } else if (!pred.boolWithSideEffects()) { + } + else if (!pred.boolWithSideEffects()) { pass = false; break; } - } finally { + } + finally { pred.detach(); } - } finally { + } + finally { xctxt.popPredicatePos(); } } - } finally { + } + finally { xctxt.popSubContextList(); } @@ -397,11 +408,13 @@ private int getProximityPosition( return pos; } } - } finally { + } + finally { xctxt.popCurrentNode(); } } - } catch (final javax.xml.transform.TransformerException se) { + } + catch (final javax.xml.transform.TransformerException se) { // TODO: should keep throw sax exception... throw new java.lang.RuntimeException(se.getMessage()); @@ -453,7 +466,8 @@ protected final XObject executeRelativePathPattern( score = execute(xctxt); if (score != NodeTest.SCORE_NONE) break; - } finally { + } + finally { xctxt.popCurrentNode(); } } @@ -504,19 +518,23 @@ protected final boolean executePredicates( break; } - } else if (!pred.boolWithSideEffects()) { + } + else if (!pred.boolWithSideEffects()) { result = false; break; } - } finally { + } + finally { pred.detach(); } - } finally { + } + finally { xctxt.popPredicatePos(); } } - } finally { + } + finally { xctxt.popSubContextList(); } @@ -537,13 +555,17 @@ public String toString() { if (0x000005000 == pat.m_whatToShow) { buf.append("doc()"); - } else if (DTMFilter.SHOW_BYFUNCTION == pat.m_whatToShow) { + } + else if (DTMFilter.SHOW_BYFUNCTION == pat.m_whatToShow) { buf.append("function()"); - } else if (DTMFilter.SHOW_ALL == pat.m_whatToShow) { + } + else if (DTMFilter.SHOW_ALL == pat.m_whatToShow) { buf.append("node()"); - } else if (DTMFilter.SHOW_TEXT == pat.m_whatToShow) { + } + else if (DTMFilter.SHOW_TEXT == pat.m_whatToShow) { buf.append("text()"); - } else if (DTMFilter.SHOW_PROCESSING_INSTRUCTION == pat.m_whatToShow) { + } + else if (DTMFilter.SHOW_PROCESSING_INSTRUCTION == pat.m_whatToShow) { buf.append("processing-instruction("); if (null != pat.m_name) { @@ -551,9 +573,11 @@ public String toString() { } buf.append(")"); - } else if (DTMFilter.SHOW_COMMENT == pat.m_whatToShow) { + } + else if (DTMFilter.SHOW_COMMENT == pat.m_whatToShow) { buf.append("comment()"); - } else if (null != pat.m_name) { + } + else if (null != pat.m_name) { if (DTMFilter.SHOW_ATTRIBUTE == pat.m_whatToShow) { buf.append("@"); } @@ -565,11 +589,14 @@ public String toString() { } buf.append(pat.m_name); - } else if (DTMFilter.SHOW_ATTRIBUTE == pat.m_whatToShow) { + } + else if (DTMFilter.SHOW_ATTRIBUTE == pat.m_whatToShow) { buf.append("@"); - } else if ((DTMFilter.SHOW_DOCUMENT | DTMFilter.SHOW_DOCUMENT_FRAGMENT) == pat.m_whatToShow) { + } + else if ((DTMFilter.SHOW_DOCUMENT | DTMFilter.SHOW_DOCUMENT_FRAGMENT) == pat.m_whatToShow) { buf.append("doc-root()"); - } else { + } + else { buf.append("?").append(Integer.toHexString(pat.m_whatToShow)); } @@ -641,11 +668,13 @@ public boolean deepEquals(final Expression expr) { for (int i = 0; i < n; i++) { if (!m_predicates[i].deepEquals(sp.m_predicates[i])) return false; } - } else if (null != sp.m_predicates) return false; + } + else if (null != sp.m_predicates) return false; if (null != m_relativePathPattern) { if (!m_relativePathPattern.deepEquals(sp.m_relativePathPattern)) return false; - } else if (sp.m_relativePathPattern != null) return false; + } + else if (sp.m_relativePathPattern != null) return false; return true; } diff --git a/src/main/java/org/htmlunit/xpath/xml/dtm/ref/DTMDefaultBaseTraversers.java b/src/main/java/org/htmlunit/xpath/xml/dtm/ref/DTMDefaultBaseTraversers.java index fd658dd..a74c59e 100644 --- a/src/main/java/org/htmlunit/xpath/xml/dtm/ref/DTMDefaultBaseTraversers.java +++ b/src/main/java/org/htmlunit/xpath/xml/dtm/ref/DTMDefaultBaseTraversers.java @@ -52,18 +52,17 @@ public DTMDefaultBaseTraversers( public DTMAxisTraverser getAxisTraverser(final int axis) { DTMAxisTraverser traverser; - if (null == m_traversers) // Cache of stateless traversers for this DTM - { + if (null == m_traversers) { // Cache of stateless traversers for this DTM m_traversers = new DTMAxisTraverser[Axis.getNamesLength()]; traverser = null; - } else { + } + else { traverser = m_traversers[axis]; // Share/reuse existing traverser if (traverser != null) return traverser; } - switch (axis) // Generate new traverser - { + switch (axis) { // Generate new traverser case Axis.ANCESTOR: traverser = new AncestorTraverser(); break; @@ -194,7 +193,8 @@ public int next(final int context, int current, final int expandedTypeID) { do { if (getExpandedTypeID(current) == expandedTypeID) return current; - } while (DTM.NULL != (current = getNextAttribute(current))); + } + while (DTM.NULL != (current = getNextAttribute(current))); return NULL; } @@ -239,7 +239,8 @@ protected int getNextIndexed(final int axisRoot, int nextPotential, final int ex do { parentID = m_parent.elementAt(parentID); if (parentID < axisRoot) return NULL; - } while (parentID > axisRoot); + } + while (parentID > axisRoot); // System.out.println("Found node via index: "+first); nextPotential = nextID + 1; @@ -352,7 +353,8 @@ protected int getNextIndexed( // System.out.println("Found node via index: "+first); return next; - } else if (axisHasBeenProcessed(axisRoot)) break; + } + else if (axisHasBeenProcessed(axisRoot)) break; nextNode(); } @@ -415,7 +417,8 @@ protected boolean isAfterAxis(final int axisRoot, int identity) { do { if (identity == axisRoot) return false; identity = m_parent.elementAt(identity); - } while (identity >= axisRoot); + } + while (identity >= axisRoot); return true; } @@ -538,7 +541,8 @@ public int first(int context) { first = _nextsib(context); if (NULL == first) context = _parent(context); - } while (NULL == first && NULL != context); + } + while (NULL == first && NULL != context); return makeNodeHandle(first); } @@ -569,7 +573,8 @@ public int first(int context, final int expandedTypeID) { if (getExpandedTypeID(first) == expandedTypeID) return first; return next(context, first, expandedTypeID); } - } while (NULL == first && NULL != context); + } + while (NULL == first && NULL != context); return first; } @@ -658,7 +663,8 @@ public int next(final int context, int current, final int expandedTypeID) { do { if (getExpandedTypeID(current) == expandedTypeID) return current; - } while (DTM.NULL != (current = getNextNamespaceNode(context, current, false))); + } + while (DTM.NULL != (current = getNextNamespaceNode(context, current, false))); return NULL; } @@ -687,7 +693,8 @@ public int next(final int context, int current, final int expandedTypeID) { do { if (getExpandedTypeID(current) == expandedTypeID) return current; - } while (DTM.NULL != (current = getNextNamespaceNode(context, current, true))); + } + while (DTM.NULL != (current = getNextNamespaceNode(context, current, true))); return NULL; } diff --git a/src/main/java/org/htmlunit/xpath/xml/dtm/ref/dom2dtm/DOM2DTM.java b/src/main/java/org/htmlunit/xpath/xml/dtm/ref/dom2dtm/DOM2DTM.java index ab6ae42..856374e 100644 --- a/src/main/java/org/htmlunit/xpath/xml/dtm/ref/dom2dtm/DOM2DTM.java +++ b/src/main/java/org/htmlunit/xpath/xml/dtm/ref/dom2dtm/DOM2DTM.java @@ -160,7 +160,8 @@ protected int addNode( final int id = mgrD.getFirstFreeDTMID(); mgrD.addDTM(this, id, nodeIndex); m_dtmIdent.addElement(id << DTMManager.IDENT_DTM_NODE_BITS); - } catch (final ClassCastException e) { + } + catch (final ClassCastException e) { // %REVIEW% Wrong error message, but I've been told we're trying // not to add messages right not for I18N reasons. // %REVIEW% Should this be a Fatal Error? @@ -327,7 +328,8 @@ protected boolean nextNode() { if (pos != null && ENTITY_REFERENCE_NODE == pos.getNodeType()) { // Nothing needs doing if (JJK_DEBUG) System.out.println("***** DOM2DTM popping EntRef"); - } else { + } + else { // Fix and pop DTM if (m_last_kid == NULL) m_firstch.setElementAt(NULL, m_last_parent); // Popping from an element @@ -346,7 +348,8 @@ protected boolean nextNode() { // More work, but simpler code, more likely to be correct, and // it doesn't happen very often. We'd get rid of the loop too. if (ENTITY_REFERENCE_NODE == nexttype) pos = next; - } while (ENTITY_REFERENCE_NODE == nexttype); + } + while (ENTITY_REFERENCE_NODE == nexttype); // Did we run out of the tree? if (next == null) { @@ -544,7 +547,8 @@ private int getHandleFromNode(final Node node) { len = m_nodes.size(); - } while (isMore || i < len); + } + while (isMore || i < len); } return DTM.NULL; @@ -627,8 +631,8 @@ public int getAttributeNode(final int nodeHandle, String namespaceURI, final Str if (nodeuri.equals(namespaceURI) && name.equals(nodelocalname)) return makeNodeHandle(identity); - } else // if (DTM.NAMESPACE_NODE != type) - { + } + else { // if (DTM.NAMESPACE_NODE != type) break; } } @@ -653,7 +657,8 @@ public XString getStringValue(final int nodeHandle) { final String s = (buf.length() > 0) ? buf.toString() : ""; return new XString(s); - } else if (TEXT_NODE == type || CDATA_SECTION_NODE == type) { + } + else if (TEXT_NODE == type || CDATA_SECTION_NODE == type) { // If this is a DTM text node, it may be made of multiple DOM text // nodes -- including navigating into Entity References. DOM2DTM // records the first node in the sequence and requires that we @@ -668,7 +673,8 @@ public XString getStringValue(final int nodeHandle) { } final String s = (buf.length() > 0) ? buf.toString() : ""; return new XString(s); - } else return new XString(node.getNodeValue()); + } + else return new XString(node.getNodeValue()); } /** @@ -693,8 +699,7 @@ protected static void getNodeData(final Node node, final StringBuilder buf) { switch (node.getNodeType()) { case Node.DOCUMENT_FRAGMENT_NODE: case Node.DOCUMENT_NODE: - case Node.ELEMENT_NODE: - { + case Node.ELEMENT_NODE: { for (Node child = node.getFirstChild(); null != child; child = child.getNextSibling()) { getNodeData(child, buf); } @@ -732,15 +737,15 @@ public String getNodeNameX(final int nodeHandle) { final short type = getNodeType(nodeHandle); switch (type) { - case DTM.NAMESPACE_NODE: - { + case DTM.NAMESPACE_NODE: { final Node node = getNode(nodeHandle); // assume not null. name = node.getNodeName(); if (name.startsWith("xmlns:")) { name = getLocalPart(name); - } else if (name.equals("xmlns")) { + } + else if (name.equals("xmlns")) { name = ""; } } @@ -748,8 +753,7 @@ public String getNodeNameX(final int nodeHandle) { case DTM.ATTRIBUTE_NODE: case DTM.ELEMENT_NODE: case DTM.ENTITY_REFERENCE_NODE: - case DTM.PROCESSING_INSTRUCTION_NODE: - { + case DTM.PROCESSING_INSTRUCTION_NODE: { final Node node = getNode(nodeHandle); // assume not null. @@ -790,7 +794,8 @@ public String getLocalName(final int nodeHandle) { // Match old default for this function // This conversion may or may not be necessary newname = ""; - } else { + } + else { final int index = qname.indexOf(':'); newname = (index < 0) ? qname : qname.substring(index + 1); } @@ -806,8 +811,7 @@ public String getPrefix(final int nodeHandle) { final short type = getNodeType(nodeHandle); switch (type) { - case DTM.NAMESPACE_NODE: - { + case DTM.NAMESPACE_NODE: { final Node node = getNode(nodeHandle); // assume not null. @@ -818,8 +822,7 @@ public String getPrefix(final int nodeHandle) { } break; case DTM.ATTRIBUTE_NODE: - case DTM.ELEMENT_NODE: - { + case DTM.ELEMENT_NODE: { final Node node = getNode(nodeHandle); // assume not null.