Skip to content

Commit

Permalink
#429 [refactor] make class DocumentSplitter.NamespaceScope immutable
Browse files Browse the repository at this point in the history
  • Loading branch information
asolntsev committed Oct 30, 2024
1 parent efd7b47 commit afa6f17
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/
package org.xhtmlrenderer.pdf;

import org.jspecify.annotations.Nullable;
import org.w3c.dom.Document;
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
Expand Down Expand Up @@ -244,10 +245,12 @@ public String getUri() {
}

private static final class NamespaceScope {
private NamespaceScope _parent;
@Nullable
private final NamespaceScope _parent;
private final List<Namespace> _namespaces = new LinkedList<>();

private NamespaceScope() {
_parent = null;
}

private NamespaceScope(NamespaceScope parent) {
Expand Down Expand Up @@ -280,6 +283,7 @@ private void replay(ContentHandler contentHandler, Set<String> seen, boolean sta
}
}

@Nullable
public NamespaceScope getParent() {
return _parent;
}
Expand Down

0 comments on commit afa6f17

Please sign in to comment.