From c46cf19b3ad2c53fea62efe209a6b36e40e0aef7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 30 May 2026 06:30:42 +0000 Subject: [PATCH 1/5] Refactor collection constructors to use factory methods (excluding utility classes) --- .../classloading/ArtifactDetector.java | 3 +- .../BannedArtifactClassLoadingExecutor.java | 5 ++- .../microsphere/collection/AbstractDeque.java | 3 +- .../collection/CollectionUtils.java | 4 +- .../collection/UnmodifiableDeque.java | 3 +- .../collection/UnmodifiableQueue.java | 3 +- .../event/AbstractEventDispatcher.java | 5 ++- .../event/GenericEventListener.java | 3 +- .../java/io/microsphere/event/Listenable.java | 3 +- .../io/microsphere/filter/FilterUtils.java | 3 +- .../io/StandardFileWatchService.java | 3 +- .../java/io/microsphere/json/JSONArray.java | 2 +- .../java/io/microsphere/json/JSONObject.java | 3 +- .../io/microsphere/json/JSONStringer.java | 3 +- .../java/io/microsphere/lang/Prioritized.java | 3 +- .../io/microsphere/lang/function/Streams.java | 8 ++-- .../management/builder/MBeanInfoBuilder.java | 9 +++-- .../ConfigurationPropertyGenerator.java | 3 +- .../ExtendableProtocolURLStreamHandler.java | 3 +- .../java/io/microsphere/net/URLUtils.java | 2 +- .../java/io/microsphere/reflect/JavaType.java | 5 ++- .../io/microsphere/reflect/MethodUtils.java | 2 +- .../microsphere/reflect/ReflectionUtils.java | 3 +- .../io/microsphere/reflect/TypeUtils.java | 37 ++++++++++--------- .../io/microsphere/util/AnnotationUtils.java | 2 +- .../io/microsphere/util/ClassLoaderUtils.java | 4 +- .../java/io/microsphere/util/ClassUtils.java | 3 +- .../microsphere/util/PriorityComparator.java | 3 +- .../java/io/microsphere/util/StopWatch.java | 5 ++- .../java/io/microsphere/util/StringUtils.java | 5 ++- .../io/microsphere/util/jar/JarUtils.java | 2 +- 31 files changed, 84 insertions(+), 61 deletions(-) diff --git a/microsphere-java-core/src/main/java/io/microsphere/classloading/ArtifactDetector.java b/microsphere-java-core/src/main/java/io/microsphere/classloading/ArtifactDetector.java index a964ad919..43c5a79ed 100644 --- a/microsphere-java-core/src/main/java/io/microsphere/classloading/ArtifactDetector.java +++ b/microsphere-java-core/src/main/java/io/microsphere/classloading/ArtifactDetector.java @@ -25,6 +25,7 @@ import static io.microsphere.util.SystemUtils.JAVA_HOME; import static java.util.Collections.emptyList; import static java.util.Collections.unmodifiableList; +import static io.microsphere.collection.SetUtils.*; /** * The {@code ArtifactDetector} class is responsible for detecting and resolving artifacts from the classpath. @@ -149,7 +150,7 @@ public Artifact detect(@Nonnull URL classPathURL) { protected Set getClassPathURLs(boolean includedJdkLibraries) { Set urls = findAllClassPathURLs(classLoader); - LinkedHashSet classPathURLs = new LinkedHashSet<>(urls); + LinkedHashSet classPathURLs = newLinkedHashSet(urls); if (!includedJdkLibraries) { removeJdkClassPathURLs(classPathURLs); } diff --git a/microsphere-java-core/src/main/java/io/microsphere/classloading/BannedArtifactClassLoadingExecutor.java b/microsphere-java-core/src/main/java/io/microsphere/classloading/BannedArtifactClassLoadingExecutor.java index c571a8ee8..3da851070 100644 --- a/microsphere-java-core/src/main/java/io/microsphere/classloading/BannedArtifactClassLoadingExecutor.java +++ b/microsphere-java-core/src/main/java/io/microsphere/classloading/BannedArtifactClassLoadingExecutor.java @@ -18,6 +18,7 @@ import static io.microsphere.util.StringUtils.isBlank; import static io.microsphere.util.StringUtils.split; import static io.microsphere.util.SystemUtils.FILE_ENCODING; +import static io.microsphere.collection.ListUtils.*; /** * The executor for the banned artifacts that are loading by {@link ClassLoader}. @@ -94,7 +95,7 @@ public void execute() { } static List loadBannedArtifactConfigs(ClassLoader classLoader) { - LinkedList bannedArtifactConfigs = new LinkedList<>(); + LinkedList bannedArtifactConfigs = newLinkedList(); try { Enumeration configResources = classLoader.getResources(CONFIG_LOCATION); while (configResources.hasMoreElements()) { @@ -109,7 +110,7 @@ static List loadBannedArtifactConfigs(ClassLoader classLoader) { } static List loadBannedArtifactConfigs(URL configResource) throws IOException { - LinkedList bannedArtifactConfigs = new LinkedList<>(); + LinkedList bannedArtifactConfigs = newLinkedList(); try (InputStream inputStream = configResource.openStream(); BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, ENCODING)) ) { diff --git a/microsphere-java-core/src/main/java/io/microsphere/collection/AbstractDeque.java b/microsphere-java-core/src/main/java/io/microsphere/collection/AbstractDeque.java index ff62b88e1..d1fcd68d4 100644 --- a/microsphere-java-core/src/main/java/io/microsphere/collection/AbstractDeque.java +++ b/microsphere-java-core/src/main/java/io/microsphere/collection/AbstractDeque.java @@ -19,6 +19,7 @@ import java.util.AbstractQueue; import java.util.Deque; import java.util.NoSuchElementException; +import static io.microsphere.collection.ListUtils.*; /** * Abstract {@link Deque} implementation that provides default implementations for some of the @@ -34,7 +35,7 @@ *

Example Usage

*
{@code
  * public class SimpleDeque extends AbstractDeque {
- *     private final List list = new ArrayList<>();
+ *     private final List list = newArrayList();
  *
  *     public void addFirst(E e) {
  *         list.add(0, e);
diff --git a/microsphere-java-core/src/main/java/io/microsphere/collection/CollectionUtils.java b/microsphere-java-core/src/main/java/io/microsphere/collection/CollectionUtils.java
index 0cf6c7ae3..385a9e449 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/collection/CollectionUtils.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/collection/CollectionUtils.java
@@ -440,7 +440,7 @@ public static boolean equals(@Nullable Collection one, @Nullable CollectionExample Usage
      * 
{@code
-     * Collection collection = new ArrayList<>();
+     * Collection collection = newArrayList();
      * int count1 = CollectionUtils.addAll(collection, "a", "b", "c"); // returns 3
      *
      * int count2 = CollectionUtils.addAll(null, "a", "b"); // returns 0
@@ -486,7 +486,7 @@ public static  int addAll(@Nullable Collection collection, T... newValues)
      *
      * 

Example Usage

*
{@code
-     * Collection collection = new ArrayList<>();
+     * Collection collection = newArrayList();
      * Iterable values = Arrays.asList("a", "b", "c");
      * int count1 = CollectionUtils.addAll(collection, values); // returns 3
      *
diff --git a/microsphere-java-core/src/main/java/io/microsphere/collection/UnmodifiableDeque.java b/microsphere-java-core/src/main/java/io/microsphere/collection/UnmodifiableDeque.java
index 04630e7b2..30495d17a 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/collection/UnmodifiableDeque.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/collection/UnmodifiableDeque.java
@@ -24,6 +24,7 @@
 import java.util.Iterator;
 
 import static io.microsphere.collection.CollectionUtils.unmodifiableIterator;
+import static io.microsphere.collection.ListUtils.*;
 
 /**
  * An unmodifiable view of a {@link Deque}. This implementation decorates a given deque and prevents any
@@ -40,7 +41,7 @@
  * 

* *
{@code
- * Deque mutableDeque = new LinkedList<>();
+ * Deque mutableDeque = newLinkedList();
  * mutableDeque.addFirst("World");
  * Deque unmodifiableDeque = new UnmodifiableDeque<>(mutableDeque);
  * unmodifiableDeque.addFirst("Hello"); // throws UnsupportedOperationException
diff --git a/microsphere-java-core/src/main/java/io/microsphere/collection/UnmodifiableQueue.java b/microsphere-java-core/src/main/java/io/microsphere/collection/UnmodifiableQueue.java
index 77729e8fe..9f2eb72b5 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/collection/UnmodifiableQueue.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/collection/UnmodifiableQueue.java
@@ -29,6 +29,7 @@
 import java.util.stream.Stream;
 
 import static io.microsphere.collection.CollectionUtils.unmodifiableIterator;
+import static io.microsphere.collection.ListUtils.*;
 
 /**
  * An unmodifiable view of a {@link Queue}. This implementation decorates a given queue and prevents any
@@ -45,7 +46,7 @@
  * 

* *
{@code
- * Queue mutableQueue = new LinkedList<>();
+ * Queue mutableQueue = newLinkedList();
  * mutableQueue.add("Hello");
  * Queue unmodifiableQueue = new UnmodifiableQueue<>(mutableQueue);
  * unmodifiableQueue.add("World"); // throws UnsupportedOperationException
diff --git a/microsphere-java-core/src/main/java/io/microsphere/event/AbstractEventDispatcher.java b/microsphere-java-core/src/main/java/io/microsphere/event/AbstractEventDispatcher.java
index bea8ef142..40cd1f367 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/event/AbstractEventDispatcher.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/event/AbstractEventDispatcher.java
@@ -40,6 +40,7 @@
 import static io.microsphere.util.ServiceLoaderUtils.loadServicesList;
 import static java.util.Collections.sort;
 import static java.util.Collections.unmodifiableList;
+import static io.microsphere.collection.ListUtils.*;
 
 /**
  * Abstract implementation of {@link EventDispatcher} that provides common functionality for dispatching events to
@@ -127,7 +128,7 @@ public void removeEventListener(EventListener listener) throws NullPointerExc
     @Override
     @Immutable
     public List> getAllEventListeners() {
-        LinkedList> listeners = new LinkedList<>();
+        LinkedList> listeners = newLinkedList();
 
         sortedListeners().forEach(listener -> {
             addIfAbsent(listeners, listener);
@@ -192,7 +193,7 @@ protected void doInListener(EventListener listener, Consumer eventType, Consumer> consumer) {
         if (eventType != null) {
             synchronized (mutex) {
-                List listeners = listenersCache.computeIfAbsent(eventType, e -> new LinkedList<>());
+                List listeners = listenersCache.computeIfAbsent(eventType, e -> newLinkedList());
                 // consume
                 consumer.accept(listeners);
                 // sort
diff --git a/microsphere-java-core/src/main/java/io/microsphere/event/GenericEventListener.java b/microsphere-java-core/src/main/java/io/microsphere/event/GenericEventListener.java
index 8e2d040e4..1966c0454 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/event/GenericEventListener.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/event/GenericEventListener.java
@@ -29,6 +29,7 @@
 import static io.microsphere.lang.function.ThrowableConsumer.execute;
 import static java.util.Collections.emptySet;
 import static java.util.stream.Stream.of;
+import static io.microsphere.collection.SetUtils.*;
 
 /**
  * A generic implementation of the {@link EventListener} interface that supports multiple event handling methods.
@@ -97,7 +98,7 @@ private Map, Set> findHandleEventMethods() {
         HashMap, Set> eventMethods = newHashMap();
         of(getClass().getMethods()).filter(this::isHandleEventMethod).forEach(method -> {
             Class paramType = method.getParameterTypes()[0];
-            Set methods = eventMethods.computeIfAbsent(paramType, key -> new LinkedHashSet<>());
+            Set methods = eventMethods.computeIfAbsent(paramType, key -> newLinkedHashSet());
             methods.add(method);
         });
         return eventMethods;
diff --git a/microsphere-java-core/src/main/java/io/microsphere/event/Listenable.java b/microsphere-java-core/src/main/java/io/microsphere/event/Listenable.java
index 81bcb169a..c937f500f 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/event/Listenable.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/event/Listenable.java
@@ -27,6 +27,7 @@
 import static io.microsphere.util.ClassUtils.getTypeName;
 import static java.lang.reflect.Modifier.isFinal;
 import static java.util.stream.StreamSupport.stream;
+import static io.microsphere.collection.ListUtils.*;
 
 /**
  * A component that allows registration and management of {@link EventListener} instances.
@@ -111,7 +112,7 @@ static void assertListener(EventListener listener) throws IllegalArgumentExce
      */
     default void addEventListeners(E listener, E... others) throws NullPointerException,
             IllegalArgumentException {
-        ArrayList listeners = new ArrayList<>(1 + others.length);
+        ArrayList listeners = newArrayList(1 + others.length);
         listeners.add(listener);
         addAll(listeners, others);
         addEventListeners(listeners);
diff --git a/microsphere-java-core/src/main/java/io/microsphere/filter/FilterUtils.java b/microsphere-java-core/src/main/java/io/microsphere/filter/FilterUtils.java
index 8725c3b6c..6dfda1453 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/filter/FilterUtils.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/filter/FilterUtils.java
@@ -12,6 +12,7 @@
 import java.util.List;
 
 import static java.util.Collections.unmodifiableList;
+import static io.microsphere.collection.ListUtils.*;
 
 /**
  * Utility class for working with {@link Filter} instances.
@@ -74,7 +75,7 @@ public static  List filter(Iterable iterable, Filter filter) {
     @Nonnull
     @Immutable
     public static  List filter(Iterable iterable, FilterOperator filterOperator, Filter... filters) {
-        ArrayList list = new ArrayList();
+        ArrayList list = newArrayList();
         Iterator iterator = iterable.iterator();
         while (iterator.hasNext()) {
             E element = iterator.next();
diff --git a/microsphere-java-core/src/main/java/io/microsphere/io/StandardFileWatchService.java b/microsphere-java-core/src/main/java/io/microsphere/io/StandardFileWatchService.java
index 94576736b..b6ccdcf7c 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/io/StandardFileWatchService.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/io/StandardFileWatchService.java
@@ -63,6 +63,7 @@
 import static java.nio.file.StandardWatchEventKinds.ENTRY_MODIFY;
 import static java.util.concurrent.Executors.newSingleThreadExecutor;
 import static java.util.concurrent.TimeUnit.MILLISECONDS;
+import static io.microsphere.collection.SetUtils.*;
 
 /**
  * /**
@@ -330,7 +331,7 @@ static Kind toKind(WatchEvent.Kind watchEventKind) {
 
     private static class FileChangedMetadata {
 
-        private final Set filePaths = new TreeSet<>();
+        private final Set filePaths = newTreeSet();
 
         private EventDispatcher eventDispatcher;
 
diff --git a/microsphere-java-core/src/main/java/io/microsphere/json/JSONArray.java b/microsphere-java-core/src/main/java/io/microsphere/json/JSONArray.java
index b5fe96af6..7257fa2f9 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/json/JSONArray.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/json/JSONArray.java
@@ -82,7 +82,7 @@ public class JSONArray {
      * Creates a {@code JSONArray} with no values.
      */
     public JSONArray() {
-        this.values = new ArrayList<>();
+        this.values = newArrayList();
     }
 
     @SuppressWarnings("rawtypes")
diff --git a/microsphere-java-core/src/main/java/io/microsphere/json/JSONObject.java b/microsphere-java-core/src/main/java/io/microsphere/json/JSONObject.java
index d07a16292..c1d3c0268 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/json/JSONObject.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/json/JSONObject.java
@@ -43,6 +43,7 @@
 import static io.microsphere.util.ClassUtils.isEnum;
 import static io.microsphere.util.ClassUtils.isNumber;
 import static io.microsphere.util.ClassUtils.isWrapperType;
+import static io.microsphere.collection.ListUtils.*;
 
 /**
  * A modifiable set of name/value mappings. Names are unique, non-null strings. Values may
@@ -730,7 +731,7 @@ public Iterator keys() {
      * @return the array
      */
     public JSONArray names() {
-        return this.nameValuePairs.isEmpty() ? null : new JSONArray(new ArrayList<>(this.nameValuePairs.keySet()));
+        return this.nameValuePairs.isEmpty() ? null : new JSONArray(newArrayList(this.nameValuePairs.keySet()));
     }
 
     /**
diff --git a/microsphere-java-core/src/main/java/io/microsphere/json/JSONStringer.java b/microsphere-java-core/src/main/java/io/microsphere/json/JSONStringer.java
index ffb062aec..8ea9c1adc 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/json/JSONStringer.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/json/JSONStringer.java
@@ -29,6 +29,7 @@
 import static io.microsphere.util.ClassUtils.getTypeName;
 import static java.lang.String.format;
 import static java.util.Arrays.fill;
+import static io.microsphere.collection.ListUtils.*;
 
 /**
  * Implements {@link JSONObject#toString} and {@link JSONArray#toString}. Most application
@@ -121,7 +122,7 @@ enum Scope {
      * Unlike the original implementation, this stack isn't limited to 20 levels of
      * nesting.
      */
-    private final List stack = new ArrayList<>();
+    private final List stack = newArrayList();
 
     /**
      * A string containing a full set of spaces for a single level of indentation, or null
diff --git a/microsphere-java-core/src/main/java/io/microsphere/lang/Prioritized.java b/microsphere-java-core/src/main/java/io/microsphere/lang/Prioritized.java
index b369e3840..d26c8ee5e 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/lang/Prioritized.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/lang/Prioritized.java
@@ -21,6 +21,7 @@
 import static java.lang.Integer.MAX_VALUE;
 import static java.lang.Integer.MIN_VALUE;
 import static java.lang.Integer.compare;
+import static io.microsphere.collection.ListUtils.*;
 
 /**
  * {@code Prioritized} interface can be implemented by objects that
@@ -45,7 +46,7 @@
  * }
  *
  * // Sorting a list of Prioritized objects
- * List tasks = new ArrayList<>();
+ * List tasks = newArrayList();
  * tasks.add(new MyTask(5));
  * tasks.add(new MyTask(1));
  * Collections.sort(tasks);
diff --git a/microsphere-java-core/src/main/java/io/microsphere/lang/function/Streams.java b/microsphere-java-core/src/main/java/io/microsphere/lang/function/Streams.java
index 863566055..ce140ca8f 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/lang/function/Streams.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/lang/function/Streams.java
@@ -255,7 +255,7 @@ static > Set filterSet(S values, PredicateExample Usage with Set
      * 
{@code
-     * Set names = new LinkedHashSet<>(Arrays.asList("Alice", "Bob", "Charlie", "Anna"));
+     * Set names = newLinkedHashSet(Arrays.asList("Alice", "Bob", "Charlie", "Anna"));
      * Set filteredSet = Streams.filter(names, name -> name.startsWith("A"));
      * System.out.println(filteredSet);  // Output: [Alice, Anna]
      * }
@@ -291,7 +291,7 @@ static > S filter(S values, Predicate predic * *

Example Usage with Set

*
{@code
-     * Set names = new LinkedHashSet<>(Arrays.asList("Alice", "Anna", "Bob", "Andrew"));
+     * Set names = newLinkedHashSet(Arrays.asList("Alice", "Anna", "Bob", "Andrew"));
      * Set filtered = Streams.filterAll(names,
      *     name -> name.startsWith("A"),
      *     name -> name.length() > 4
@@ -385,7 +385,7 @@ static  Set filterAllSet(T[] values, Predicate... predicates) {
      *
      * 

Example Usage with Set

*
{@code
-     * Set names = new LinkedHashSet<>(Arrays.asList("Alice", "Anna", "Bob", "Andrew"));
+     * Set names = newLinkedHashSet(Arrays.asList("Alice", "Anna", "Bob", "Andrew"));
      * Set filtered = Streams.filterAny(names,
      *     name -> name.startsWith("B"),
      *     name -> name.length() <= 3
@@ -484,7 +484,7 @@ static  Set filterAnySet(T[] values, Predicate... predicates) {
      *
      * 

Example Usage with Set

*
{@code
-     * Set names = new LinkedHashSet<>(Arrays.asList("Alice", "Anna", "Bob", "Andrew"));
+     * Set names = newLinkedHashSet(Arrays.asList("Alice", "Anna", "Bob", "Andrew"));
      * String result = Streams.filterFirst(names,
      *     name -> name.startsWith("A"),
      *     name -> name.length() > 4
diff --git a/microsphere-java-core/src/main/java/io/microsphere/management/builder/MBeanInfoBuilder.java b/microsphere-java-core/src/main/java/io/microsphere/management/builder/MBeanInfoBuilder.java
index 25d0b747c..6ad908cb2 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/management/builder/MBeanInfoBuilder.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/management/builder/MBeanInfoBuilder.java
@@ -37,6 +37,7 @@
 import static io.microsphere.reflect.MethodUtils.isIsMethod;
 import static io.microsphere.util.ClassUtils.getTypeName;
 import static java.util.Objects.nonNull;
+import static io.microsphere.collection.ListUtils.*;
 
 /**
  * The {@link MBeanInfo} Builder
@@ -54,16 +55,16 @@ public class MBeanInfoBuilder extends MBeanDescribableBuilder
     String className;
 
     @Nullable
-    List attributeBuilders = new LinkedList<>();
+    List attributeBuilders = newLinkedList();
 
     @Nullable
-    List operationBuilders = new LinkedList<>();
+    List operationBuilders = newLinkedList();
 
     @Nullable
-    List constructorBuilders = new LinkedList<>();
+    List constructorBuilders = newLinkedList();
 
     @Nullable
-    List notificationBuilders = new LinkedList<>();
+    List notificationBuilders = newLinkedList();
 
     public MBeanInfoBuilder attribute(String attributeName, Class attributeType, Consumer builderConsumer) {
         MBeanAttributeInfoBuilder builder = MBeanAttributeInfoBuilder.attribute(attributeType).name(attributeName);
diff --git a/microsphere-java-core/src/main/java/io/microsphere/metadata/ConfigurationPropertyGenerator.java b/microsphere-java-core/src/main/java/io/microsphere/metadata/ConfigurationPropertyGenerator.java
index a45956fc0..1b42522ee 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/metadata/ConfigurationPropertyGenerator.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/metadata/ConfigurationPropertyGenerator.java
@@ -20,6 +20,7 @@
 import io.microsphere.annotation.Nonnull;
 import io.microsphere.beans.ConfigurationProperty;
 import io.microsphere.lang.Prioritized;
+import static io.microsphere.collection.ListUtils.*;
 
 /**
  * {@code ConfigurationPropertyGenerator} interface can be implemented by objects that
@@ -43,7 +44,7 @@
  * }
  *
  * // Registering and using generators
- * List generators = new ArrayList<>();
+ * List generators = newArrayList();
  * generators.add(new JsonPropertyGenerator());
  * Collections.sort(generators); // Sort by priority
  * }
diff --git a/microsphere-java-core/src/main/java/io/microsphere/net/ExtendableProtocolURLStreamHandler.java b/microsphere-java-core/src/main/java/io/microsphere/net/ExtendableProtocolURLStreamHandler.java index 6a6d8c6be..ce22fb6cb 100644 --- a/microsphere-java-core/src/main/java/io/microsphere/net/ExtendableProtocolURLStreamHandler.java +++ b/microsphere-java-core/src/main/java/io/microsphere/net/ExtendableProtocolURLStreamHandler.java @@ -50,6 +50,7 @@ import static java.lang.System.setProperty; import static java.net.Proxy.NO_PROXY; import static java.util.Collections.sort; +import static io.microsphere.collection.ListUtils.*; /** * Extendable Protocol {@link URLStreamHandler} class supports the sub-protocols, @@ -133,7 +134,7 @@ public abstract class ExtendableProtocolURLStreamHandler extends URLStreamHandle private final String protocol; - private final List factories = new ArrayList<>(); + private final List factories = newArrayList(); /** * The default constructor must obey the following conventions: diff --git a/microsphere-java-core/src/main/java/io/microsphere/net/URLUtils.java b/microsphere-java-core/src/main/java/io/microsphere/net/URLUtils.java index b504c9679..14afeb3be 100644 --- a/microsphere-java-core/src/main/java/io/microsphere/net/URLUtils.java +++ b/microsphere-java-core/src/main/java/io/microsphere/net/URLUtils.java @@ -818,7 +818,7 @@ public static String buildURI(String... paths) { *

Example Usage

*
{@code
      * // Example 1: Basic usage with multiple parameters
-     * Map> matrixParams = new LinkedHashMap<>();
+     * Map> matrixParams = newLinkedHashMap();
      * matrixParams.put("key1", Arrays.asList("valueA", "valueB"));
      * matrixParams.put("key2", Collections.singletonList("valueC"));
      * matrixParams.put("_sp", Arrays.asList("subproto1", "subproto2")); // This will be skipped
diff --git a/microsphere-java-core/src/main/java/io/microsphere/reflect/JavaType.java b/microsphere-java-core/src/main/java/io/microsphere/reflect/JavaType.java
index efad76a35..19c3cebe8 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/reflect/JavaType.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/reflect/JavaType.java
@@ -52,6 +52,7 @@
 import static io.microsphere.util.ArrayUtils.asArray;
 import static io.microsphere.util.ArrayUtils.length;
 import static java.util.Objects.hash;
+import static io.microsphere.collection.MapUtils.*;
 
 /**
  * Represents a Java type, encapsulating various operations and utilities for handling different kinds of types,
@@ -860,7 +861,7 @@ public static JavaType fromField(Field field) {
      * 
{@code
      * public class Example {
      *     public Map getExampleMap() {
-     *         return new HashMap<>();
+     *         return newHashMap();
      *     }
      *
      *     public static void main(String[] args) {
@@ -892,7 +893,7 @@ public static JavaType fromMethodReturnType(Class declaredClass, String metho
      * 
{@code
      * public class Example {
      *     public Map getExampleMap() {
-     *         return new HashMap<>();
+     *         return newHashMap();
      *     }
      *
      *     public static void main(String[] args) throws Throwable {
diff --git a/microsphere-java-core/src/main/java/io/microsphere/reflect/MethodUtils.java b/microsphere-java-core/src/main/java/io/microsphere/reflect/MethodUtils.java
index cb5d7cef7..796fe7d1f 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/reflect/MethodUtils.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/reflect/MethodUtils.java
@@ -567,7 +567,7 @@ public static List findMethods(Class targetClass, boolean includeInhe
         }
 
         // All methods
-        LinkedList allMethods = new LinkedList<>();
+        LinkedList allMethods = newLinkedList();
 
         if (includeInheritedTypes) {
             while (targetClass != null) {
diff --git a/microsphere-java-core/src/main/java/io/microsphere/reflect/ReflectionUtils.java b/microsphere-java-core/src/main/java/io/microsphere/reflect/ReflectionUtils.java
index c38289668..7ab6b1c38 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/reflect/ReflectionUtils.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/reflect/ReflectionUtils.java
@@ -37,6 +37,7 @@
 import static java.lang.reflect.Array.getLength;
 import static java.util.Collections.emptyMap;
 import static java.util.Collections.unmodifiableMap;
+import static io.microsphere.collection.ListUtils.*;
 
 /**
  * Reflection Utility class , generic methods are defined from {@link FieldUtils} , {@link MethodUtils} , {@link
@@ -375,7 +376,7 @@ static String getCallerClassNameInSunReflectReflection() {
     @Nonnull
     public static  List toList(Object array) throws IllegalArgumentException {
         int length = getLength(array);
-        ArrayList list = new ArrayList<>(length);
+        ArrayList list = newArrayList(length);
         for (int i = 0; i < length; i++) {
             Object element = get(array, i);
             list.add((T) toObject(element));
diff --git a/microsphere-java-core/src/main/java/io/microsphere/reflect/TypeUtils.java b/microsphere-java-core/src/main/java/io/microsphere/reflect/TypeUtils.java
index 7aa07213b..987a6651e 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/reflect/TypeUtils.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/reflect/TypeUtils.java
@@ -67,6 +67,7 @@
 import static java.util.stream.Collectors.toSet;
 import static java.util.stream.Stream.of;
 import static java.util.stream.StreamSupport.stream;
+import static io.microsphere.collection.SetUtils.*;
 
 /**
  * The utilities class for {@link Type}
@@ -174,7 +175,7 @@ public static boolean isObjectType(Object type) {
      * 
{@code
      * TypeUtils.isParameterizedType(List.class); // returns false (raw type)
      * TypeUtils.isParameterizedType(ArrayList.class); // returns false (raw type)
-     * TypeUtils.isParameterizedType(new ArrayList().getClass().getGenericSuperclass()); // returns true
+     * TypeUtils.isParameterizedType(newArrayList().getClass().getGenericSuperclass()); // returns true
      * TypeUtils.isParameterizedType(null); // returns false
      * }
* @@ -264,7 +265,7 @@ public static boolean isGenericArrayType(Object type) { * * TypeUtils.isActualType(Example.class); // returns true (Class) * - * ParameterizedType listType = (ParameterizedType) new ArrayList().getClass().getGenericSuperclass(); + * ParameterizedType listType = (ParameterizedType) newArrayList().getClass().getGenericSuperclass(); * TypeUtils.isActualType(listType); // returns true (ParameterizedType) * * TypeVariable typeVar = List.class.getTypeParameters()[0]; @@ -297,7 +298,7 @@ public static boolean isActualType(Type type) { *
{@code
      * TypeUtils.getRawType(List.class); // returns List.class
      *
-     * ParameterizedType parameterizedType = (ParameterizedType) new ArrayList().getClass().getGenericSuperclass();
+     * ParameterizedType parameterizedType = (ParameterizedType) newArrayList().getClass().getGenericSuperclass();
      * TypeUtils.getRawType(parameterizedType); // returns List.class
      *
      * TypeUtils.getRawType(String.class); // returns String.class
@@ -327,7 +328,7 @@ public static Type getRawType(Type type) {
      * 
{@code
      * TypeUtils.getRawClass(List.class); // returns List.class
      *
-     * ParameterizedType parameterizedType = (ParameterizedType) new ArrayList().getClass().getGenericSuperclass();
+     * ParameterizedType parameterizedType = (ParameterizedType) newArrayList().getClass().getGenericSuperclass();
      * TypeUtils.getRawClass(parameterizedType); // returns List.class
      *
      * TypeUtils.getRawClass(String.class); // returns String.class
@@ -352,12 +353,12 @@ public static Class getRawClass(Type type) {
      *
      * 

Example Usage

*
{@code
-     * Type listType = new ArrayList().getClass().getGenericSuperclass(); // ParameterizedType for List
+     * Type listType = newArrayList().getClass().getGenericSuperclass(); // ParameterizedType for List
      * Type superType = List.class;
      *
      * boolean assignable1 = TypeUtils.isAssignableFrom(superType, listType); // returns true
      *
-     * Type mapType = new HashMap().getClass().getGenericSuperclass(); // ParameterizedType for AbstractMap
+     * Type mapType = newHashMap().getClass().getGenericSuperclass(); // ParameterizedType for AbstractMap
      * Type superType2 = Map.class;
      *
      * boolean assignable2 = TypeUtils.isAssignableFrom(superType2, mapType); // returns true
@@ -386,7 +387,7 @@ public static boolean isAssignableFrom(Type superType, Type targetType) {
      * 

Example Usage

*
{@code
      * Class superClass = List.class;
-     * Type targetType = new ArrayList().getClass().getGenericSuperclass(); // ParameterizedType for List
+     * Type targetType = newArrayList().getClass().getGenericSuperclass(); // ParameterizedType for List
      *
      * boolean isAssignable = TypeUtils.isAssignableFrom(superClass, targetType); // returns true
      *
@@ -1114,7 +1115,7 @@ protected static List doGetHierarchicalTypes(Type type) {
      * 
{@code
      * TypeUtils.getClassName(String.class); // returns "java.lang.String"
      *
-     * ParameterizedType listType = (ParameterizedType) new ArrayList().getClass().getGenericSuperclass();
+     * ParameterizedType listType = (ParameterizedType) newArrayList().getClass().getGenericSuperclass();
      * TypeUtils.getClassName(listType); // returns "java.util.List"
      *
      * TypeUtils.getClassName(Integer.TYPE); // returns "int"
@@ -1144,10 +1145,10 @@ public static String getClassName(Type type) {
      *
      * 

Example Usage

*
{@code
-     * ParameterizedType listType = (ParameterizedType) new ArrayList().getClass().getGenericSuperclass();
-     * ParameterizedType mapType = (ParameterizedType) new HashMap().getClass().getGenericSuperclass();
+     * ParameterizedType listType = (ParameterizedType) newArrayList().getClass().getGenericSuperclass();
+     * ParameterizedType mapType = (ParameterizedType) newHashMap().getClass().getGenericSuperclass();
      *
-     * Set types = new HashSet<>();
+     * Set types = newHashSet();
      * types.add(listType);
      * types.add(mapType);
      * types.add(String.class);
@@ -1277,7 +1278,7 @@ public static List> resolveTypeArgumentClasses(Class targetClass) {
      * System.out.println(stringClass); // Output: class java.lang.String
      *
      * // Convert a parameterized type's raw type
-     * List list = new ArrayList<>();
+     * List list = newArrayList();
      * ParameterizedType parameterizedType = (ParameterizedType) list.getClass().getGenericSuperclass();
      * Class listClass = TypeUtils.asClass(parameterizedType);
      * System.out.println(listClass); // Output: interface java.util.List
@@ -1359,7 +1360,7 @@ public static GenericArrayType asGenericArrayType(Type type) {
      *
      * 

Example Usage

*
{@code
-     * List list = new ArrayList<>();
+     * List list = newArrayList();
      * ParameterizedType parameterizedType = (ParameterizedType) list.getClass().getGenericSuperclass();
      *
      * // Convert a parameterized type
@@ -1409,7 +1410,7 @@ public static ParameterizedType asParameterizedType(Type type) {
      * System.out.println(fromRawClass == null); // Output: true
      *
      * // Trying to convert a ParameterizedType returns null
-     * List list = new ArrayList<>();
+     * List list = newArrayList();
      * ParameterizedType parameterizedType = (ParameterizedType) list.getClass().getGenericSuperclass();
      * TypeVariable fromParameterized = TypeUtils.asTypeVariable(parameterizedType);
      * System.out.println(fromParameterized == null); // Output: true
@@ -1449,7 +1450,7 @@ public static TypeVariable asTypeVariable(Type type) {
      * System.out.println(fromRawClass == null); // Output: true
      *
      * // Trying to convert a ParameterizedType returns null
-     * List list = new ArrayList<>();
+     * List list = newArrayList();
      * ParameterizedType parameterizedType = (ParameterizedType) list.getClass().getGenericSuperclass();
      * WildcardType fromParameterized = TypeUtils.asWildcardType(parameterizedType);
      * System.out.println(fromParameterized == null); // Output: true
@@ -1526,7 +1527,7 @@ public static Type getComponentType(Type type) {
      * 
{@code
      * TypeUtils.getTypeName(String.class); // returns "java.lang.String"
      *
-     * ParameterizedType listType = (ParameterizedType) new ArrayList().getClass().getGenericSuperclass();
+     * ParameterizedType listType = (ParameterizedType) newArrayList().getClass().getGenericSuperclass();
      * TypeUtils.getTypeName(listType); // returns "java.util.List"
      *
      * TypeUtils.getTypeName(Integer.TYPE); // returns "int"
@@ -1553,8 +1554,8 @@ public static String getTypeName(@Nullable Type type) {
      *
      * 

Example Usage

*
{@code
-     * Type listType = new ArrayList().getClass().getGenericSuperclass(); // ParameterizedType for List
-     * Type mapType = new HashMap().getClass().getGenericSuperclass(); // ParameterizedType for AbstractMap
+     * Type listType = newArrayList().getClass().getGenericSuperclass(); // ParameterizedType for List
+     * Type mapType = newHashMap().getClass().getGenericSuperclass(); // ParameterizedType for AbstractMap
      *
      * String[] typeNames = TypeUtils.getTypeNames(listType, mapType, String.class);
      * // Possible output: ["java.util.List", "java.util.AbstractMap", "java.lang.String"]
diff --git a/microsphere-java-core/src/main/java/io/microsphere/util/AnnotationUtils.java b/microsphere-java-core/src/main/java/io/microsphere/util/AnnotationUtils.java
index aabde9319..c90768627 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/util/AnnotationUtils.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/util/AnnotationUtils.java
@@ -853,7 +853,7 @@ public static List findAllDeclaredAnnotations(Class type, Predica
             return emptyList();
         }
 
-        LinkedList allAnnotations = new LinkedList<>();
+        LinkedList allAnnotations = newLinkedList();
         List> allInheritedClasses = findAllInheritedClasses(type, NON_OBJECT_CLASS_FILTER);
 
         // Add the declared annotations
diff --git a/microsphere-java-core/src/main/java/io/microsphere/util/ClassLoaderUtils.java b/microsphere-java-core/src/main/java/io/microsphere/util/ClassLoaderUtils.java
index 6641bb58a..f87b0b3b3 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/util/ClassLoaderUtils.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/util/ClassLoaderUtils.java
@@ -1269,7 +1269,7 @@ public static Set> findLoadedClassesInClassPath(@Nullable ClassLoader c
      * 

Example Usage

*
{@code
      * // Example 1: Find loaded classes from specific class paths using a custom ClassLoader
-     * Set classPaths = new HashSet<>(Arrays.asList("path/to/classes", "lib/dependency.jar"));
+     * Set classPaths = newHashSet(Arrays.asList("path/to/classes", "lib/dependency.jar"));
      * ClassLoader customClassLoader = MyCustomClassLoader.getInstance();
      * try {
      *     Set> loadedClasses = ClassLoaderUtils.findLoadedClassesInClassPaths(customClassLoader, classPaths);
@@ -1281,7 +1281,7 @@ public static Set> findLoadedClassesInClassPath(@Nullable ClassLoader c
      *
      * 
{@code
      * // Example 2: Use the default ClassLoader to find loaded classes from specific class paths
-     * Set classPaths = new HashSet<>(Arrays.asList("com/example/app", "libs/utils.jar"));
+     * Set classPaths = newHashSet(Arrays.asList("com/example/app", "libs/utils.jar"));
      * try {
      *     Set> loadedClasses = ClassLoaderUtils.findLoadedClassesInClassPaths(null, classPaths);
      *     System.out.println("Loaded Classes: " + loadedClasses);
diff --git a/microsphere-java-core/src/main/java/io/microsphere/util/ClassUtils.java b/microsphere-java-core/src/main/java/io/microsphere/util/ClassUtils.java
index 7ee674dd2..c15f1aa32 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/util/ClassUtils.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/util/ClassUtils.java
@@ -84,6 +84,7 @@
 import static java.util.Collections.synchronizedMap;
 import static java.util.Collections.unmodifiableMap;
 import static java.util.Collections.unmodifiableSet;
+import static io.microsphere.collection.ListUtils.*;
 
 /**
  * {@link Class} utility class
@@ -596,7 +597,7 @@ public static boolean isFinal(@Nullable Class type) {
      * 
{@code
      * boolean result1 = ClassUtils.isSimpleType("Hello");  // returns true
      * boolean result2 = ClassUtils.isSimpleType(123);      // returns true
-     * boolean result3 = ClassUtils.isSimpleType(new ArrayList<>()); // returns false
+     * boolean result3 = ClassUtils.isSimpleType(newArrayList()); // returns false
      * boolean result4 = ClassUtils.isSimpleType(null);     // returns false
      * }
* diff --git a/microsphere-java-core/src/main/java/io/microsphere/util/PriorityComparator.java b/microsphere-java-core/src/main/java/io/microsphere/util/PriorityComparator.java index 0b5591c07..7805ddd52 100644 --- a/microsphere-java-core/src/main/java/io/microsphere/util/PriorityComparator.java +++ b/microsphere-java-core/src/main/java/io/microsphere/util/PriorityComparator.java @@ -24,6 +24,7 @@ import static io.microsphere.util.AnnotationUtils.findAnnotation; import static io.microsphere.util.ClassLoaderUtils.resolveClass; import static io.microsphere.util.ClassUtils.getType; +import static io.microsphere.collection.ListUtils.*; /** * A {@link Comparator} implementation that sorts objects based on the value of the @@ -35,7 +36,7 @@ * *

Example Usage

*
{@code
- * List list = new ArrayList<>();
+ * List list = newArrayList();
  * list.add(new HighPriorityService());
  * list.add(new LowPriorityService());
  * Collections.sort(list, PriorityComparator.INSTANCE);
diff --git a/microsphere-java-core/src/main/java/io/microsphere/util/StopWatch.java b/microsphere-java-core/src/main/java/io/microsphere/util/StopWatch.java
index 9efdfb896..1734edf2e 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/util/StopWatch.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/util/StopWatch.java
@@ -28,6 +28,7 @@
 import static java.util.Collections.unmodifiableList;
 import static java.util.Objects.hash;
 import static java.util.concurrent.TimeUnit.NANOSECONDS;
+import static io.microsphere.collection.ListUtils.*;
 
 /**
  * 

{@code StopWatch} provides a simple way to measure execution time for tasks, supporting nested task tracking. @@ -80,12 +81,12 @@ public class StopWatch { /** * Running tasks(FIFO) */ - private final List runningTasks = new LinkedList<>(); + private final List runningTasks = newLinkedList(); /** * Completed tasks(FILO) */ - private final List completedTasks = new LinkedList<>(); + private final List completedTasks = newLinkedList(); /** * Total running time. diff --git a/microsphere-java-core/src/main/java/io/microsphere/util/StringUtils.java b/microsphere-java-core/src/main/java/io/microsphere/util/StringUtils.java index b4db24362..5c8c27c8e 100644 --- a/microsphere-java-core/src/main/java/io/microsphere/util/StringUtils.java +++ b/microsphere-java-core/src/main/java/io/microsphere/util/StringUtils.java @@ -32,6 +32,7 @@ import static java.lang.Character.toLowerCase; import static java.lang.Character.toUpperCase; import static java.lang.String.valueOf; +import static io.microsphere.collection.ListUtils.*; /** * The utilities class for {@link String} @@ -169,7 +170,7 @@ public static String[] split(@Nullable String value, @Nullable String delimiter) int delimiterLength = delimiter.length(); - ArrayList result = new ArrayList<>(); + ArrayList result = newArrayList(); if (delimiterLength == 0) { for (int i = 0; i < length; i++) { @@ -822,7 +823,7 @@ public static String uncapitalize(String str) { *

Example Usage

*
{@code
      * StringUtils.toStringArray(null)               = []
-     * StringUtils.toStringArray(new ArrayList<>())  = []
+     * StringUtils.toStringArray(newArrayList())  = []
      * StringUtils.toStringArray(Arrays.asList("a", "b", "c")) = ["a", "b", "c"]
      * }
* diff --git a/microsphere-java-core/src/main/java/io/microsphere/util/jar/JarUtils.java b/microsphere-java-core/src/main/java/io/microsphere/util/jar/JarUtils.java index cec66d059..2a8a476ab 100644 --- a/microsphere-java-core/src/main/java/io/microsphere/util/jar/JarUtils.java +++ b/microsphere-java-core/src/main/java/io/microsphere/util/jar/JarUtils.java @@ -215,7 +215,7 @@ public static List filter(JarFile jarFile, JarEntryFilter jarEntryFilt @Nonnull @Immutable protected static List doFilter(Iterable jarEntries, JarEntryFilter jarEntryFilter) { - LinkedList jarEntriesList = new LinkedList<>(); + LinkedList jarEntriesList = newLinkedList(); for (JarEntry jarEntry : jarEntries) { if (jarEntryFilter == null || jarEntryFilter.accept(jarEntry)) { jarEntriesList.add(jarEntry); From deb3c95d0bd5667c744e7207f9af3f25c68381be Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 30 May 2026 06:40:31 +0000 Subject: [PATCH 2/5] Fix wildcard imports and JavaDoc examples (excluding utility classes) --- .../classloading/ArtifactDetector.java | 2 +- .../BannedArtifactClassLoadingExecutor.java | 2 +- .../microsphere/collection/AbstractDeque.java | 3 +- .../collection/CollectionUtils.java | 4 +- .../collection/UnmodifiableDeque.java | 3 +- .../collection/UnmodifiableQueue.java | 3 +- .../event/AbstractEventDispatcher.java | 2 +- .../event/GenericEventListener.java | 2 +- .../java/io/microsphere/event/Listenable.java | 2 +- .../io/microsphere/filter/FilterUtils.java | 2 +- .../io/StandardFileWatchService.java | 2 +- .../java/io/microsphere/json/JSONObject.java | 2 +- .../io/microsphere/json/JSONStringer.java | 2 +- .../java/io/microsphere/lang/Prioritized.java | 3 +- .../io/microsphere/lang/function/Streams.java | 8 ++-- .../management/builder/MBeanInfoBuilder.java | 2 +- .../ConfigurationPropertyGenerator.java | 3 +- .../ExtendableProtocolURLStreamHandler.java | 2 +- .../java/io/microsphere/net/URLUtils.java | 2 +- .../java/io/microsphere/reflect/JavaType.java | 5 +-- .../microsphere/reflect/ReflectionUtils.java | 2 +- .../io/microsphere/reflect/TypeUtils.java | 37 +++++++++---------- .../io/microsphere/util/ClassLoaderUtils.java | 4 +- .../java/io/microsphere/util/ClassUtils.java | 3 +- .../microsphere/util/PriorityComparator.java | 3 +- .../java/io/microsphere/util/StopWatch.java | 2 +- .../java/io/microsphere/util/StringUtils.java | 4 +- 27 files changed, 51 insertions(+), 60 deletions(-) diff --git a/microsphere-java-core/src/main/java/io/microsphere/classloading/ArtifactDetector.java b/microsphere-java-core/src/main/java/io/microsphere/classloading/ArtifactDetector.java index 43c5a79ed..189477ba9 100644 --- a/microsphere-java-core/src/main/java/io/microsphere/classloading/ArtifactDetector.java +++ b/microsphere-java-core/src/main/java/io/microsphere/classloading/ArtifactDetector.java @@ -25,7 +25,7 @@ import static io.microsphere.util.SystemUtils.JAVA_HOME; import static java.util.Collections.emptyList; import static java.util.Collections.unmodifiableList; -import static io.microsphere.collection.SetUtils.*; +import static io.microsphere.collection.SetUtils.newLinkedHashSet; /** * The {@code ArtifactDetector} class is responsible for detecting and resolving artifacts from the classpath. diff --git a/microsphere-java-core/src/main/java/io/microsphere/classloading/BannedArtifactClassLoadingExecutor.java b/microsphere-java-core/src/main/java/io/microsphere/classloading/BannedArtifactClassLoadingExecutor.java index 3da851070..7048afe74 100644 --- a/microsphere-java-core/src/main/java/io/microsphere/classloading/BannedArtifactClassLoadingExecutor.java +++ b/microsphere-java-core/src/main/java/io/microsphere/classloading/BannedArtifactClassLoadingExecutor.java @@ -18,7 +18,7 @@ import static io.microsphere.util.StringUtils.isBlank; import static io.microsphere.util.StringUtils.split; import static io.microsphere.util.SystemUtils.FILE_ENCODING; -import static io.microsphere.collection.ListUtils.*; +import static io.microsphere.collection.ListUtils.newLinkedList; /** * The executor for the banned artifacts that are loading by {@link ClassLoader}. diff --git a/microsphere-java-core/src/main/java/io/microsphere/collection/AbstractDeque.java b/microsphere-java-core/src/main/java/io/microsphere/collection/AbstractDeque.java index d1fcd68d4..ff62b88e1 100644 --- a/microsphere-java-core/src/main/java/io/microsphere/collection/AbstractDeque.java +++ b/microsphere-java-core/src/main/java/io/microsphere/collection/AbstractDeque.java @@ -19,7 +19,6 @@ import java.util.AbstractQueue; import java.util.Deque; import java.util.NoSuchElementException; -import static io.microsphere.collection.ListUtils.*; /** * Abstract {@link Deque} implementation that provides default implementations for some of the @@ -35,7 +34,7 @@ *

Example Usage

*
{@code
  * public class SimpleDeque extends AbstractDeque {
- *     private final List list = newArrayList();
+ *     private final List list = new ArrayList<>();
  *
  *     public void addFirst(E e) {
  *         list.add(0, e);
diff --git a/microsphere-java-core/src/main/java/io/microsphere/collection/CollectionUtils.java b/microsphere-java-core/src/main/java/io/microsphere/collection/CollectionUtils.java
index 385a9e449..0cf6c7ae3 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/collection/CollectionUtils.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/collection/CollectionUtils.java
@@ -440,7 +440,7 @@ public static boolean equals(@Nullable Collection one, @Nullable CollectionExample Usage
      * 
{@code
-     * Collection collection = newArrayList();
+     * Collection collection = new ArrayList<>();
      * int count1 = CollectionUtils.addAll(collection, "a", "b", "c"); // returns 3
      *
      * int count2 = CollectionUtils.addAll(null, "a", "b"); // returns 0
@@ -486,7 +486,7 @@ public static  int addAll(@Nullable Collection collection, T... newValues)
      *
      * 

Example Usage

*
{@code
-     * Collection collection = newArrayList();
+     * Collection collection = new ArrayList<>();
      * Iterable values = Arrays.asList("a", "b", "c");
      * int count1 = CollectionUtils.addAll(collection, values); // returns 3
      *
diff --git a/microsphere-java-core/src/main/java/io/microsphere/collection/UnmodifiableDeque.java b/microsphere-java-core/src/main/java/io/microsphere/collection/UnmodifiableDeque.java
index 30495d17a..04630e7b2 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/collection/UnmodifiableDeque.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/collection/UnmodifiableDeque.java
@@ -24,7 +24,6 @@
 import java.util.Iterator;
 
 import static io.microsphere.collection.CollectionUtils.unmodifiableIterator;
-import static io.microsphere.collection.ListUtils.*;
 
 /**
  * An unmodifiable view of a {@link Deque}. This implementation decorates a given deque and prevents any
@@ -41,7 +40,7 @@
  * 

* *
{@code
- * Deque mutableDeque = newLinkedList();
+ * Deque mutableDeque = new LinkedList<>();
  * mutableDeque.addFirst("World");
  * Deque unmodifiableDeque = new UnmodifiableDeque<>(mutableDeque);
  * unmodifiableDeque.addFirst("Hello"); // throws UnsupportedOperationException
diff --git a/microsphere-java-core/src/main/java/io/microsphere/collection/UnmodifiableQueue.java b/microsphere-java-core/src/main/java/io/microsphere/collection/UnmodifiableQueue.java
index 9f2eb72b5..77729e8fe 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/collection/UnmodifiableQueue.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/collection/UnmodifiableQueue.java
@@ -29,7 +29,6 @@
 import java.util.stream.Stream;
 
 import static io.microsphere.collection.CollectionUtils.unmodifiableIterator;
-import static io.microsphere.collection.ListUtils.*;
 
 /**
  * An unmodifiable view of a {@link Queue}. This implementation decorates a given queue and prevents any
@@ -46,7 +45,7 @@
  * 

* *
{@code
- * Queue mutableQueue = newLinkedList();
+ * Queue mutableQueue = new LinkedList<>();
  * mutableQueue.add("Hello");
  * Queue unmodifiableQueue = new UnmodifiableQueue<>(mutableQueue);
  * unmodifiableQueue.add("World"); // throws UnsupportedOperationException
diff --git a/microsphere-java-core/src/main/java/io/microsphere/event/AbstractEventDispatcher.java b/microsphere-java-core/src/main/java/io/microsphere/event/AbstractEventDispatcher.java
index 40cd1f367..7f4e865e7 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/event/AbstractEventDispatcher.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/event/AbstractEventDispatcher.java
@@ -40,7 +40,7 @@
 import static io.microsphere.util.ServiceLoaderUtils.loadServicesList;
 import static java.util.Collections.sort;
 import static java.util.Collections.unmodifiableList;
-import static io.microsphere.collection.ListUtils.*;
+import static io.microsphere.collection.ListUtils.newLinkedList;
 
 /**
  * Abstract implementation of {@link EventDispatcher} that provides common functionality for dispatching events to
diff --git a/microsphere-java-core/src/main/java/io/microsphere/event/GenericEventListener.java b/microsphere-java-core/src/main/java/io/microsphere/event/GenericEventListener.java
index 1966c0454..55cdff04a 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/event/GenericEventListener.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/event/GenericEventListener.java
@@ -29,7 +29,7 @@
 import static io.microsphere.lang.function.ThrowableConsumer.execute;
 import static java.util.Collections.emptySet;
 import static java.util.stream.Stream.of;
-import static io.microsphere.collection.SetUtils.*;
+import static io.microsphere.collection.SetUtils.newLinkedHashSet;
 
 /**
  * A generic implementation of the {@link EventListener} interface that supports multiple event handling methods.
diff --git a/microsphere-java-core/src/main/java/io/microsphere/event/Listenable.java b/microsphere-java-core/src/main/java/io/microsphere/event/Listenable.java
index c937f500f..fe037b5f0 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/event/Listenable.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/event/Listenable.java
@@ -27,7 +27,7 @@
 import static io.microsphere.util.ClassUtils.getTypeName;
 import static java.lang.reflect.Modifier.isFinal;
 import static java.util.stream.StreamSupport.stream;
-import static io.microsphere.collection.ListUtils.*;
+import static io.microsphere.collection.ListUtils.newArrayList;
 
 /**
  * A component that allows registration and management of {@link EventListener} instances.
diff --git a/microsphere-java-core/src/main/java/io/microsphere/filter/FilterUtils.java b/microsphere-java-core/src/main/java/io/microsphere/filter/FilterUtils.java
index 6dfda1453..d13724127 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/filter/FilterUtils.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/filter/FilterUtils.java
@@ -12,7 +12,7 @@
 import java.util.List;
 
 import static java.util.Collections.unmodifiableList;
-import static io.microsphere.collection.ListUtils.*;
+import static io.microsphere.collection.ListUtils.newArrayList;
 
 /**
  * Utility class for working with {@link Filter} instances.
diff --git a/microsphere-java-core/src/main/java/io/microsphere/io/StandardFileWatchService.java b/microsphere-java-core/src/main/java/io/microsphere/io/StandardFileWatchService.java
index b6ccdcf7c..23c1579e0 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/io/StandardFileWatchService.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/io/StandardFileWatchService.java
@@ -63,7 +63,7 @@
 import static java.nio.file.StandardWatchEventKinds.ENTRY_MODIFY;
 import static java.util.concurrent.Executors.newSingleThreadExecutor;
 import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import static io.microsphere.collection.SetUtils.*;
+import static io.microsphere.collection.SetUtils.newTreeSet;
 
 /**
  * /**
diff --git a/microsphere-java-core/src/main/java/io/microsphere/json/JSONObject.java b/microsphere-java-core/src/main/java/io/microsphere/json/JSONObject.java
index c1d3c0268..3aed8813e 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/json/JSONObject.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/json/JSONObject.java
@@ -43,7 +43,7 @@
 import static io.microsphere.util.ClassUtils.isEnum;
 import static io.microsphere.util.ClassUtils.isNumber;
 import static io.microsphere.util.ClassUtils.isWrapperType;
-import static io.microsphere.collection.ListUtils.*;
+import static io.microsphere.collection.ListUtils.newArrayList;
 
 /**
  * A modifiable set of name/value mappings. Names are unique, non-null strings. Values may
diff --git a/microsphere-java-core/src/main/java/io/microsphere/json/JSONStringer.java b/microsphere-java-core/src/main/java/io/microsphere/json/JSONStringer.java
index 8ea9c1adc..98711c612 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/json/JSONStringer.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/json/JSONStringer.java
@@ -29,7 +29,7 @@
 import static io.microsphere.util.ClassUtils.getTypeName;
 import static java.lang.String.format;
 import static java.util.Arrays.fill;
-import static io.microsphere.collection.ListUtils.*;
+import static io.microsphere.collection.ListUtils.newArrayList;
 
 /**
  * Implements {@link JSONObject#toString} and {@link JSONArray#toString}. Most application
diff --git a/microsphere-java-core/src/main/java/io/microsphere/lang/Prioritized.java b/microsphere-java-core/src/main/java/io/microsphere/lang/Prioritized.java
index d26c8ee5e..b369e3840 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/lang/Prioritized.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/lang/Prioritized.java
@@ -21,7 +21,6 @@
 import static java.lang.Integer.MAX_VALUE;
 import static java.lang.Integer.MIN_VALUE;
 import static java.lang.Integer.compare;
-import static io.microsphere.collection.ListUtils.*;
 
 /**
  * {@code Prioritized} interface can be implemented by objects that
@@ -46,7 +45,7 @@
  * }
  *
  * // Sorting a list of Prioritized objects
- * List tasks = newArrayList();
+ * List tasks = new ArrayList<>();
  * tasks.add(new MyTask(5));
  * tasks.add(new MyTask(1));
  * Collections.sort(tasks);
diff --git a/microsphere-java-core/src/main/java/io/microsphere/lang/function/Streams.java b/microsphere-java-core/src/main/java/io/microsphere/lang/function/Streams.java
index ce140ca8f..863566055 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/lang/function/Streams.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/lang/function/Streams.java
@@ -255,7 +255,7 @@ static > Set filterSet(S values, PredicateExample Usage with Set
      * 
{@code
-     * Set names = newLinkedHashSet(Arrays.asList("Alice", "Bob", "Charlie", "Anna"));
+     * Set names = new LinkedHashSet<>(Arrays.asList("Alice", "Bob", "Charlie", "Anna"));
      * Set filteredSet = Streams.filter(names, name -> name.startsWith("A"));
      * System.out.println(filteredSet);  // Output: [Alice, Anna]
      * }
@@ -291,7 +291,7 @@ static > S filter(S values, Predicate predic * *

Example Usage with Set

*
{@code
-     * Set names = newLinkedHashSet(Arrays.asList("Alice", "Anna", "Bob", "Andrew"));
+     * Set names = new LinkedHashSet<>(Arrays.asList("Alice", "Anna", "Bob", "Andrew"));
      * Set filtered = Streams.filterAll(names,
      *     name -> name.startsWith("A"),
      *     name -> name.length() > 4
@@ -385,7 +385,7 @@ static  Set filterAllSet(T[] values, Predicate... predicates) {
      *
      * 

Example Usage with Set

*
{@code
-     * Set names = newLinkedHashSet(Arrays.asList("Alice", "Anna", "Bob", "Andrew"));
+     * Set names = new LinkedHashSet<>(Arrays.asList("Alice", "Anna", "Bob", "Andrew"));
      * Set filtered = Streams.filterAny(names,
      *     name -> name.startsWith("B"),
      *     name -> name.length() <= 3
@@ -484,7 +484,7 @@ static  Set filterAnySet(T[] values, Predicate... predicates) {
      *
      * 

Example Usage with Set

*
{@code
-     * Set names = newLinkedHashSet(Arrays.asList("Alice", "Anna", "Bob", "Andrew"));
+     * Set names = new LinkedHashSet<>(Arrays.asList("Alice", "Anna", "Bob", "Andrew"));
      * String result = Streams.filterFirst(names,
      *     name -> name.startsWith("A"),
      *     name -> name.length() > 4
diff --git a/microsphere-java-core/src/main/java/io/microsphere/management/builder/MBeanInfoBuilder.java b/microsphere-java-core/src/main/java/io/microsphere/management/builder/MBeanInfoBuilder.java
index 6ad908cb2..b0538c6fa 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/management/builder/MBeanInfoBuilder.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/management/builder/MBeanInfoBuilder.java
@@ -37,7 +37,7 @@
 import static io.microsphere.reflect.MethodUtils.isIsMethod;
 import static io.microsphere.util.ClassUtils.getTypeName;
 import static java.util.Objects.nonNull;
-import static io.microsphere.collection.ListUtils.*;
+import static io.microsphere.collection.ListUtils.newLinkedList;
 
 /**
  * The {@link MBeanInfo} Builder
diff --git a/microsphere-java-core/src/main/java/io/microsphere/metadata/ConfigurationPropertyGenerator.java b/microsphere-java-core/src/main/java/io/microsphere/metadata/ConfigurationPropertyGenerator.java
index 1b42522ee..a45956fc0 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/metadata/ConfigurationPropertyGenerator.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/metadata/ConfigurationPropertyGenerator.java
@@ -20,7 +20,6 @@
 import io.microsphere.annotation.Nonnull;
 import io.microsphere.beans.ConfigurationProperty;
 import io.microsphere.lang.Prioritized;
-import static io.microsphere.collection.ListUtils.*;
 
 /**
  * {@code ConfigurationPropertyGenerator} interface can be implemented by objects that
@@ -44,7 +43,7 @@
  * }
  *
  * // Registering and using generators
- * List generators = newArrayList();
+ * List generators = new ArrayList<>();
  * generators.add(new JsonPropertyGenerator());
  * Collections.sort(generators); // Sort by priority
  * }
diff --git a/microsphere-java-core/src/main/java/io/microsphere/net/ExtendableProtocolURLStreamHandler.java b/microsphere-java-core/src/main/java/io/microsphere/net/ExtendableProtocolURLStreamHandler.java index ce22fb6cb..c9eed2744 100644 --- a/microsphere-java-core/src/main/java/io/microsphere/net/ExtendableProtocolURLStreamHandler.java +++ b/microsphere-java-core/src/main/java/io/microsphere/net/ExtendableProtocolURLStreamHandler.java @@ -50,7 +50,7 @@ import static java.lang.System.setProperty; import static java.net.Proxy.NO_PROXY; import static java.util.Collections.sort; -import static io.microsphere.collection.ListUtils.*; +import static io.microsphere.collection.ListUtils.newArrayList; /** * Extendable Protocol {@link URLStreamHandler} class supports the sub-protocols, diff --git a/microsphere-java-core/src/main/java/io/microsphere/net/URLUtils.java b/microsphere-java-core/src/main/java/io/microsphere/net/URLUtils.java index 14afeb3be..b504c9679 100644 --- a/microsphere-java-core/src/main/java/io/microsphere/net/URLUtils.java +++ b/microsphere-java-core/src/main/java/io/microsphere/net/URLUtils.java @@ -818,7 +818,7 @@ public static String buildURI(String... paths) { *

Example Usage

*
{@code
      * // Example 1: Basic usage with multiple parameters
-     * Map> matrixParams = newLinkedHashMap();
+     * Map> matrixParams = new LinkedHashMap<>();
      * matrixParams.put("key1", Arrays.asList("valueA", "valueB"));
      * matrixParams.put("key2", Collections.singletonList("valueC"));
      * matrixParams.put("_sp", Arrays.asList("subproto1", "subproto2")); // This will be skipped
diff --git a/microsphere-java-core/src/main/java/io/microsphere/reflect/JavaType.java b/microsphere-java-core/src/main/java/io/microsphere/reflect/JavaType.java
index 19c3cebe8..efad76a35 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/reflect/JavaType.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/reflect/JavaType.java
@@ -52,7 +52,6 @@
 import static io.microsphere.util.ArrayUtils.asArray;
 import static io.microsphere.util.ArrayUtils.length;
 import static java.util.Objects.hash;
-import static io.microsphere.collection.MapUtils.*;
 
 /**
  * Represents a Java type, encapsulating various operations and utilities for handling different kinds of types,
@@ -861,7 +860,7 @@ public static JavaType fromField(Field field) {
      * 
{@code
      * public class Example {
      *     public Map getExampleMap() {
-     *         return newHashMap();
+     *         return new HashMap<>();
      *     }
      *
      *     public static void main(String[] args) {
@@ -893,7 +892,7 @@ public static JavaType fromMethodReturnType(Class declaredClass, String metho
      * 
{@code
      * public class Example {
      *     public Map getExampleMap() {
-     *         return newHashMap();
+     *         return new HashMap<>();
      *     }
      *
      *     public static void main(String[] args) throws Throwable {
diff --git a/microsphere-java-core/src/main/java/io/microsphere/reflect/ReflectionUtils.java b/microsphere-java-core/src/main/java/io/microsphere/reflect/ReflectionUtils.java
index 7ab6b1c38..277daf929 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/reflect/ReflectionUtils.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/reflect/ReflectionUtils.java
@@ -37,7 +37,7 @@
 import static java.lang.reflect.Array.getLength;
 import static java.util.Collections.emptyMap;
 import static java.util.Collections.unmodifiableMap;
-import static io.microsphere.collection.ListUtils.*;
+import static io.microsphere.collection.ListUtils.newArrayList;
 
 /**
  * Reflection Utility class , generic methods are defined from {@link FieldUtils} , {@link MethodUtils} , {@link
diff --git a/microsphere-java-core/src/main/java/io/microsphere/reflect/TypeUtils.java b/microsphere-java-core/src/main/java/io/microsphere/reflect/TypeUtils.java
index 987a6651e..83271c7ea 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/reflect/TypeUtils.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/reflect/TypeUtils.java
@@ -67,7 +67,6 @@
 import static java.util.stream.Collectors.toSet;
 import static java.util.stream.Stream.of;
 import static java.util.stream.StreamSupport.stream;
-import static io.microsphere.collection.SetUtils.*;
 
 /**
  * The utilities class for {@link Type}
@@ -175,7 +174,7 @@ public static boolean isObjectType(Object type) {
      * 
{@code
      * TypeUtils.isParameterizedType(List.class); // returns false (raw type)
      * TypeUtils.isParameterizedType(ArrayList.class); // returns false (raw type)
-     * TypeUtils.isParameterizedType(newArrayList().getClass().getGenericSuperclass()); // returns true
+     * TypeUtils.isParameterizedType(new ArrayList<>().getClass().getGenericSuperclass()); // returns true
      * TypeUtils.isParameterizedType(null); // returns false
      * }
* @@ -265,7 +264,7 @@ public static boolean isGenericArrayType(Object type) { * * TypeUtils.isActualType(Example.class); // returns true (Class) * - * ParameterizedType listType = (ParameterizedType) newArrayList().getClass().getGenericSuperclass(); + * ParameterizedType listType = (ParameterizedType) new ArrayList<>().getClass().getGenericSuperclass(); * TypeUtils.isActualType(listType); // returns true (ParameterizedType) * * TypeVariable typeVar = List.class.getTypeParameters()[0]; @@ -298,7 +297,7 @@ public static boolean isActualType(Type type) { *
{@code
      * TypeUtils.getRawType(List.class); // returns List.class
      *
-     * ParameterizedType parameterizedType = (ParameterizedType) newArrayList().getClass().getGenericSuperclass();
+     * ParameterizedType parameterizedType = (ParameterizedType) new ArrayList<>().getClass().getGenericSuperclass();
      * TypeUtils.getRawType(parameterizedType); // returns List.class
      *
      * TypeUtils.getRawType(String.class); // returns String.class
@@ -328,7 +327,7 @@ public static Type getRawType(Type type) {
      * 
{@code
      * TypeUtils.getRawClass(List.class); // returns List.class
      *
-     * ParameterizedType parameterizedType = (ParameterizedType) newArrayList().getClass().getGenericSuperclass();
+     * ParameterizedType parameterizedType = (ParameterizedType) new ArrayList<>().getClass().getGenericSuperclass();
      * TypeUtils.getRawClass(parameterizedType); // returns List.class
      *
      * TypeUtils.getRawClass(String.class); // returns String.class
@@ -353,12 +352,12 @@ public static Class getRawClass(Type type) {
      *
      * 

Example Usage

*
{@code
-     * Type listType = newArrayList().getClass().getGenericSuperclass(); // ParameterizedType for List
+     * Type listType = new ArrayList<>().getClass().getGenericSuperclass(); // ParameterizedType for List
      * Type superType = List.class;
      *
      * boolean assignable1 = TypeUtils.isAssignableFrom(superType, listType); // returns true
      *
-     * Type mapType = newHashMap().getClass().getGenericSuperclass(); // ParameterizedType for AbstractMap
+     * Type mapType = new HashMap<>().getClass().getGenericSuperclass(); // ParameterizedType for AbstractMap
      * Type superType2 = Map.class;
      *
      * boolean assignable2 = TypeUtils.isAssignableFrom(superType2, mapType); // returns true
@@ -387,7 +386,7 @@ public static boolean isAssignableFrom(Type superType, Type targetType) {
      * 

Example Usage

*
{@code
      * Class superClass = List.class;
-     * Type targetType = newArrayList().getClass().getGenericSuperclass(); // ParameterizedType for List
+     * Type targetType = new ArrayList<>().getClass().getGenericSuperclass(); // ParameterizedType for List
      *
      * boolean isAssignable = TypeUtils.isAssignableFrom(superClass, targetType); // returns true
      *
@@ -1115,7 +1114,7 @@ protected static List doGetHierarchicalTypes(Type type) {
      * 
{@code
      * TypeUtils.getClassName(String.class); // returns "java.lang.String"
      *
-     * ParameterizedType listType = (ParameterizedType) newArrayList().getClass().getGenericSuperclass();
+     * ParameterizedType listType = (ParameterizedType) new ArrayList<>().getClass().getGenericSuperclass();
      * TypeUtils.getClassName(listType); // returns "java.util.List"
      *
      * TypeUtils.getClassName(Integer.TYPE); // returns "int"
@@ -1145,10 +1144,10 @@ public static String getClassName(Type type) {
      *
      * 

Example Usage

*
{@code
-     * ParameterizedType listType = (ParameterizedType) newArrayList().getClass().getGenericSuperclass();
-     * ParameterizedType mapType = (ParameterizedType) newHashMap().getClass().getGenericSuperclass();
+     * ParameterizedType listType = (ParameterizedType) new ArrayList<>().getClass().getGenericSuperclass();
+     * ParameterizedType mapType = (ParameterizedType) new HashMap<>().getClass().getGenericSuperclass();
      *
-     * Set types = newHashSet();
+     * Set types = new HashSet<>();
      * types.add(listType);
      * types.add(mapType);
      * types.add(String.class);
@@ -1278,7 +1277,7 @@ public static List> resolveTypeArgumentClasses(Class targetClass) {
      * System.out.println(stringClass); // Output: class java.lang.String
      *
      * // Convert a parameterized type's raw type
-     * List list = newArrayList();
+     * List list = new ArrayList<>();
      * ParameterizedType parameterizedType = (ParameterizedType) list.getClass().getGenericSuperclass();
      * Class listClass = TypeUtils.asClass(parameterizedType);
      * System.out.println(listClass); // Output: interface java.util.List
@@ -1360,7 +1359,7 @@ public static GenericArrayType asGenericArrayType(Type type) {
      *
      * 

Example Usage

*
{@code
-     * List list = newArrayList();
+     * List list = new ArrayList<>();
      * ParameterizedType parameterizedType = (ParameterizedType) list.getClass().getGenericSuperclass();
      *
      * // Convert a parameterized type
@@ -1410,7 +1409,7 @@ public static ParameterizedType asParameterizedType(Type type) {
      * System.out.println(fromRawClass == null); // Output: true
      *
      * // Trying to convert a ParameterizedType returns null
-     * List list = newArrayList();
+     * List list = new ArrayList<>();
      * ParameterizedType parameterizedType = (ParameterizedType) list.getClass().getGenericSuperclass();
      * TypeVariable fromParameterized = TypeUtils.asTypeVariable(parameterizedType);
      * System.out.println(fromParameterized == null); // Output: true
@@ -1450,7 +1449,7 @@ public static TypeVariable asTypeVariable(Type type) {
      * System.out.println(fromRawClass == null); // Output: true
      *
      * // Trying to convert a ParameterizedType returns null
-     * List list = newArrayList();
+     * List list = new ArrayList<>();
      * ParameterizedType parameterizedType = (ParameterizedType) list.getClass().getGenericSuperclass();
      * WildcardType fromParameterized = TypeUtils.asWildcardType(parameterizedType);
      * System.out.println(fromParameterized == null); // Output: true
@@ -1527,7 +1526,7 @@ public static Type getComponentType(Type type) {
      * 
{@code
      * TypeUtils.getTypeName(String.class); // returns "java.lang.String"
      *
-     * ParameterizedType listType = (ParameterizedType) newArrayList().getClass().getGenericSuperclass();
+     * ParameterizedType listType = (ParameterizedType) new ArrayList<>().getClass().getGenericSuperclass();
      * TypeUtils.getTypeName(listType); // returns "java.util.List"
      *
      * TypeUtils.getTypeName(Integer.TYPE); // returns "int"
@@ -1554,8 +1553,8 @@ public static String getTypeName(@Nullable Type type) {
      *
      * 

Example Usage

*
{@code
-     * Type listType = newArrayList().getClass().getGenericSuperclass(); // ParameterizedType for List
-     * Type mapType = newHashMap().getClass().getGenericSuperclass(); // ParameterizedType for AbstractMap
+     * Type listType = new ArrayList<>().getClass().getGenericSuperclass(); // ParameterizedType for List
+     * Type mapType = new HashMap<>().getClass().getGenericSuperclass(); // ParameterizedType for AbstractMap
      *
      * String[] typeNames = TypeUtils.getTypeNames(listType, mapType, String.class);
      * // Possible output: ["java.util.List", "java.util.AbstractMap", "java.lang.String"]
diff --git a/microsphere-java-core/src/main/java/io/microsphere/util/ClassLoaderUtils.java b/microsphere-java-core/src/main/java/io/microsphere/util/ClassLoaderUtils.java
index f87b0b3b3..6641bb58a 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/util/ClassLoaderUtils.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/util/ClassLoaderUtils.java
@@ -1269,7 +1269,7 @@ public static Set> findLoadedClassesInClassPath(@Nullable ClassLoader c
      * 

Example Usage

*
{@code
      * // Example 1: Find loaded classes from specific class paths using a custom ClassLoader
-     * Set classPaths = newHashSet(Arrays.asList("path/to/classes", "lib/dependency.jar"));
+     * Set classPaths = new HashSet<>(Arrays.asList("path/to/classes", "lib/dependency.jar"));
      * ClassLoader customClassLoader = MyCustomClassLoader.getInstance();
      * try {
      *     Set> loadedClasses = ClassLoaderUtils.findLoadedClassesInClassPaths(customClassLoader, classPaths);
@@ -1281,7 +1281,7 @@ public static Set> findLoadedClassesInClassPath(@Nullable ClassLoader c
      *
      * 
{@code
      * // Example 2: Use the default ClassLoader to find loaded classes from specific class paths
-     * Set classPaths = newHashSet(Arrays.asList("com/example/app", "libs/utils.jar"));
+     * Set classPaths = new HashSet<>(Arrays.asList("com/example/app", "libs/utils.jar"));
      * try {
      *     Set> loadedClasses = ClassLoaderUtils.findLoadedClassesInClassPaths(null, classPaths);
      *     System.out.println("Loaded Classes: " + loadedClasses);
diff --git a/microsphere-java-core/src/main/java/io/microsphere/util/ClassUtils.java b/microsphere-java-core/src/main/java/io/microsphere/util/ClassUtils.java
index c15f1aa32..7ee674dd2 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/util/ClassUtils.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/util/ClassUtils.java
@@ -84,7 +84,6 @@
 import static java.util.Collections.synchronizedMap;
 import static java.util.Collections.unmodifiableMap;
 import static java.util.Collections.unmodifiableSet;
-import static io.microsphere.collection.ListUtils.*;
 
 /**
  * {@link Class} utility class
@@ -597,7 +596,7 @@ public static boolean isFinal(@Nullable Class type) {
      * 
{@code
      * boolean result1 = ClassUtils.isSimpleType("Hello");  // returns true
      * boolean result2 = ClassUtils.isSimpleType(123);      // returns true
-     * boolean result3 = ClassUtils.isSimpleType(newArrayList()); // returns false
+     * boolean result3 = ClassUtils.isSimpleType(new ArrayList<>()); // returns false
      * boolean result4 = ClassUtils.isSimpleType(null);     // returns false
      * }
* diff --git a/microsphere-java-core/src/main/java/io/microsphere/util/PriorityComparator.java b/microsphere-java-core/src/main/java/io/microsphere/util/PriorityComparator.java index 7805ddd52..0b5591c07 100644 --- a/microsphere-java-core/src/main/java/io/microsphere/util/PriorityComparator.java +++ b/microsphere-java-core/src/main/java/io/microsphere/util/PriorityComparator.java @@ -24,7 +24,6 @@ import static io.microsphere.util.AnnotationUtils.findAnnotation; import static io.microsphere.util.ClassLoaderUtils.resolveClass; import static io.microsphere.util.ClassUtils.getType; -import static io.microsphere.collection.ListUtils.*; /** * A {@link Comparator} implementation that sorts objects based on the value of the @@ -36,7 +35,7 @@ * *

Example Usage

*
{@code
- * List list = newArrayList();
+ * List list = new ArrayList<>();
  * list.add(new HighPriorityService());
  * list.add(new LowPriorityService());
  * Collections.sort(list, PriorityComparator.INSTANCE);
diff --git a/microsphere-java-core/src/main/java/io/microsphere/util/StopWatch.java b/microsphere-java-core/src/main/java/io/microsphere/util/StopWatch.java
index 1734edf2e..2307e4e28 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/util/StopWatch.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/util/StopWatch.java
@@ -28,7 +28,7 @@
 import static java.util.Collections.unmodifiableList;
 import static java.util.Objects.hash;
 import static java.util.concurrent.TimeUnit.NANOSECONDS;
-import static io.microsphere.collection.ListUtils.*;
+import static io.microsphere.collection.ListUtils.newLinkedList;
 
 /**
  * 

{@code StopWatch} provides a simple way to measure execution time for tasks, supporting nested task tracking. diff --git a/microsphere-java-core/src/main/java/io/microsphere/util/StringUtils.java b/microsphere-java-core/src/main/java/io/microsphere/util/StringUtils.java index 5c8c27c8e..b623cd1a1 100644 --- a/microsphere-java-core/src/main/java/io/microsphere/util/StringUtils.java +++ b/microsphere-java-core/src/main/java/io/microsphere/util/StringUtils.java @@ -32,7 +32,7 @@ import static java.lang.Character.toLowerCase; import static java.lang.Character.toUpperCase; import static java.lang.String.valueOf; -import static io.microsphere.collection.ListUtils.*; +import static io.microsphere.collection.ListUtils.newArrayList; /** * The utilities class for {@link String} @@ -823,7 +823,7 @@ public static String uncapitalize(String str) { *

Example Usage

*
{@code
      * StringUtils.toStringArray(null)               = []
-     * StringUtils.toStringArray(newArrayList())  = []
+     * StringUtils.toStringArray(new ArrayList<>())  = []
      * StringUtils.toStringArray(Arrays.asList("a", "b", "c")) = ["a", "b", "c"]
      * }
* From fa0382578eaf7ffa96e3869d99a3a6990f6c114e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 30 May 2026 08:11:35 +0000 Subject: [PATCH 3/5] Rollback TypeUtils.java to previous state --- .../io/microsphere/reflect/TypeUtils.java | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/microsphere-java-core/src/main/java/io/microsphere/reflect/TypeUtils.java b/microsphere-java-core/src/main/java/io/microsphere/reflect/TypeUtils.java index 83271c7ea..987a6651e 100644 --- a/microsphere-java-core/src/main/java/io/microsphere/reflect/TypeUtils.java +++ b/microsphere-java-core/src/main/java/io/microsphere/reflect/TypeUtils.java @@ -67,6 +67,7 @@ import static java.util.stream.Collectors.toSet; import static java.util.stream.Stream.of; import static java.util.stream.StreamSupport.stream; +import static io.microsphere.collection.SetUtils.*; /** * The utilities class for {@link Type} @@ -174,7 +175,7 @@ public static boolean isObjectType(Object type) { *
{@code
      * TypeUtils.isParameterizedType(List.class); // returns false (raw type)
      * TypeUtils.isParameterizedType(ArrayList.class); // returns false (raw type)
-     * TypeUtils.isParameterizedType(new ArrayList<>().getClass().getGenericSuperclass()); // returns true
+     * TypeUtils.isParameterizedType(newArrayList().getClass().getGenericSuperclass()); // returns true
      * TypeUtils.isParameterizedType(null); // returns false
      * }
* @@ -264,7 +265,7 @@ public static boolean isGenericArrayType(Object type) { * * TypeUtils.isActualType(Example.class); // returns true (Class) * - * ParameterizedType listType = (ParameterizedType) new ArrayList<>().getClass().getGenericSuperclass(); + * ParameterizedType listType = (ParameterizedType) newArrayList().getClass().getGenericSuperclass(); * TypeUtils.isActualType(listType); // returns true (ParameterizedType) * * TypeVariable typeVar = List.class.getTypeParameters()[0]; @@ -297,7 +298,7 @@ public static boolean isActualType(Type type) { *
{@code
      * TypeUtils.getRawType(List.class); // returns List.class
      *
-     * ParameterizedType parameterizedType = (ParameterizedType) new ArrayList<>().getClass().getGenericSuperclass();
+     * ParameterizedType parameterizedType = (ParameterizedType) newArrayList().getClass().getGenericSuperclass();
      * TypeUtils.getRawType(parameterizedType); // returns List.class
      *
      * TypeUtils.getRawType(String.class); // returns String.class
@@ -327,7 +328,7 @@ public static Type getRawType(Type type) {
      * 
{@code
      * TypeUtils.getRawClass(List.class); // returns List.class
      *
-     * ParameterizedType parameterizedType = (ParameterizedType) new ArrayList<>().getClass().getGenericSuperclass();
+     * ParameterizedType parameterizedType = (ParameterizedType) newArrayList().getClass().getGenericSuperclass();
      * TypeUtils.getRawClass(parameterizedType); // returns List.class
      *
      * TypeUtils.getRawClass(String.class); // returns String.class
@@ -352,12 +353,12 @@ public static Class getRawClass(Type type) {
      *
      * 

Example Usage

*
{@code
-     * Type listType = new ArrayList<>().getClass().getGenericSuperclass(); // ParameterizedType for List
+     * Type listType = newArrayList().getClass().getGenericSuperclass(); // ParameterizedType for List
      * Type superType = List.class;
      *
      * boolean assignable1 = TypeUtils.isAssignableFrom(superType, listType); // returns true
      *
-     * Type mapType = new HashMap<>().getClass().getGenericSuperclass(); // ParameterizedType for AbstractMap
+     * Type mapType = newHashMap().getClass().getGenericSuperclass(); // ParameterizedType for AbstractMap
      * Type superType2 = Map.class;
      *
      * boolean assignable2 = TypeUtils.isAssignableFrom(superType2, mapType); // returns true
@@ -386,7 +387,7 @@ public static boolean isAssignableFrom(Type superType, Type targetType) {
      * 

Example Usage

*
{@code
      * Class superClass = List.class;
-     * Type targetType = new ArrayList<>().getClass().getGenericSuperclass(); // ParameterizedType for List
+     * Type targetType = newArrayList().getClass().getGenericSuperclass(); // ParameterizedType for List
      *
      * boolean isAssignable = TypeUtils.isAssignableFrom(superClass, targetType); // returns true
      *
@@ -1114,7 +1115,7 @@ protected static List doGetHierarchicalTypes(Type type) {
      * 
{@code
      * TypeUtils.getClassName(String.class); // returns "java.lang.String"
      *
-     * ParameterizedType listType = (ParameterizedType) new ArrayList<>().getClass().getGenericSuperclass();
+     * ParameterizedType listType = (ParameterizedType) newArrayList().getClass().getGenericSuperclass();
      * TypeUtils.getClassName(listType); // returns "java.util.List"
      *
      * TypeUtils.getClassName(Integer.TYPE); // returns "int"
@@ -1144,10 +1145,10 @@ public static String getClassName(Type type) {
      *
      * 

Example Usage

*
{@code
-     * ParameterizedType listType = (ParameterizedType) new ArrayList<>().getClass().getGenericSuperclass();
-     * ParameterizedType mapType = (ParameterizedType) new HashMap<>().getClass().getGenericSuperclass();
+     * ParameterizedType listType = (ParameterizedType) newArrayList().getClass().getGenericSuperclass();
+     * ParameterizedType mapType = (ParameterizedType) newHashMap().getClass().getGenericSuperclass();
      *
-     * Set types = new HashSet<>();
+     * Set types = newHashSet();
      * types.add(listType);
      * types.add(mapType);
      * types.add(String.class);
@@ -1277,7 +1278,7 @@ public static List> resolveTypeArgumentClasses(Class targetClass) {
      * System.out.println(stringClass); // Output: class java.lang.String
      *
      * // Convert a parameterized type's raw type
-     * List list = new ArrayList<>();
+     * List list = newArrayList();
      * ParameterizedType parameterizedType = (ParameterizedType) list.getClass().getGenericSuperclass();
      * Class listClass = TypeUtils.asClass(parameterizedType);
      * System.out.println(listClass); // Output: interface java.util.List
@@ -1359,7 +1360,7 @@ public static GenericArrayType asGenericArrayType(Type type) {
      *
      * 

Example Usage

*
{@code
-     * List list = new ArrayList<>();
+     * List list = newArrayList();
      * ParameterizedType parameterizedType = (ParameterizedType) list.getClass().getGenericSuperclass();
      *
      * // Convert a parameterized type
@@ -1409,7 +1410,7 @@ public static ParameterizedType asParameterizedType(Type type) {
      * System.out.println(fromRawClass == null); // Output: true
      *
      * // Trying to convert a ParameterizedType returns null
-     * List list = new ArrayList<>();
+     * List list = newArrayList();
      * ParameterizedType parameterizedType = (ParameterizedType) list.getClass().getGenericSuperclass();
      * TypeVariable fromParameterized = TypeUtils.asTypeVariable(parameterizedType);
      * System.out.println(fromParameterized == null); // Output: true
@@ -1449,7 +1450,7 @@ public static TypeVariable asTypeVariable(Type type) {
      * System.out.println(fromRawClass == null); // Output: true
      *
      * // Trying to convert a ParameterizedType returns null
-     * List list = new ArrayList<>();
+     * List list = newArrayList();
      * ParameterizedType parameterizedType = (ParameterizedType) list.getClass().getGenericSuperclass();
      * WildcardType fromParameterized = TypeUtils.asWildcardType(parameterizedType);
      * System.out.println(fromParameterized == null); // Output: true
@@ -1526,7 +1527,7 @@ public static Type getComponentType(Type type) {
      * 
{@code
      * TypeUtils.getTypeName(String.class); // returns "java.lang.String"
      *
-     * ParameterizedType listType = (ParameterizedType) new ArrayList<>().getClass().getGenericSuperclass();
+     * ParameterizedType listType = (ParameterizedType) newArrayList().getClass().getGenericSuperclass();
      * TypeUtils.getTypeName(listType); // returns "java.util.List"
      *
      * TypeUtils.getTypeName(Integer.TYPE); // returns "int"
@@ -1553,8 +1554,8 @@ public static String getTypeName(@Nullable Type type) {
      *
      * 

Example Usage

*
{@code
-     * Type listType = new ArrayList<>().getClass().getGenericSuperclass(); // ParameterizedType for List
-     * Type mapType = new HashMap<>().getClass().getGenericSuperclass(); // ParameterizedType for AbstractMap
+     * Type listType = newArrayList().getClass().getGenericSuperclass(); // ParameterizedType for List
+     * Type mapType = newHashMap().getClass().getGenericSuperclass(); // ParameterizedType for AbstractMap
      *
      * String[] typeNames = TypeUtils.getTypeNames(listType, mapType, String.class);
      * // Possible output: ["java.util.List", "java.util.AbstractMap", "java.lang.String"]

From 9fe7e6ac05ae986fc65749f2dee6391a952529aa Mon Sep 17 00:00:00 2001
From: Mercy Ma 
Date: Sat, 30 May 2026 16:24:01 +0800
Subject: [PATCH 4/5] Replace factory calls in Javadoc; remove import

Remove unused static import of SetUtils and update Javadoc examples to use standard collection constructors (e.g. new ArrayList(), new HashMap(), new HashSet<>()) instead of project-specific factory helpers like newArrayList()/newHashMap()/newHashSet(). Changes only touch documentation comments and imports to make examples clearer and remove an unused import; no runtime behavior changes.
---
 .../io/microsphere/reflect/TypeUtils.java     | 37 +++++++++----------
 1 file changed, 18 insertions(+), 19 deletions(-)

diff --git a/microsphere-java-core/src/main/java/io/microsphere/reflect/TypeUtils.java b/microsphere-java-core/src/main/java/io/microsphere/reflect/TypeUtils.java
index 987a6651e..7aa07213b 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/reflect/TypeUtils.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/reflect/TypeUtils.java
@@ -67,7 +67,6 @@
 import static java.util.stream.Collectors.toSet;
 import static java.util.stream.Stream.of;
 import static java.util.stream.StreamSupport.stream;
-import static io.microsphere.collection.SetUtils.*;
 
 /**
  * The utilities class for {@link Type}
@@ -175,7 +174,7 @@ public static boolean isObjectType(Object type) {
      * 
{@code
      * TypeUtils.isParameterizedType(List.class); // returns false (raw type)
      * TypeUtils.isParameterizedType(ArrayList.class); // returns false (raw type)
-     * TypeUtils.isParameterizedType(newArrayList().getClass().getGenericSuperclass()); // returns true
+     * TypeUtils.isParameterizedType(new ArrayList().getClass().getGenericSuperclass()); // returns true
      * TypeUtils.isParameterizedType(null); // returns false
      * }
* @@ -265,7 +264,7 @@ public static boolean isGenericArrayType(Object type) { * * TypeUtils.isActualType(Example.class); // returns true (Class) * - * ParameterizedType listType = (ParameterizedType) newArrayList().getClass().getGenericSuperclass(); + * ParameterizedType listType = (ParameterizedType) new ArrayList().getClass().getGenericSuperclass(); * TypeUtils.isActualType(listType); // returns true (ParameterizedType) * * TypeVariable typeVar = List.class.getTypeParameters()[0]; @@ -298,7 +297,7 @@ public static boolean isActualType(Type type) { *
{@code
      * TypeUtils.getRawType(List.class); // returns List.class
      *
-     * ParameterizedType parameterizedType = (ParameterizedType) newArrayList().getClass().getGenericSuperclass();
+     * ParameterizedType parameterizedType = (ParameterizedType) new ArrayList().getClass().getGenericSuperclass();
      * TypeUtils.getRawType(parameterizedType); // returns List.class
      *
      * TypeUtils.getRawType(String.class); // returns String.class
@@ -328,7 +327,7 @@ public static Type getRawType(Type type) {
      * 
{@code
      * TypeUtils.getRawClass(List.class); // returns List.class
      *
-     * ParameterizedType parameterizedType = (ParameterizedType) newArrayList().getClass().getGenericSuperclass();
+     * ParameterizedType parameterizedType = (ParameterizedType) new ArrayList().getClass().getGenericSuperclass();
      * TypeUtils.getRawClass(parameterizedType); // returns List.class
      *
      * TypeUtils.getRawClass(String.class); // returns String.class
@@ -353,12 +352,12 @@ public static Class getRawClass(Type type) {
      *
      * 

Example Usage

*
{@code
-     * Type listType = newArrayList().getClass().getGenericSuperclass(); // ParameterizedType for List
+     * Type listType = new ArrayList().getClass().getGenericSuperclass(); // ParameterizedType for List
      * Type superType = List.class;
      *
      * boolean assignable1 = TypeUtils.isAssignableFrom(superType, listType); // returns true
      *
-     * Type mapType = newHashMap().getClass().getGenericSuperclass(); // ParameterizedType for AbstractMap
+     * Type mapType = new HashMap().getClass().getGenericSuperclass(); // ParameterizedType for AbstractMap
      * Type superType2 = Map.class;
      *
      * boolean assignable2 = TypeUtils.isAssignableFrom(superType2, mapType); // returns true
@@ -387,7 +386,7 @@ public static boolean isAssignableFrom(Type superType, Type targetType) {
      * 

Example Usage

*
{@code
      * Class superClass = List.class;
-     * Type targetType = newArrayList().getClass().getGenericSuperclass(); // ParameterizedType for List
+     * Type targetType = new ArrayList().getClass().getGenericSuperclass(); // ParameterizedType for List
      *
      * boolean isAssignable = TypeUtils.isAssignableFrom(superClass, targetType); // returns true
      *
@@ -1115,7 +1114,7 @@ protected static List doGetHierarchicalTypes(Type type) {
      * 
{@code
      * TypeUtils.getClassName(String.class); // returns "java.lang.String"
      *
-     * ParameterizedType listType = (ParameterizedType) newArrayList().getClass().getGenericSuperclass();
+     * ParameterizedType listType = (ParameterizedType) new ArrayList().getClass().getGenericSuperclass();
      * TypeUtils.getClassName(listType); // returns "java.util.List"
      *
      * TypeUtils.getClassName(Integer.TYPE); // returns "int"
@@ -1145,10 +1144,10 @@ public static String getClassName(Type type) {
      *
      * 

Example Usage

*
{@code
-     * ParameterizedType listType = (ParameterizedType) newArrayList().getClass().getGenericSuperclass();
-     * ParameterizedType mapType = (ParameterizedType) newHashMap().getClass().getGenericSuperclass();
+     * ParameterizedType listType = (ParameterizedType) new ArrayList().getClass().getGenericSuperclass();
+     * ParameterizedType mapType = (ParameterizedType) new HashMap().getClass().getGenericSuperclass();
      *
-     * Set types = newHashSet();
+     * Set types = new HashSet<>();
      * types.add(listType);
      * types.add(mapType);
      * types.add(String.class);
@@ -1278,7 +1277,7 @@ public static List> resolveTypeArgumentClasses(Class targetClass) {
      * System.out.println(stringClass); // Output: class java.lang.String
      *
      * // Convert a parameterized type's raw type
-     * List list = newArrayList();
+     * List list = new ArrayList<>();
      * ParameterizedType parameterizedType = (ParameterizedType) list.getClass().getGenericSuperclass();
      * Class listClass = TypeUtils.asClass(parameterizedType);
      * System.out.println(listClass); // Output: interface java.util.List
@@ -1360,7 +1359,7 @@ public static GenericArrayType asGenericArrayType(Type type) {
      *
      * 

Example Usage

*
{@code
-     * List list = newArrayList();
+     * List list = new ArrayList<>();
      * ParameterizedType parameterizedType = (ParameterizedType) list.getClass().getGenericSuperclass();
      *
      * // Convert a parameterized type
@@ -1410,7 +1409,7 @@ public static ParameterizedType asParameterizedType(Type type) {
      * System.out.println(fromRawClass == null); // Output: true
      *
      * // Trying to convert a ParameterizedType returns null
-     * List list = newArrayList();
+     * List list = new ArrayList<>();
      * ParameterizedType parameterizedType = (ParameterizedType) list.getClass().getGenericSuperclass();
      * TypeVariable fromParameterized = TypeUtils.asTypeVariable(parameterizedType);
      * System.out.println(fromParameterized == null); // Output: true
@@ -1450,7 +1449,7 @@ public static TypeVariable asTypeVariable(Type type) {
      * System.out.println(fromRawClass == null); // Output: true
      *
      * // Trying to convert a ParameterizedType returns null
-     * List list = newArrayList();
+     * List list = new ArrayList<>();
      * ParameterizedType parameterizedType = (ParameterizedType) list.getClass().getGenericSuperclass();
      * WildcardType fromParameterized = TypeUtils.asWildcardType(parameterizedType);
      * System.out.println(fromParameterized == null); // Output: true
@@ -1527,7 +1526,7 @@ public static Type getComponentType(Type type) {
      * 
{@code
      * TypeUtils.getTypeName(String.class); // returns "java.lang.String"
      *
-     * ParameterizedType listType = (ParameterizedType) newArrayList().getClass().getGenericSuperclass();
+     * ParameterizedType listType = (ParameterizedType) new ArrayList().getClass().getGenericSuperclass();
      * TypeUtils.getTypeName(listType); // returns "java.util.List"
      *
      * TypeUtils.getTypeName(Integer.TYPE); // returns "int"
@@ -1554,8 +1553,8 @@ public static String getTypeName(@Nullable Type type) {
      *
      * 

Example Usage

*
{@code
-     * Type listType = newArrayList().getClass().getGenericSuperclass(); // ParameterizedType for List
-     * Type mapType = newHashMap().getClass().getGenericSuperclass(); // ParameterizedType for AbstractMap
+     * Type listType = new ArrayList().getClass().getGenericSuperclass(); // ParameterizedType for List
+     * Type mapType = new HashMap().getClass().getGenericSuperclass(); // ParameterizedType for AbstractMap
      *
      * String[] typeNames = TypeUtils.getTypeNames(listType, mapType, String.class);
      * // Possible output: ["java.util.List", "java.util.AbstractMap", "java.lang.String"]

From 1707226cf76dc9b3e3405b129b06a9865eb1079f Mon Sep 17 00:00:00 2001
From: Mercy Ma 
Date: Sat, 30 May 2026 16:27:01 +0800
Subject: [PATCH 5/5] Add newLinkedList static import

Add static import of io.microsphere.collection.ListUtils.newLinkedList to MethodUtils and JarUtils so the helper can be referenced without qualification in these classes.
---
 .../src/main/java/io/microsphere/reflect/MethodUtils.java        | 1 +
 .../src/main/java/io/microsphere/util/jar/JarUtils.java          | 1 +
 2 files changed, 2 insertions(+)

diff --git a/microsphere-java-core/src/main/java/io/microsphere/reflect/MethodUtils.java b/microsphere-java-core/src/main/java/io/microsphere/reflect/MethodUtils.java
index 796fe7d1f..f9b90f060 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/reflect/MethodUtils.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/reflect/MethodUtils.java
@@ -34,6 +34,7 @@
 import java.util.function.Predicate;
 
 import static io.microsphere.annotation.ConfigurationProperty.SYSTEM_PROPERTIES_SOURCE;
+import static io.microsphere.collection.ListUtils.newLinkedList;
 import static io.microsphere.collection.ListUtils.of;
 import static io.microsphere.constants.PropertyConstants.MICROSPHERE_PROPERTY_NAME_PREFIX;
 import static io.microsphere.constants.SymbolConstants.COMMA_CHAR;
diff --git a/microsphere-java-core/src/main/java/io/microsphere/util/jar/JarUtils.java b/microsphere-java-core/src/main/java/io/microsphere/util/jar/JarUtils.java
index 2a8a476ab..ef275ac15 100644
--- a/microsphere-java-core/src/main/java/io/microsphere/util/jar/JarUtils.java
+++ b/microsphere-java-core/src/main/java/io/microsphere/util/jar/JarUtils.java
@@ -25,6 +25,7 @@
 import java.util.jar.JarFile;
 
 import static io.microsphere.collection.CollectionUtils.isEmpty;
+import static io.microsphere.collection.ListUtils.newLinkedList;
 import static io.microsphere.collection.ListUtils.ofList;
 import static io.microsphere.constants.ProtocolConstants.FILE_PROTOCOL;
 import static io.microsphere.constants.ProtocolConstants.JAR_PROTOCOL;