Skip to content

Commit

Permalink
i see no reason for this list to refresh the cache on attribute chang…
Browse files Browse the repository at this point in the history
…es - let's try without
  • Loading branch information
rbri committed Oct 16, 2024
1 parent bd81428 commit d2aa897
Showing 1 changed file with 1 addition and 30 deletions.
31 changes: 1 addition & 30 deletions src/main/java/org/htmlunit/html/AbstractDomNodeList.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ public AbstractDomNodeList(final DomNode node) {

final DomHtmlAttributeChangeListenerImpl listener = new DomHtmlAttributeChangeListenerImpl(this);
node_.addDomChangeListener(listener);
if (node_ instanceof HtmlElement) {
((HtmlElement) node_).addHtmlAttributeChangeListener(listener);
cachedElements_ = null;
}
}

/**
Expand Down Expand Up @@ -132,8 +128,7 @@ public E get(final int index) {
/**
* DOM change listener which clears the node cache when necessary.
*/
private static final class DomHtmlAttributeChangeListenerImpl
implements DomChangeListener, HtmlAttributeChangeListener {
private static final class DomHtmlAttributeChangeListenerImpl implements DomChangeListener {

private final transient WeakReference<AbstractDomNodeList<?>> nodeList_;

Expand All @@ -159,30 +154,6 @@ public void nodeDeleted(final DomChangeEvent event) {
clearCache();
}

/**
* {@inheritDoc}
*/
@Override
public void attributeAdded(final HtmlAttributeChangeEvent event) {
clearCache();
}

/**
* {@inheritDoc}
*/
@Override
public void attributeRemoved(final HtmlAttributeChangeEvent event) {
clearCache();
}

/**
* {@inheritDoc}
*/
@Override
public void attributeReplaced(final HtmlAttributeChangeEvent event) {
clearCache();
}

private void clearCache() {
if (nodeList_ != null) {
final AbstractDomNodeList<?> nodes = nodeList_.get();
Expand Down

0 comments on commit d2aa897

Please sign in to comment.