Skip to content

Commit

Permalink
fix java 11 compatability
Browse files Browse the repository at this point in the history
  • Loading branch information
bechte committed Jul 22, 2024
1 parent ac87c0d commit b79e2ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public Collection<FieldValue> getFieldValues(IndexConfig indexConfig, IndexedPro
if (referencedObject instanceof ItemModel) {
final ItemModel referencedItem = (ItemModel) referencedObject;
return getFieldValuesFromDelegate(indexConfig, indexedProperty, referencedItem, delegate);
} else if (referencedObject instanceof Collection<?> elements) {
} else if (referencedObject instanceof Collection<?>) {
final Collection<?> elements = (Collection<?>) referencedObject;
final Collection<FieldValue> fieldValues = new ArrayList<>();
for (Object element : elements) {
fieldValues.addAll(getFieldValuesFromDelegate(indexConfig, indexedProperty, element, delegate));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public void resolve(InputDocument inputDocument, IndexerBatchContext indexerBatc
resolveWithDelegate(inputDocument, indexerBatchContext, indexedProperty, referencedItem, delegate);
} else if (referencedObject instanceof Collection) {
for (Object element : (Collection) referencedObject) {
if (element instanceof ItemModel referencedItem) {
resolveWithDelegate(inputDocument, indexerBatchContext, indexedProperty, referencedItem, delegate);
if (element instanceof ItemModel) {
resolveWithDelegate(inputDocument, indexerBatchContext, indexedProperty, (ItemModel) element, delegate);
}
}
}
Expand Down

0 comments on commit b79e2ef

Please sign in to comment.