11/*
2- * Copyright (c) 2000, 2014 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2000, 2023 , Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
2424 */
2525package javax .swing ;
2626
27+ import java .util .ArrayList ;
2728import java .util .Comparator ;
28- import java .util .LinkedList ;
2929import java .util .ListIterator ;
3030import java .awt .Component ;
3131import java .awt .ComponentOrientation ;
@@ -63,7 +63,7 @@ public int compare(Component a, Component b) {
6363 // each Component and then search from the Window down until the
6464 // hierarchy branches.
6565 if (a .getParent () != b .getParent ()) {
66- LinkedList <Component > aAncestory = new LinkedList < Component >();
66+ ArrayList <Component > aAncestory = new ArrayList < >();
6767
6868 for (; a != null ; a = a .getParent ()) {
6969 aAncestory .add (a );
@@ -76,7 +76,7 @@ public int compare(Component a, Component b) {
7676 throw new ClassCastException ();
7777 }
7878
79- LinkedList <Component > bAncestory = new LinkedList < Component >();
79+ ArrayList <Component > bAncestory = new ArrayList < >();
8080
8181 for (; b != null ; b = b .getParent ()) {
8282 bAncestory .add (b );
0 commit comments