Skip to content

Commit d889499

Browse files
committed
fix: get first element in the list with .get(0)
List::getFirst is not introduced until Java 21
1 parent 5487068 commit d889499

File tree

1 file changed

+3
-3
lines changed
  • src/main/java/io/weaviate/client/v1/experimental

1 file changed

+3
-3
lines changed

src/main/java/io/weaviate/client/v1/experimental/Where.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ static Operand fromObject(Object value) {
130130
} else if (value instanceof List) {
131131
assert ((List<?>) value).isEmpty() : "list must not be empty";
132132

133-
Object first = ((List<?>) value).getFirst();
133+
Object first = ((List<?>) value).get(0);
134134
if (first instanceof String) {
135135
return new $TextArray((List<String>) value);
136136
} else if (first instanceof Boolean) {
@@ -510,7 +510,7 @@ public void append(Filters.Builder where) {
510510
case 0:
511511
return;
512512
case 1: // no need for operator
513-
operands.getFirst().append(where);
513+
operands.get(0).append(where);
514514
return;
515515
case 2: // Comparison operators: eq, gt, lt, like, etc.
516516
operands.forEach(op -> op.append(where));
@@ -540,7 +540,7 @@ private Path(String... property) {
540540
public void append(Filters.Builder where) {
541541
// Deprecated, but the current proto doesn't have 'path'.
542542
if (!path.isEmpty()) {
543-
where.addOn(path.getFirst());
543+
where.addOn(path.get(0));
544544
}
545545
// FIXME: no way to reference objects rn?
546546
}

0 commit comments

Comments
 (0)