Skip to content

Commit 61af5c3

Browse files
committed
[refactor] Remove superfluous overwridden getFirstChild() method from sub-classes where the implementation is the same as the base class NodeImpl implementation
1 parent 1c0fc45 commit 61af5c3

File tree

5 files changed

+78
-21
lines changed

5 files changed

+78
-21
lines changed

exist-core/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -776,14 +776,17 @@
776776
<include>src/main/java/org/exist/config/ConfigurationImpl.java</include>
777777
<include>src/main/java/org/exist/config/Configurator.java</include>
778778
<include>src/main/java/org/exist/dom/NodeListImpl.java</include>
779+
<exclude>src/main/java/org/exist/dom/memtree/AbstractCharacterData.java</exclude>
779780
<include>src/main/java/org/exist/dom/memtree/AttrImpl.java</include>
780781
<include>src/main/java/org/exist/dom/memtree/DocumentImpl.java</include>
781782
<include>src/main/java/org/exist/dom/memtree/DOMIndexer.java</include>
782783
<include>src/test/java/org/exist/dom/memtree/DOMIndexerTest.java</include>
783784
<include>src/test/java/org/exist/dom/memtree/DOMTest.java</include>
784785
<include>src/main/java/org/exist/dom/memtree/ElementImpl.java</include>
785786
<include>src/main/java/org/exist/dom/memtree/MemTreeBuilder.java</include>
787+
<exclude>src/main/java/org/exist/dom/memtree/NamespaceNode.java</exclude>
786788
<include>src/main/java/org/exist/dom/memtree/NodeImpl.java</include>
789+
<exclude>src/main/java/org/exist/dom/memtree/ProcessingInstructionImpl.java</exclude>
787790
<include>src/main/java/org/exist/dom/persistent/AbstractCharacterData.java</include>
788791
<include>src/main/java/org/exist/dom/persistent/AttrImpl.java</include>
789792
<include>src/main/java/org/exist/dom/persistent/CommentImpl.java</include>
@@ -1037,6 +1040,7 @@
10371040
<exclude>src/main/java/org/exist/config/ConfigurationImpl.java</exclude>
10381041
<exclude>src/main/java/org/exist/config/Configurator.java</exclude>
10391042
<exclude>src/main/java/org/exist/dom/NodeListImpl.java</exclude>
1043+
<exclude>src/main/java/org/exist/dom/memtree/AbstractCharacterData.java</exclude>
10401044
<exclude>src/main/java/org/exist/dom/memtree/AttrImpl.java</exclude>
10411045
<exclude>src/main/java/org/exist/dom/memtree/DocumentImpl.java</exclude>
10421046
<exclude>src/main/java/org/exist/dom/memtree/DocumentTypeImpl.java</exclude>
@@ -1045,7 +1049,9 @@
10451049
<exclude>src/test/java/org/exist/dom/memtree/DOMTest.java</exclude>
10461050
<exclude>src/main/java/org/exist/dom/memtree/ElementImpl.java</exclude>
10471051
<exclude>src/main/java/org/exist/dom/memtree/MemTreeBuilder.java</exclude>
1052+
<exclude>src/main/java/org/exist/dom/memtree/NamespaceNode.java</exclude>
10481053
<exclude>src/main/java/org/exist/dom/memtree/NodeImpl.java</exclude>
1054+
<exclude>src/main/java/org/exist/dom/memtree/ProcessingInstructionImpl.java</exclude>
10491055
<exclude>src/main/java/org/exist/dom/memtree/reference/AbstractReferenceCharacterData.java</exclude>
10501056
<exclude>src/main/java/org/exist/dom/memtree/reference/AbstractReferenceNodeImpl.java</exclude>
10511057
<exclude>src/main/java/org/exist/dom/memtree/reference/CommentReferenceImpl.java</exclude>

exist-core/src/main/java/org/exist/dom/memtree/AbstractCharacterData.java

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,28 @@
11
/*
2+
* Elemental
3+
* Copyright (C) 2024, Evolved Binary Ltd
4+
*
5+
6+
* https://www.evolvedbinary.com | https://www.elemental.xyz
7+
*
8+
* This library is free software; you can redistribute it and/or
9+
* modify it under the terms of the GNU Lesser General Public
10+
* License as published by the Free Software Foundation; version 2.1.
11+
*
12+
* This library is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15+
* Lesser General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU Lesser General Public
18+
* License along with this library; if not, write to the Free Software
19+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20+
*
21+
* NOTE: Parts of this file contain code from 'The eXist-db Authors'.
22+
* The original license header is included below.
23+
*
24+
* =====================================================================
25+
*
226
* eXist-db Open Source Native XML Database
327
* Copyright (C) 2001 The eXist-db Authors
428
*
@@ -280,11 +304,6 @@ public String getStringValue() {
280304
return getData();
281305
}
282306

283-
@Override
284-
public Node getFirstChild() {
285-
return null;
286-
}
287-
288307
@Override
289308
public void selectAttributes(final NodeTest test, final Sequence result)
290309
throws XPathException {

exist-core/src/main/java/org/exist/dom/memtree/AttrImpl.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,6 @@ public String getBaseURI() {
9898
return parent.getBaseURI();
9999
}
100100

101-
@Override
102-
public Node getFirstChild() {
103-
return null;
104-
}
105-
106101
@Override
107102
public Node getPreviousSibling() {
108103
return null;

exist-core/src/main/java/org/exist/dom/memtree/NamespaceNode.java

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,28 @@
11
/*
2+
* Elemental
3+
* Copyright (C) 2024, Evolved Binary Ltd
4+
*
5+
6+
* https://www.evolvedbinary.com | https://www.elemental.xyz
7+
*
8+
* This library is free software; you can redistribute it and/or
9+
* modify it under the terms of the GNU Lesser General Public
10+
* License as published by the Free Software Foundation; version 2.1.
11+
*
12+
* This library is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15+
* Lesser General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU Lesser General Public
18+
* License along with this library; if not, write to the Free Software
19+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20+
*
21+
* NOTE: Parts of this file contain code from 'The eXist-db Authors'.
22+
* The original license header is included below.
23+
*
24+
* =====================================================================
25+
*
226
* eXist-db Open Source Native XML Database
327
* Copyright (C) 2001 The eXist-db Authors
428
*
@@ -78,11 +102,6 @@ public String getValue() {
78102
public void setValue(final String value) throws DOMException {
79103
}
80104

81-
@Override
82-
public Node getFirstChild() {
83-
return null;
84-
}
85-
86105
@Override
87106
public Node getLastChild() {
88107
return null;

exist-core/src/main/java/org/exist/dom/memtree/ProcessingInstructionImpl.java

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,28 @@
11
/*
2+
* Elemental
3+
* Copyright (C) 2024, Evolved Binary Ltd
4+
*
5+
6+
* https://www.evolvedbinary.com | https://www.elemental.xyz
7+
*
8+
* This library is free software; you can redistribute it and/or
9+
* modify it under the terms of the GNU Lesser General Public
10+
* License as published by the Free Software Foundation; version 2.1.
11+
*
12+
* This library is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15+
* Lesser General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU Lesser General Public
18+
* License along with this library; if not, write to the Free Software
19+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20+
*
21+
* NOTE: Parts of this file contain code from 'The eXist-db Authors'.
22+
* The original license header is included below.
23+
*
24+
* =====================================================================
25+
*
226
* eXist-db Open Source Native XML Database
327
* Copyright (C) 2001 The eXist-db Authors
428
*
@@ -111,12 +135,6 @@ public String getBaseURI() {
111135
return (baseURI);
112136
}
113137

114-
@Override
115-
public Node getFirstChild() {
116-
//No child
117-
return null;
118-
}
119-
120138
@Override
121139
public int getItemType() {
122140
return Type.PROCESSING_INSTRUCTION;

0 commit comments

Comments
 (0)