Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
cb35b2f
Update IOUtilsTest.java
mercyblitz Mar 6, 2025
dd30b49
Update FastByteArrayInputStreamTest.java
mercyblitz Mar 6, 2025
96d54fa
Update DelegatingURLConnectionTest.java
mercyblitz Mar 6, 2025
0806662
Update CompositeURLStreamHandlerFactory.java
mercyblitz Mar 6, 2025
acf0cd2
Create CompositeURLStreamHandlerFactoryTest.java
mercyblitz Mar 6, 2025
05f2535
Create DelegatingURLStreamHandlerFactoryTest.java
mercyblitz Mar 6, 2025
1c4bed2
Update DelegatingURLStreamHandlerFactory.java
mercyblitz Mar 6, 2025
8191f59
Update DelegatingURLStreamHandlerFactoryTest.java
mercyblitz Mar 6, 2025
3fe31de
Update DelegatingURLConnectionTest.java
mercyblitz Mar 6, 2025
719f192
Update ExtendableProtocolURLStreamHandler.java
mercyblitz Mar 6, 2025
6bb6a8c
Update ExtendableProtocolURLStreamHandlerTest.java
mercyblitz Mar 6, 2025
3e2d828
Update ExtendableProtocolURLStreamHandler.java
mercyblitz Mar 6, 2025
7603770
Update ExtendableProtocolURLStreamHandlerTest.java
mercyblitz Mar 6, 2025
d627b20
Update ExtendableProtocolURLStreamHandler.java
mercyblitz Mar 6, 2025
3b20ba0
Update ExtendableProtocolURLStreamHandlerTest.java
mercyblitz Mar 6, 2025
5b50846
Update Handler.java
mercyblitz Mar 6, 2025
591f883
Create Handler.java
mercyblitz Mar 6, 2025
f96c582
Delete TestHandler.java
mercyblitz Mar 6, 2025
e4cf256
Create HandlerTest.java
mercyblitz Mar 6, 2025
fa5916a
Update ExtendableProtocolURLStreamHandlerTest.java
mercyblitz Mar 6, 2025
e01d579
Create HandlerTest.java
mercyblitz Mar 6, 2025
470ff23
Create HandlerTest.java
mercyblitz Mar 6, 2025
88e3be4
Create AbstractExtendableProtocolURLStreamHandlerTest.java
mercyblitz Mar 6, 2025
4e54bd9
Update ExtendableProtocolURLStreamHandler.java
mercyblitz Mar 6, 2025
f332ddc
Update AbstractExtendableProtocolURLStreamHandlerTest.java
mercyblitz Mar 6, 2025
e642d7b
Update ExtendableProtocolURLStreamHandlerTest.java
mercyblitz Mar 6, 2025
c93119c
Update MutableURLStreamHandlerFactory.java
mercyblitz Mar 7, 2025
f53f6d9
Create MutableURLStreamHandlerFactoryTest.java
mercyblitz Mar 7, 2025
03b23e5
Update HandlerTest.java
mercyblitz Mar 7, 2025
e74fc7e
Update ServiceLoaderURLStreamHandlerFactoryTest.java
mercyblitz Mar 7, 2025
76fb974
Update ServiceLoaderURLStreamHandlerFactoryTest.java
mercyblitz Mar 7, 2025
fd9bf78
Update URLUtils.java
mercyblitz Mar 7, 2025
21ae083
Update URLUtilsTest.java
mercyblitz Mar 7, 2025
dc37e29
Update URLUtils.java
mercyblitz Mar 7, 2025
c701b4e
Update URLUtilsTest.java
mercyblitz Mar 7, 2025
5d0a021
Update URLUtilsTest.java
mercyblitz Mar 7, 2025
c90ef43
Update URLUtils.java
mercyblitz Mar 8, 2025
aaad6ba
Update URLUtilsTest.java
mercyblitz Mar 8, 2025
059699b
Update URLUtilsTest.java
mercyblitz Mar 8, 2025
aec5afe
Update URLUtilsTest.java
mercyblitz Mar 8, 2025
7968f07
Update URLUtilsTest.java
mercyblitz Mar 8, 2025
1cd0232
Update URLUtils.java
mercyblitz Mar 8, 2025
f98995c
Update StringUtils.java
mercyblitz Mar 8, 2025
ba284f9
Update URLUtilsTest.java
mercyblitz Mar 8, 2025
287a64f
Refactor
mercyblitz Mar 8, 2025
1b03a73
Update URLUtils.java
mercyblitz Mar 8, 2025
798a004
Update ListUtils.java
mercyblitz Mar 8, 2025
6cb0ffe
Update URLUtilsTest.java
mercyblitz Mar 8, 2025
11ada25
Update FilterOperator.java
mercyblitz Mar 8, 2025
8da1c73
Update URLUtils.java
mercyblitz Mar 8, 2025
dcf28ca
Update ReflectionUtils.java
mercyblitz Mar 8, 2025
ccfc728
Update WindowsRedefinedClassLoader.java
mercyblitz Mar 8, 2025
3419e13
Update MethodUtils.java
mercyblitz Mar 8, 2025
2ad566c
Update CollectionUtilsTest.java
mercyblitz Mar 8, 2025
2a2300c
Update ListsTest.java
mercyblitz Mar 8, 2025
ef0cfc2
Update MapUtilsTest.java
mercyblitz Mar 8, 2025
fd7a827
Update StringToBlockingDequeConverterTest.java
mercyblitz Mar 8, 2025
52093d9
Update MethodUtils.java
mercyblitz Mar 8, 2025
0eda5eb
Update TypeUtils.java
mercyblitz Mar 8, 2025
3062d9e
Update Compiler.java
mercyblitz Mar 8, 2025
06916f8
Update TypeUtilsTest.java
mercyblitz Mar 8, 2025
1eaa18b
Update WindowsRedefinedClassLoader.java
mercyblitz Mar 8, 2025
ef5380e
Update Listenable.java
mercyblitz Mar 8, 2025
c94371e
Update ConstructorUtils.java
mercyblitz Mar 8, 2025
19db362
Update FieldUtils.java
mercyblitz Mar 8, 2025
417a251
Update MethodUtils.java
mercyblitz Mar 8, 2025
9e573d0
Update TypeUtils.java
mercyblitz Mar 8, 2025
e180fa8
Update AnnotationUtils.java
mercyblitz Mar 8, 2025
511a793
Update ArrayUtils.java
mercyblitz Mar 8, 2025
00b2db7
Update ClassLoaderUtils.java
mercyblitz Mar 8, 2025
5188945
Update ClassUtils.java
mercyblitz Mar 8, 2025
8c59a1b
Update AbstractDequeTest.java
mercyblitz Mar 8, 2025
55e831a
Update ListsTest.java
mercyblitz Mar 8, 2025
d6ced9a
Update DelegatingBlockingQueueTest.java
mercyblitz Mar 8, 2025
ac87b8b
Update DelegatingScheduledExecutorServiceTest.java
mercyblitz Mar 8, 2025
ee7c8d5
Update StringToCollectionConverterTest.java
mercyblitz Mar 8, 2025
159308a
Update StringToDequeConverterTest.java
mercyblitz Mar 8, 2025
31f3bd1
Update StringToListConverterTest.java
mercyblitz Mar 8, 2025
b266289
Update StringToNavigableSetConverterTest.java
mercyblitz Mar 8, 2025
4583c88
Update StringToQueueConverterTest.java
mercyblitz Mar 8, 2025
5b4c96b
Update StringToSetConverterTest.java
mercyblitz Mar 8, 2025
ec390f9
Update StringToSortedSetConverterTest.java
mercyblitz Mar 8, 2025
4721253
Update StringToTransferQueueConverterTest.java
mercyblitz Mar 8, 2025
e57f11a
Update DirectEventDispatcherTest.java
mercyblitz Mar 8, 2025
044cf3f
Update FileWatchServiceTest.java
mercyblitz Mar 8, 2025
4afd008
Update StreamsTest.java
mercyblitz Mar 8, 2025
9bf3234
Update ExtendableProtocolURLStreamHandlerTest.java
mercyblitz Mar 8, 2025
49eb46b
Create ListsBenchmark.java
mercyblitz Mar 8, 2025
2288365
Update MethodUtils.java
mercyblitz Mar 8, 2025
d180db1
Update MethodUtils.java
mercyblitz Mar 8, 2025
0b6b40e
Update MapUtils.java
mercyblitz Mar 8, 2025
8aadebc
Update URLUtils.java
mercyblitz Mar 8, 2025
c460c99
Update MapUtilsTest.java
mercyblitz Mar 8, 2025
fbe8ad9
Update MapUtilsTest.java
mercyblitz Mar 8, 2025
51e79dc
Update MapUtils.java
mercyblitz Mar 8, 2025
c2ca5d7
Update MapUtilsTest.java
mercyblitz Mar 8, 2025
2ebf03e
Update ArrayUtils.java
mercyblitz Mar 8, 2025
f98e8f9
Update ArrayUtils.java
mercyblitz Mar 8, 2025
d4e0ca8
Update ArrayUtilsTest.java
mercyblitz Mar 8, 2025
635c5de
Update MultipleType.java
mercyblitz Mar 8, 2025
fd32aed
Update ListsBenchmark.java
mercyblitz Mar 8, 2025
b3b6dd9
Update DelegatingBlockingQueueTest.java
mercyblitz Mar 8, 2025
50c1800
Update MethodDefinitionTest.java
mercyblitz Mar 8, 2025
35113ce
Update ResourceTypeTest.java
mercyblitz Mar 8, 2025
d4b2ea1
Update PropertiesUtilsTest.java
mercyblitz Mar 8, 2025
14ce00d
Update ClassUtils.java
mercyblitz Mar 8, 2025
02d5209
Update AssertTest.java
mercyblitz Mar 8, 2025
b8f9013
Update SystemUtilsTest.java
mercyblitz Mar 8, 2025
f4c61b1
Update SystemUtilsTest.java
mercyblitz Mar 8, 2025
db55028
Update SetUtils.java
mercyblitz Mar 8, 2025
2640ee9
Update SetUtils.java
mercyblitz Mar 8, 2025
9fd8b3b
Update ClassPathUtils.java
mercyblitz Mar 8, 2025
492f458
Update SetUtilsTest.java
mercyblitz Mar 8, 2025
a4a90ef
Update ExtendableProtocolURLStreamHandler.java
mercyblitz Mar 8, 2025
74d809b
Update ClassLoaderUtilsTest.java
mercyblitz Mar 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@
import static io.microsphere.annotation.processor.util.MemberUtils.matchParameterTypes;
import static io.microsphere.annotation.processor.util.TypeUtils.getHierarchicalTypes;
import static io.microsphere.annotation.processor.util.TypeUtils.ofDeclaredType;
import static io.microsphere.collection.CollectionUtils.addAll;
import static io.microsphere.filter.FilterUtils.filter;
import static io.microsphere.lang.function.Predicates.EMPTY_PREDICATE_ARRAY;
import static io.microsphere.lang.function.Streams.filterAll;
import static io.microsphere.lang.function.Streams.filterFirst;
import static java.util.Arrays.asList;
import static io.microsphere.collection.Lists.ofList;
import static java.util.Collections.emptyList;
import static javax.lang.model.element.ElementKind.METHOD;
import static javax.lang.model.util.ElementFilter.methodsIn;
Expand Down Expand Up @@ -106,7 +107,7 @@ static ExecutableElement findMethod(TypeElement type, String methodName, Type on
static ExecutableElement findMethod(TypeMirror type, String methodName, Type oneParameterType, Type... otherParameterTypes) {
List<Type> parameterTypes = new LinkedList<>();
parameterTypes.add(oneParameterType);
parameterTypes.addAll(asList(otherParameterTypes));
addAll(parameterTypes, otherParameterTypes);
return findMethod(type, methodName, parameterTypes.stream().map(Type::getTypeName).toArray(String[]::new));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import static io.microsphere.lang.function.Streams.filterFirst;
import static io.microsphere.reflect.MethodUtils.invokeMethod;
import static java.lang.String.valueOf;
import static java.util.Arrays.asList;
import static io.microsphere.collection.Lists.ofList;
import static java.util.Collections.emptyList;
import static java.util.Collections.emptySet;
import static java.util.stream.Collectors.toSet;
Expand All @@ -61,7 +61,7 @@
*/
public interface TypeUtils {

List<String> SIMPLE_TYPES = asList(
List<String> SIMPLE_TYPES = ofList(
ClassUtils.SIMPLE_TYPES
.stream()
.map(Class::getName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
import java.util.LinkedHashSet;
import java.util.Set;

import static java.util.Arrays.asList;
import static io.microsphere.collection.CollectionUtils.addAll;
import static io.microsphere.collection.Lists.ofList;

/**
* The Java Compiler
Expand Down Expand Up @@ -84,7 +85,7 @@ private static File detectClassPath(Class<?> targetClass) {
}

public Compiler processors(Processor... processors) {
this.processors.addAll(asList(processors));
addAll(this.processors, processors);
return this;
}

Expand All @@ -105,7 +106,7 @@ private File javaSourceFile(String sourceClassName) {

public boolean compile(Class<?>... sourceClasses) {
JavaCompiler.CompilationTask task = javaCompiler.getTask(null, this.javaFileManager, null,
asList("-parameters", "-Xlint:unchecked", "-nowarn", "-Xlint:deprecation"),
ofList("-parameters", "-Xlint:unchecked", "-nowarn", "-Xlint:deprecation"),
// null,
null, getJavaFileObjects(sourceClasses));
if (!processors.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
import static io.microsphere.annotation.processor.util.TypeUtils.ofDeclaredType;
import static io.microsphere.annotation.processor.util.TypeUtils.ofDeclaredTypes;
import static io.microsphere.annotation.processor.util.TypeUtils.ofTypeElement;
import static java.util.Arrays.asList;
import static io.microsphere.collection.Lists.ofList;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
Expand Down Expand Up @@ -415,7 +415,7 @@ public void testOfTypeElement() {

@Test
public void testOfDeclaredTypes() {
Set<DeclaredType> declaredTypes = ofDeclaredTypes(asList(getType(String.class), getType(TestServiceImpl.class), getType(Color.class)));
Set<DeclaredType> declaredTypes = ofDeclaredTypes(ofList(getType(String.class), getType(TestServiceImpl.class), getType(Color.class)));
assertTrue(declaredTypes.contains(getType(String.class).asType()));
assertTrue(declaredTypes.contains(getType(TestServiceImpl.class).asType()));
assertTrue(declaredTypes.contains(getType(Color.class).asType()));
Expand All @@ -425,24 +425,24 @@ public void testOfDeclaredTypes() {

@Test
public void testListDeclaredTypes() {
List<DeclaredType> types = listDeclaredTypes(asList(testType, testType, testType));
List<DeclaredType> types = listDeclaredTypes(ofList(testType, testType, testType));
assertEquals(1, types.size());
assertEquals(ofDeclaredType(testType), types.get(0));

types = listDeclaredTypes(asList(new Element[]{null}));
types = listDeclaredTypes(ofList(new Element[]{null}));
assertTrue(types.isEmpty());
}

@Test
public void testListTypeElements() {
List<TypeElement> typeElements = listTypeElements(asList(testType.asType(), ofDeclaredType(testType)));
List<TypeElement> typeElements = listTypeElements(ofList(testType.asType(), ofDeclaredType(testType)));
assertEquals(1, typeElements.size());
assertEquals(testType, typeElements.get(0));

typeElements = listTypeElements(asList(types.getPrimitiveType(TypeKind.BYTE), types.getNullType(), types.getNoType(TypeKind.NONE)));
typeElements = listTypeElements(ofList(types.getPrimitiveType(TypeKind.BYTE), types.getNullType(), types.getNoType(TypeKind.NONE)));
assertTrue(typeElements.isEmpty());

typeElements = listTypeElements(asList(new TypeMirror[]{null}));
typeElements = listTypeElements(ofList(new TypeMirror[]{null}));
assertTrue(typeElements.isEmpty());

typeElements = listTypeElements(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import java.net.URLClassLoader;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Enumeration;
import java.util.LinkedList;
import java.util.List;
Expand All @@ -20,6 +19,7 @@
import java.util.TreeMap;
import java.util.TreeSet;

import static io.microsphere.collection.CollectionUtils.addAll;
import static io.microsphere.collection.MapUtils.isEmpty;
import static io.microsphere.constants.SeparatorConstants.LINE_SEPARATOR;
import static io.microsphere.io.IOUtils.toByteArray;
Expand Down Expand Up @@ -162,7 +162,7 @@ private static SortedSet<String> loadRedefinedClassNames(ClassLoader classLoader
try (InputStream inputStream = resource.openStream()) {
String configContent = IOUtils.toString(inputStream, charset);
String[] classNames = split(configContent, LINE_SEPARATOR);
redefinedClassNames.addAll(Arrays.asList(classNames));
addAll(redefinedClassNames, classNames);
}
}
} catch (IOException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ public static <E> List<E> of(E... elements) {
return unmodifiableList(asList(elements));
}

/**
* Create a {@link List} from the specified array
*
* @param elements
* @param <E>
* @return
* @see {@link Lists#ofList} as recommended
*/
public static <E> List<E> ofList(E... elements) {
return of(elements);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import java.util.function.Function;

import static io.microsphere.collection.CollectionUtils.size;
import static io.microsphere.util.ArrayUtils.length;
import static java.util.Collections.emptyMap;
import static java.util.Collections.singletonMap;
import static java.util.Collections.unmodifiableMap;
Expand All @@ -51,7 +52,12 @@ public abstract class MapUtils extends BaseUtils {
/**
* The min load factor for {@link HashMap} or {@link Hashtable}
*/
public static final float MIN_LOAD_FACTOR = 1.0f;
public static final float MIN_LOAD_FACTOR = Float.MIN_VALUE;

/**
* The fixed load factor for {@link HashMap} or {@link Hashtable} = 1.00
*/
protected static final float FIXED_LOAD_FACTOR = 1.00f;

public static boolean isEmpty(Map<?, ?> map) {
return map == null || map.isEmpty();
Expand All @@ -62,7 +68,7 @@ public static boolean isNotEmpty(Map<?, ?> map) {
}

public static <K, V> Map<K, V> of(K key, V value) {
return singletonMap(key, value);
return ofMap(key, value);
}

public static <K, V> Map<K, V> of(K key1, V value1, K key2, V value2) {
Expand All @@ -85,9 +91,17 @@ public static Map of(Object... values) {
return ofMap(values);
}

public static <K, V> Map<K, V> ofMap(K key, V value) {
return singletonMap(key, value);
}

public static Map ofMap(Object... keyValuePairs) {
int length = keyValuePairs.length;
Map map = new HashMap(length / 2, MIN_LOAD_FACTOR);
int length = length(keyValuePairs);
if (length < 1) {
return emptyMap();
}
int size = length / 2;
Map map = newFixedLinkedHashMap(size);
for (int i = 0; i < length; ) {
map.put(keyValuePairs[i++], keyValuePairs[i++]);
}
Expand Down Expand Up @@ -191,14 +205,22 @@ public static <K, V> Map<K, V> shallowCloneMap(@Nonnull Map<K, V> source) {
}
}

public static <K, V> Map<K, V> newFixedHashMap(int size) {
return newHashMap(size, FIXED_LOAD_FACTOR);
}

public static <K, V> Map<K, V> newFixedLinkedHashMap(int size) {
return newLinkedHashMap(size, FIXED_LOAD_FACTOR);
}

public static <K, V, E> Map<K, V> toFixedMap(Collection<E> values,
Function<E, Map.Entry<K, V>> entryMapper) {
int size = size(values);
if (size < 1) {
return emptyMap();
}

Map<K, V> fixedMap = newHashMap(size, MIN_LOAD_FACTOR);
Map<K, V> fixedMap = newFixedLinkedHashMap(size);

for (E value : values) {
Map.Entry<K, V> entry = entryMapper.apply(value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import java.util.Set;

import static io.microsphere.collection.CollectionUtils.size;
import static io.microsphere.collection.MapUtils.MIN_LOAD_FACTOR;
import static io.microsphere.collection.MapUtils.FIXED_LOAD_FACTOR;
import static io.microsphere.util.ArrayUtils.length;
import static java.util.Collections.emptySet;
import static java.util.Collections.singleton;
Expand All @@ -55,14 +55,25 @@ public static boolean isSet(@Nullable Iterable<?> elements) {
* @return read-only {@link Set}
*/
public static <E> Set<E> of(E... elements) {
return ofSet(elements);
}

/**
* Convert to multiple elements to be {@link LinkedHashSet}
*
* @param elements one or more elements
* @param <E> the type of <code>elements</code>
* @return read-only {@link Set}
*/
public static <E> Set<E> ofSet(E... elements) {
int size = length(elements);
if (size < 1) {
return emptySet();
} else if (size == 1) {
return singleton(elements[0]);
}

Set<E> set = new LinkedHashSet<>(size);
Set<E> set = new LinkedHashSet<>(size, FIXED_LOAD_FACTOR);

for (int i = 0; i < size; i++) {
set.add(elements[i]);
Expand Down Expand Up @@ -108,31 +119,6 @@ public static <E> Set<E> ofSet(Iterable<E> elements) {
return unmodifiableSet(newLinkedHashSet(elements));
}

/**
* Convert to one or more elements to be a read-only {@link Set}
*
* @param one one element
* @param others others elements
* @param <E> the type of <code>elements</code>
* @return read-only {@link Set}
*/
public static <E> Set<E> ofSet(E one, E... others) {
int othersSize = length(others);
if (othersSize < 1) {
return singleton(one);
}

Set<E> elements = new LinkedHashSet<>(othersSize + 1, MIN_LOAD_FACTOR);

elements.add(one);

for (int i = 0; i < othersSize; i++) {
elements.add(others[i]);
}

return unmodifiableSet(elements);
}

public static <T> Set<T> ofSet(Collection<T> elements) {
return ofSet(elements, null);
}
Expand All @@ -148,7 +134,7 @@ public static <T> Set<T> ofSet(Collection<T> elements, T... others) {

int size = valuesSize + othersSize;

Set<T> set = newLinkedHashSet(size, MIN_LOAD_FACTOR);
Set<T> set = newLinkedHashSet(size, FIXED_LOAD_FACTOR);
// add elements
set.addAll(elements);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import static io.microsphere.collection.CollectionUtils.addAll;
import static java.util.stream.StreamSupport.stream;

/**
Expand Down Expand Up @@ -73,7 +73,7 @@ default void addEventListeners(E listener, E... others) throws NullPointerExcept
IllegalArgumentException {
List<E> listeners = new ArrayList<>(1 + others.length);
listeners.add(listener);
listeners.addAll(Arrays.asList(others));
addAll(listeners,others);
addEventListeners(listeners);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.microsphere.filter;

import java.lang.reflect.Array;
import static io.microsphere.util.ArrayUtils.length;

/**
* {@link Filter} Operator enumeration , which contains {@link #AND}��{@link #OR}��{@link #XOR}
Expand All @@ -21,7 +21,7 @@ public enum FilterOperator {
AND {
@Override
public <T> boolean accept(T filteredObject, Filter<T>... filters) {
int length = Array.getLength(filters);
int length = length(filters);
if (length == 0)
return true;
boolean success = true;
Expand All @@ -38,7 +38,7 @@ public <T> boolean accept(T filteredObject, Filter<T>... filters) {
OR {
@Override
public <T> boolean accept(T filteredObject, Filter<T>... filters) {
int length = Array.getLength(filters);
int length = length(filters);
if (length == 0)
return true;
boolean success = false;
Expand All @@ -54,7 +54,7 @@ public <T> boolean accept(T filteredObject, Filter<T>... filters) {
XOR {
@Override
public <T> boolean accept(T filteredObject, Filter<T>... filters) {
int length = Array.getLength(filters);
int length = length(filters);
if (length == 0)
return true;
boolean success = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ private void sortFactories(List<URLStreamHandlerFactory> factories) {

@Override
public String toString() {
String sb = "CompositeURLStreamHandlerFactory{" + "factories=" + factories +
'}';
return sb;
return "CompositeURLStreamHandlerFactory{" + "factories=" + factories + '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import java.net.URLStreamHandler;
import java.net.URLStreamHandlerFactory;

import static io.microsphere.util.Assert.assertNotNull;

/**
* Delegating {@link URLStreamHandlerFactory}
*
Expand All @@ -30,9 +32,7 @@ public class DelegatingURLStreamHandlerFactory implements URLStreamHandlerFactor
private final URLStreamHandlerFactory delegate;

public DelegatingURLStreamHandlerFactory(URLStreamHandlerFactory delegate) {
if (delegate == null) {
throw new NullPointerException("The 'delegate' argument must not be null!");
}
assertNotNull(delegate, () -> "The 'delegate' argument must not be null!");
this.delegate = delegate;
}

Expand Down
Loading