lidavidm commented on code in PR #41752:
URL: https://github.com/apache/arrow/pull/41752#discussion_r1612742509


##########
java/vector/src/test/java/org/apache/arrow/vector/TestVarCharViewVector.java:
##########
@@ -1455,38 +1457,28 @@ public void 
testSafeOverwriteLongFromALongerLongString() {
     }
   }
 
-  private ViewVarCharVector createViewVarCharVector(BufferAllocator allocator) 
{
-    return newVector(ViewVarCharVector.class, EMPTY_SCHEMA_PATH,
-        Types.MinorType.VIEWVARCHAR, allocator);
-  }
-
-  private ViewVarBinaryVector createViewVarBinaryVector(BufferAllocator 
allocator) {
-    return newVector(ViewVarBinaryVector.class, EMPTY_SCHEMA_PATH,
-        Types.MinorType.VIEWVARBINARY, allocator);
+  static Stream<Arguments> vectorTypeProvider() {
+    return Stream.of(
+        Arguments.of(Types.MinorType.VIEWVARBINARY),
+        Arguments.of(Types.MinorType.VIEWVARCHAR)
+    );
   }
 
-  private BaseVariableWidthViewVector createVector(Types.MinorType type, 
BufferAllocator allocator) {
+  BiFunction<BufferAllocator, MinorType, BaseVariableWidthViewVector> 
vectorCreator = (allocator, type) -> {
     if (type == Types.MinorType.VIEWVARBINARY) {
-      return createViewVarBinaryVector(allocator);
+      return newVector(ViewVarBinaryVector.class, EMPTY_SCHEMA_PATH, 
Types.MinorType.VIEWVARBINARY, allocator);
     } else if (type == Types.MinorType.VIEWVARCHAR) {
-      return createViewVarCharVector(allocator);
+      return newVector(ViewVarCharVector.class, EMPTY_SCHEMA_PATH, 
Types.MinorType.VIEWVARCHAR, allocator);
     } else {
       throw new UnsupportedOperationException("Not supported type : " + type);
     }
-  }
-
-  static Stream<Arguments> vectorTypeAndClassProvider() {
-    return Stream.of(
-        Arguments.of(Types.MinorType.VIEWVARBINARY),
-        Arguments.of(Types.MinorType.VIEWVARCHAR)
-    );
-  }
+  };
 
   @ParameterizedTest
-  @MethodSource({"vectorTypeAndClassProvider"})
+  @MethodSource({"vectorTypeProvider"})

Review Comment:
   No, so: why not just directly have the Function be the parameter? Instead of 
bouncing through the type? We never use `type` in the actual tests.



-- 
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]

Reply via email to