From ae89c0ced795e8faa1bf11edebc0e6a5db0ac5c1 Mon Sep 17 00:00:00 2001 From: Ronald Brill Date: Wed, 20 Apr 2022 08:31:18 +0200 Subject: [PATCH] simplify AbstractList (step 14) --- .../javascript/host/dom/AbstractList.java | 21 ------------------- .../javascript/host/dom/NodeList.java | 4 ++-- .../javascript/host/html/HTMLCollection.java | 4 ++-- 3 files changed, 4 insertions(+), 25 deletions(-) diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/AbstractList.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/AbstractList.java index e2f0df33a9b..60dcabd8237 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/AbstractList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/AbstractList.java @@ -97,27 +97,6 @@ public enum EffectOnCache { public AbstractList() { } - /** - * Creates an instance. - * - * @param domeNode the {@link DomNode} - * @param attributeChangeSensitive indicates if the content of the collection may change when an attribute - * of a descendant node of parentScope changes (attribute added, modified or removed) - */ - public AbstractList(final DomNode domeNode, final boolean attributeChangeSensitive) { - this(domeNode, attributeChangeSensitive, null); - } - - /** - * Creates an instance with an initial cache value. - * - * @param domNode the {@link DomNode} - * @param initialElements the initial content for the cache - */ - protected AbstractList(final DomNode domNode, final List initialElements) { - this(domNode, true, new ArrayList<>(initialElements)); - } - /** * Creates an instance. * diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeList.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeList.java index 9600c859e82..323446943be 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeList.java @@ -75,7 +75,7 @@ public NodeList() { * of a descendant node of parentScope changes (attribute added, modified or removed) */ public NodeList(final DomNode domNode, final boolean attributeChangeSensitive) { - super(domNode, attributeChangeSensitive); + super(domNode, attributeChangeSensitive, null); } /** @@ -84,7 +84,7 @@ public NodeList(final DomNode domNode, final boolean attributeChangeSensitive) { * @param initialElements the initial content for the cache */ public NodeList(final DomNode domNode, final List initialElements) { - super(domNode, initialElements); + super(domNode, true, new ArrayList<>(initialElements)); } /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLCollection.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLCollection.java index b76442bc4a8..3f18fbb3276 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLCollection.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLCollection.java @@ -81,7 +81,7 @@ public HTMLCollection() { * of a descendant node of parentScope changes (attribute added, modified or removed) */ public HTMLCollection(final DomNode domNode, final boolean attributeChangeSensitive) { - super(domNode, attributeChangeSensitive); + super(domNode, attributeChangeSensitive, null); } /** @@ -90,7 +90,7 @@ public HTMLCollection(final DomNode domNode, final boolean attributeChangeSensit * @param initialElements the initial content for the cache */ HTMLCollection(final DomNode domNode, final List initialElements) { - super(domNode, initialElements); + super(domNode, true, new ArrayList<>(initialElements)); } private HTMLCollection(final DomNode domNode, final boolean attributeChangeSensitive,