mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
fix code
This commit is contained in:
parent
06e091fc4a
commit
435de4e602
@ -33,6 +33,7 @@ public class ArrayWrapper<A, E> implements Wrapper<A>, Iterable<E> {
|
|||||||
* @param componentType 元素类型
|
* @param componentType 元素类型
|
||||||
* @param length 长度
|
* @param length 长度
|
||||||
* @param <A> 数组类型
|
* @param <A> 数组类型
|
||||||
|
* @param <E> 数组元素类型
|
||||||
* @return ArrayWrapper
|
* @return ArrayWrapper
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@ -313,7 +314,7 @@ public class ArrayWrapper<A, E> implements Wrapper<A>, Iterable<E> {
|
|||||||
* @return 新数组
|
* @return 新数组
|
||||||
*/
|
*/
|
||||||
public ArrayWrapper<A, E> insert(final int index, final E element) {
|
public ArrayWrapper<A, E> insert(final int index, final E element) {
|
||||||
return insertArray(index, createSingleElementArray(element));
|
return insertArray(index, ArrayUtil.ofArray(element));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -612,19 +613,5 @@ public class ArrayWrapper<A, E> implements Wrapper<A>, Iterable<E> {
|
|||||||
this.array = newArray;
|
this.array = newArray;
|
||||||
this.length = Array.getLength(newArray);
|
this.length = Array.getLength(newArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建单一元素数组
|
|
||||||
*
|
|
||||||
* @param value 元素值
|
|
||||||
* @return 数组
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
private A createSingleElementArray(final E value) {
|
|
||||||
// 插入单个元素
|
|
||||||
final A newInstance = (A) Array.newInstance(this.componentType, 1);
|
|
||||||
Array.set(newInstance, 0, value);
|
|
||||||
return newInstance;
|
|
||||||
}
|
|
||||||
// endregion
|
// endregion
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,9 @@ import org.dromara.hutool.core.map.WeakConcurrentMap;
|
|||||||
* @author Looly
|
* @author Looly
|
||||||
*/
|
*/
|
||||||
public enum BeanDescCache {
|
public enum BeanDescCache {
|
||||||
|
/**
|
||||||
|
* 单例
|
||||||
|
*/
|
||||||
INSTANCE;
|
INSTANCE;
|
||||||
|
|
||||||
private final WeakConcurrentMap<Class<?>, BeanDesc> bdCache = new WeakConcurrentMap<>();
|
private final WeakConcurrentMap<Class<?>, BeanDesc> bdCache = new WeakConcurrentMap<>();
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.dromara.hutool.core.collection.queue;
|
package org.dromara.hutool.core.collection.queue;
|
||||||
|
|
||||||
import org.dromara.hutool.core.collection.queue.CheckedLinkedBlockingQueue;
|
|
||||||
import org.dromara.hutool.core.thread.SimpleScheduler;
|
import org.dromara.hutool.core.thread.SimpleScheduler;
|
||||||
import org.dromara.hutool.core.util.RuntimeUtil;
|
import org.dromara.hutool.core.util.RuntimeUtil;
|
||||||
|
|
||||||
@ -28,6 +27,7 @@ import java.util.function.Predicate;
|
|||||||
* Apache incubator-shenyu</a>
|
* Apache incubator-shenyu</a>
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
|
* @param <E> 元素类型
|
||||||
* @author incubator-shenyu
|
* @author incubator-shenyu
|
||||||
* @since 6.0.0
|
* @since 6.0.0
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user