Skip to content

Commit fb5e213

Browse files
committed
1.73
1 parent 54c78df commit fb5e213

File tree

5 files changed

+7
-12
lines changed

5 files changed

+7
-12
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package dev.felnull.fnjl;
22

33
public class FNJLBuildIn {
4-
protected static final String VERSION = "1.72";
4+
protected static final String VERSION = "1.73";
55
}

common/src/main/java/dev/felnull/fnjl/util/FNArrayUtil.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package dev.felnull.fnjl.util;
22

3-
import java.lang.reflect.Array;
43
import java.util.Arrays;
54
import java.util.Objects;
5+
import java.util.function.IntFunction;
66
import java.util.function.Supplier;
77

88
/**
@@ -186,16 +186,11 @@ public static float[] insert(float[] array, int index, float value) {
186186
/**
187187
* サプライヤーの配列からすべてを取得し配列へ変換
188188
*
189-
* @param clazz 型クラス
190189
* @param suppliers サプライヤー
191190
* @param <T> 型
192191
* @return 配列
193192
*/
194-
public static <T> T[] allGet(Class<T> clazz, Supplier<T>[] suppliers) {
195-
T[] array = (T[]) Array.newInstance(clazz, suppliers.length);
196-
for (int i = 0; i < suppliers.length; i++) {
197-
array[i] = suppliers[i].get();
198-
}
199-
return array;
193+
public static <T> T[] allGet(Supplier<T>[] suppliers, IntFunction<T[]> generator) {
194+
return Arrays.stream(suppliers).map(Supplier::get).toArray(generator);
200195
}
201196
}

common/src/test/java/dev/felnull/fnjltest/Main.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public static void main(String[] args) throws Exception {
1111
strs[0] = () -> "114514";
1212
strs[1] = () -> "FCOH";
1313
strs[2] = () -> "TEST";
14-
String[] ret = FNArrayUtil.allGet(String.class, strs);
14+
String[] ret = FNArrayUtil.allGet(strs, String[]::new);
1515
System.out.println(Arrays.toString(ret));
1616
}
1717
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
fnjl_group=dev.felnull
22
fnjl_name=felnull-java-library
3-
fnjl_version=1.72
3+
fnjl_version=1.73
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package dev.felnull.fnjln;
22

33
public class FNJLNBuildIn {
4-
protected static final String VERSION = "1.72";
4+
protected static final String VERSION = "1.73";
55

66
protected static final int NATIVE_LIBRARY_VERSION = 1;
77
}

0 commit comments

Comments
 (0)