AMashenkov commented on a change in pull request #484:
URL: https://github.com/apache/ignite-3/pull/484#discussion_r762115743
##########
File path:
modules/core/src/main/java/org/apache/ignite/internal/util/ArrayUtils.java
##########
@@ -295,7 +298,22 @@ public static boolean nullOrEmpty(boolean[] arr) {
public static <T> List<T> asList(@Nullable T... vals) {
return nullOrEmpty(vals) ? Collections.emptyList() :
Arrays.asList(vals);
}
-
+
+ /**
+ * Converts array to {@link Set}.
+ *
+ * <p>Note that unlike {@link Arrays#asList(Object[])}, this method is
{@code null}-safe. If {@code null} is passed in, then empty set
Review comment:
Also it may worth to note, the resulted Set is mutable in contrast to
Set.of(T...).
Does mutability matter?
##########
File path:
modules/schema/src/test/java/org/apache/ignite/internal/schema/configuration/SchemaConfigurationConverterTest.java
##########
@@ -87,11 +88,13 @@ public void createRegistry() throws ExecutionException,
InterruptedException {
tblBuilder = SchemaBuilders.tableBuilder("SNAME", "TNAME")
.columns(
+ Arrays.asList(
Review comment:
Seems, it is not necessary, there is vararg method .columns(T... )
##########
File path:
modules/table/src/test/java/org/apache/ignite/internal/table/TableManagerTest.java
##########
@@ -94,30 +94,30 @@
public class TableManagerTest extends IgniteAbstractTest {
/** The name of the table which is statically configured. */
private static final String STATIC_TABLE_NAME = "t1";
-
+
Review comment:
Please, remove whitespaces in empty lines.
##########
File path:
modules/core/src/main/java/org/apache/ignite/internal/util/ArrayUtils.java
##########
@@ -295,7 +298,22 @@ public static boolean nullOrEmpty(boolean[] arr) {
public static <T> List<T> asList(@Nullable T... vals) {
return nullOrEmpty(vals) ? Collections.emptyList() :
Arrays.asList(vals);
}
-
+
+ /**
+ * Converts array to {@link Set}.
+ *
+ * <p>Note that unlike {@link Arrays#asList(Object[])}, this method is
{@code null}-safe. If {@code null} is passed in, then empty set
Review comment:
Streams are not GC friendly.
Let's rewrite to for-loop or Collections.addAll(new HashSet(), vals)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]