Skip to content

Commit 19cb039

Browse files
committed
Remove newLinkedList(Collection) method
Remove the newLinkedList(Collection<? extends E>) factory method and its Javadoc from ListUtils.java. This deletes the LinkedList constructor overload that created a LinkedList from a Collection, leaving other list factory methods intact.
1 parent 14cf8e4 commit 19cb039

1 file changed

Lines changed: 0 additions & 26 deletions

File tree

  • microsphere-java-core/src/main/java/io/microsphere/collection

microsphere-java-core/src/main/java/io/microsphere/collection/ListUtils.java

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -534,32 +534,6 @@ public static <E> LinkedList<E> newLinkedList(Iterator<E> iterator) {
534534
return list;
535535
}
536536

537-
/**
538-
* Creates a new {@link LinkedList} instance containing all elements from the specified {@link Collection}.
539-
*
540-
* <p>This method delegates to the {@link LinkedList} constructor that accepts a collection,
541-
* ensuring all elements from the input collection are included in the resulting list.
542-
* The returned list is modifiable and allows null elements.</p>
543-
*
544-
* <h3>Example Usage</h3>
545-
* <pre>{@code
546-
* Set<String> fruits = new HashSet<>(Arrays.asList("apple", "banana", "cherry"));
547-
* List<String> listCopy = ListUtils.newLinkedList(fruits);
548-
* System.out.println(listCopy.size()); // Output: 3
549-
*
550-
* List<String> emptyList = ListUtils.newLinkedList(Collections.emptyList());
551-
* System.out.println(emptyList.isEmpty()); // Output: true
552-
* }</pre>
553-
*
554-
* @param elements the collection of elements to add to the list, may be null or empty
555-
* @param <E> the type of elements in the collection
556-
* @return a new {@link LinkedList} containing all elements from the provided collection
557-
*/
558-
@Nonnull
559-
public static <E> LinkedList<E> newLinkedList(Collection<? extends E> elements) {
560-
return new LinkedList<>(elements);
561-
}
562-
563537
/**
564538
* Creates a new {@link ArrayList} containing all elements from the specified array.
565539
* The resulting list is modifiable, allowing for further additions or modifications after creation.

0 commit comments

Comments
 (0)