Skip to content

Commit

Permalink
Restore some local variables to be final.
Browse files Browse the repository at this point in the history
  • Loading branch information
seanjmullan committed Nov 25, 2024
1 parent c3e2a5e commit 66c930e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/java.base/share/classes/javax/security/auth/Subject.java
Original file line number Diff line number Diff line change
Expand Up @@ -1007,9 +1007,9 @@ public int size() {
}

public Iterator<E> iterator() {
LinkedList<E> list = elements;
final LinkedList<E> list = elements;
return new Iterator<>() {
ListIterator<E> i = list.listIterator(0);
final ListIterator<E> i = list.listIterator(0);

public boolean hasNext() {
return i.hasNext();
Expand Down Expand Up @@ -1066,7 +1066,7 @@ public boolean remove(Object o) {
Objects.requireNonNull(o,
ResourcesMgr.getString("invalid.null.input.s."));

Iterator<E> e = iterator();
final Iterator<E> e = iterator();
while (e.hasNext()) {
E next = e.next();

Expand All @@ -1083,7 +1083,7 @@ public boolean contains(Object o) {
Objects.requireNonNull(o,
ResourcesMgr.getString("invalid.null.input.s."));

Iterator<E> e = iterator();
final Iterator<E> e = iterator();
while (e.hasNext()) {
E next = e.next();

Expand All @@ -1110,7 +1110,7 @@ public boolean removeAll(Collection<?> c) {
c = collectionNullClean(c);

boolean modified = false;
Iterator<E> e = iterator();
final Iterator<E> e = iterator();
while (e.hasNext()) {
E next = e.next();

Expand Down Expand Up @@ -1141,7 +1141,7 @@ public boolean retainAll(Collection<?> c) {
c = collectionNullClean(c);

boolean modified = false;
Iterator<E> e = iterator();
final Iterator<E> e = iterator();
while (e.hasNext()) {
E next = e.next();

Expand All @@ -1155,7 +1155,7 @@ public boolean retainAll(Collection<?> c) {
}

public void clear() {
Iterator<E> e = iterator();
final Iterator<E> e = iterator();
while (e.hasNext()) {
E next = e.next();
e.remove();
Expand Down Expand Up @@ -1281,7 +1281,7 @@ private class ClassSet<T> extends AbstractSet<T> {

@SuppressWarnings("unchecked")
private void populateSet() {
Iterator<?> iterator;
final Iterator<?> iterator;
switch(which) {
case Subject.PRINCIPAL_SET:
iterator = Subject.this.principals.iterator();
Expand Down

0 comments on commit 66c930e

Please sign in to comment.