Skip to content

Commit 6f71819

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 c694c87 commit 6f71819

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
@@ -829,14 +829,17 @@
829829
<include>src/main/java/org/exist/config/ConfigurationImpl.java</include>
830830
<include>src/main/java/org/exist/config/Configurator.java</include>
831831
<include>src/main/java/org/exist/dom/NodeListImpl.java</include>
832+
<exclude>src/main/java/org/exist/dom/memtree/AbstractCharacterData.java</exclude>
832833
<include>src/main/java/org/exist/dom/memtree/AttrImpl.java</include>
833834
<include>src/main/java/org/exist/dom/memtree/DocumentImpl.java</include>
834835
<include>src/main/java/org/exist/dom/memtree/DOMIndexer.java</include>
835836
<include>src/test/java/org/exist/dom/memtree/DOMIndexerTest.java</include>
836837
<include>src/test/java/org/exist/dom/memtree/DOMTest.java</include>
837838
<include>src/main/java/org/exist/dom/memtree/ElementImpl.java</include>
838839
<include>src/main/java/org/exist/dom/memtree/MemTreeBuilder.java</include>
840+
<exclude>src/main/java/org/exist/dom/memtree/NamespaceNode.java</exclude>
839841
<include>src/main/java/org/exist/dom/memtree/NodeImpl.java</include>
842+
<exclude>src/main/java/org/exist/dom/memtree/ProcessingInstructionImpl.java</exclude>
840843
<include>src/main/java/org/exist/dom/persistent/AbstractCharacterData.java</include>
841844
<include>src/main/java/org/exist/dom/persistent/AttrImpl.java</include>
842845
<include>src/main/java/org/exist/dom/persistent/CommentImpl.java</include>
@@ -1103,6 +1106,7 @@
11031106
<exclude>src/main/java/org/exist/config/ConfigurationImpl.java</exclude>
11041107
<exclude>src/main/java/org/exist/config/Configurator.java</exclude>
11051108
<exclude>src/main/java/org/exist/dom/NodeListImpl.java</exclude>
1109+
<exclude>src/main/java/org/exist/dom/memtree/AbstractCharacterData.java</exclude>
11061110
<exclude>src/main/java/org/exist/dom/memtree/AttrImpl.java</exclude>
11071111
<exclude>src/main/java/org/exist/dom/memtree/DocumentImpl.java</exclude>
11081112
<exclude>src/main/java/org/exist/dom/memtree/DocumentTypeImpl.java</exclude>
@@ -1111,7 +1115,9 @@
11111115
<exclude>src/test/java/org/exist/dom/memtree/DOMTest.java</exclude>
11121116
<exclude>src/main/java/org/exist/dom/memtree/ElementImpl.java</exclude>
11131117
<exclude>src/main/java/org/exist/dom/memtree/MemTreeBuilder.java</exclude>
1118+
<exclude>src/main/java/org/exist/dom/memtree/NamespaceNode.java</exclude>
11141119
<exclude>src/main/java/org/exist/dom/memtree/NodeImpl.java</exclude>
1120+
<exclude>src/main/java/org/exist/dom/memtree/ProcessingInstructionImpl.java</exclude>
11151121
<exclude>src/main/java/org/exist/dom/memtree/reference/AbstractReferenceCharacterData.java</exclude>
11161122
<exclude>src/main/java/org/exist/dom/memtree/reference/AbstractReferenceNodeImpl.java</exclude>
11171123
<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)