Skip to content

Commit

Permalink
GH-38387: [Java] Fix JDK8 compilation issue with TestAllTypes (#38388)
Browse files Browse the repository at this point in the history
### 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 <[email protected]>
Signed-off-by: David Li <[email protected]>
  • Loading branch information
jduo authored Oct 22, 2023
1 parent 4bbd48d commit cb7996f
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.nio.channels.SeekableByteChannel;
import java.nio.channels.WritableByteChannel;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
Expand Down Expand Up @@ -97,7 +98,7 @@ private VectorSchemaRoot generateAllTypesVector(BufferAllocator allocator) {
new FieldType(false, new ArrowType.Int(32, true), null, null), null));
Field structField = new Field("struct",
new FieldType(true, ArrowType.Struct.INSTANCE, null, null), childFields);
List<Field> fields = List.of(
Field[] fields = new Field[] {
Field.nullablePrimitive("null", ArrowType.Null.INSTANCE),
Field.nullablePrimitive("bool", ArrowType.Bool.INSTANCE),
Field.nullablePrimitive("int8", new ArrowType.Int(8, true)),
Expand Down Expand Up @@ -132,8 +133,8 @@ private VectorSchemaRoot generateAllTypesVector(BufferAllocator allocator) {
new Field("fixedsizelist", FieldType.nullable(new ArrowType.FixedSizeList(2)),
Collections.singletonList(Field.nullable("items", new ArrowType.Int(32, true)))),
structField
);
VectorSchemaRoot root = VectorSchemaRoot.create(new Schema(fields), allocator);
};
VectorSchemaRoot root = VectorSchemaRoot.create(new Schema(Arrays.asList(fields)), allocator);
root.allocateNew();
root.setRowCount(2);

Expand Down

0 comments on commit cb7996f

Please sign in to comment.