Skip to content

Commit 14cf8e4

Browse files
committed
Remove newArrayList(Collection) helper
Delete the newArrayList(Collection) method and its accompanying JavaDoc from ListUtils. The removed method was a thin wrapper around new ArrayList<>(collection); eliminating it reduces redundant API surface. Callers can use new ArrayList<>(collection) or other existing utility overloads instead.
1 parent fb5f1bf commit 14cf8e4

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
@@ -425,32 +425,6 @@ public static <E> ArrayList<E> newArrayList(Iterator<E> iterator) {
425425
return list;
426426
}
427427

428-
/**
429-
* Creates a new {@link ArrayList} instance containing all elements from the specified {@link Collection}.
430-
*
431-
* <p>This method delegates to the {@link ArrayList} constructor that accepts a collection,
432-
* ensuring all elements from the input collection are included in the resulting list.
433-
* The returned list is modifiable and allows null elements.</p>
434-
*
435-
* <h3>Example Usage</h3>
436-
* <pre>{@code
437-
* Set<String> fruits = new HashSet<>(Arrays.asList("apple", "banana", "cherry"));
438-
* List<String> listCopy = ListUtils.newArrayList(fruits);
439-
* System.out.println(listCopy.size()); // Output: 3
440-
*
441-
* List<String> emptyList = ListUtils.newArrayList(Collections.emptyList());
442-
* System.out.println(emptyList.isEmpty()); // Output: true
443-
* }</pre>
444-
*
445-
* @param elements the collection of elements to add to the list, may be null or empty
446-
* @param <E> the type of elements in the collection
447-
* @return a new {@link ArrayList} containing all elements from the provided collection
448-
*/
449-
@Nonnull
450-
public static <E> ArrayList<E> newArrayList(Collection<? extends E> elements) {
451-
return new ArrayList<>(elements);
452-
}
453-
454428
/**
455429
* Creates a new empty {@link LinkedList} instance.
456430
*

0 commit comments

Comments
 (0)