This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-collections.git
commit b604cd4c9850623df3992561597d88928715c5e1 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Wed May 22 08:43:04 2024 -0400 Fix PMD UnnecessaryFullyQualifiedName in AbstractLinkedMap --- src/changes/changes.xml | 1 + .../apache/commons/collections4/map/AbstractLinkedMap.java | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 72f438696..3ccbb5358 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -40,6 +40,7 @@ <action type="update" dev="ggregory" due-to="PMD, Gary Gregory">Fix PMD UnnecessaryFullyQualifiedName in AbstractHashedMap.</action> <action type="update" dev="ggregory" due-to="PMD, Gary Gregory">Fix PMD UnnecessaryFullyQualifiedName in StringKeyAnalyzer.</action> <action type="update" dev="ggregory" due-to="PMD, Gary Gregory">Fix PMD UnnecessaryFullyQualifiedName in IndexUtils.</action> + <action type="update" dev="ggregory" due-to="PMD, Gary Gregory">Fix PMD UnnecessaryFullyQualifiedName in AbstractLinkedMap.</action> <!-- UPDATE --> <action type="update" dev="ggregory" due-to="Dependabot">Bump org.apache.commons:commons-parent from 67 to 69 #473.</action> <action type="update" dev="ggregory" due-to="Dependabot">Bump tests commons-io:commons-io from 2.16.0 to 2.16.1 #475.</action> diff --git a/src/main/java/org/apache/commons/collections4/map/AbstractLinkedMap.java b/src/main/java/org/apache/commons/collections4/map/AbstractLinkedMap.java index 82ce7c511..0a858ca79 100644 --- a/src/main/java/org/apache/commons/collections4/map/AbstractLinkedMap.java +++ b/src/main/java/org/apache/commons/collections4/map/AbstractLinkedMap.java @@ -175,7 +175,7 @@ public abstract class AbstractLinkedMap<K, V> extends AbstractHashedMap<K, V> im throw new ConcurrentModificationException(); } if (next == parent.header) { - throw new NoSuchElementException(AbstractHashedMap.NO_NEXT_ENTRY); + throw new NoSuchElementException(NO_NEXT_ENTRY); } last = next; next = next.after; @@ -188,7 +188,7 @@ public abstract class AbstractLinkedMap<K, V> extends AbstractHashedMap<K, V> im } final LinkEntry<K, V> previous = next.before; if (previous == parent.header) { - throw new NoSuchElementException(AbstractHashedMap.NO_PREVIOUS_ENTRY); + throw new NoSuchElementException(NO_PREVIOUS_ENTRY); } next = previous; last = previous; @@ -197,7 +197,7 @@ public abstract class AbstractLinkedMap<K, V> extends AbstractHashedMap<K, V> im public void remove() { if (last == null) { - throw new IllegalStateException(AbstractHashedMap.REMOVE_INVALID); + throw new IllegalStateException(REMOVE_INVALID); } if (parent.modCount != expectedModCount) { throw new ConcurrentModificationException(); @@ -235,7 +235,7 @@ public abstract class AbstractLinkedMap<K, V> extends AbstractHashedMap<K, V> im public K getKey() { final LinkEntry<K, V> current = currentEntry(); if (current == null) { - throw new IllegalStateException(AbstractHashedMap.GETKEY_INVALID); + throw new IllegalStateException(GETKEY_INVALID); } return current.getKey(); } @@ -244,7 +244,7 @@ public abstract class AbstractLinkedMap<K, V> extends AbstractHashedMap<K, V> im public V getValue() { final LinkEntry<K, V> current = currentEntry(); if (current == null) { - throw new IllegalStateException(AbstractHashedMap.GETVALUE_INVALID); + throw new IllegalStateException(GETVALUE_INVALID); } return current.getValue(); } @@ -263,7 +263,7 @@ public abstract class AbstractLinkedMap<K, V> extends AbstractHashedMap<K, V> im public V setValue(final V value) { final LinkEntry<K, V> current = currentEntry(); if (current == null) { - throw new IllegalStateException(AbstractHashedMap.SETVALUE_INVALID); + throw new IllegalStateException(SETVALUE_INVALID); } return current.setValue(value); }