Skip to content

Commit c0e4006

Browse files
jduokou
authored andcommitted
GH-38387: [Java] Fix JDK8 compilation issue with TestAllTypes (#38388)
### Rationale for this change There is a build error due to use of a JDK9 API ### What changes are included in this PR? Change construction of a list of to use JDK8 functions instead of a JDK9 function. ### Are these changes tested? Yes. ### Are there any user-facing changes? No. **This PR contains a "Critical Fix".** * Closes: #38387 Authored-by: James Duong <duong.james@gmail.com> Signed-off-by: David Li <li.davidm96@gmail.com>
1 parent d68b201 commit c0e4006

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

dataset/src/test/java/org/apache/arrow/dataset/TestAllTypes.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import java.nio.channels.SeekableByteChannel;
2525
import java.nio.channels.WritableByteChannel;
2626
import java.util.ArrayList;
27+
import java.util.Arrays;
2728
import java.util.Collections;
2829
import java.util.List;
2930
import java.util.Objects;
@@ -97,7 +98,7 @@ private VectorSchemaRoot generateAllTypesVector(BufferAllocator allocator) {
9798
new FieldType(false, new ArrowType.Int(32, true), null, null), null));
9899
Field structField = new Field("struct",
99100
new FieldType(true, ArrowType.Struct.INSTANCE, null, null), childFields);
100-
List<Field> fields = List.of(
101+
Field[] fields = new Field[] {
101102
Field.nullablePrimitive("null", ArrowType.Null.INSTANCE),
102103
Field.nullablePrimitive("bool", ArrowType.Bool.INSTANCE),
103104
Field.nullablePrimitive("int8", new ArrowType.Int(8, true)),
@@ -132,8 +133,8 @@ private VectorSchemaRoot generateAllTypesVector(BufferAllocator allocator) {
132133
new Field("fixedsizelist", FieldType.nullable(new ArrowType.FixedSizeList(2)),
133134
Collections.singletonList(Field.nullable("items", new ArrowType.Int(32, true)))),
134135
structField
135-
);
136-
VectorSchemaRoot root = VectorSchemaRoot.create(new Schema(fields), allocator);
136+
};
137+
VectorSchemaRoot root = VectorSchemaRoot.create(new Schema(Arrays.asList(fields)), allocator);
137138
root.allocateNew();
138139
root.setRowCount(2);
139140

0 commit comments

Comments
 (0)