Skip to content

NIFI-15523: Fix EventIterator of factory not returning items#10837

Merged
exceptionfactory merged 3 commits intoapache:mainfrom
ohnoitsyou:NIFI-15523
Feb 1, 2026
Merged

NIFI-15523: Fix EventIterator of factory not returning items#10837
exceptionfactory merged 3 commits intoapache:mainfrom
ohnoitsyou:NIFI-15523

Conversation

@ohnoitsyou
Copy link
Contributor

@ohnoitsyou ohnoitsyou commented Jan 30, 2026

An EventIterator created using the of factory would return Optional.empty() when there are actually items in the internal iterator.

Flipping the ternary result expressions fixes this issue.

Added some basic tests to exercise the two factories and the default filter implementation.

Summary

NIFI-15523

Tracking

Please complete the following tracking steps prior to pull request creation.

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-00000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-00000
  • Pull request contains commits signed with a registered key indicating Verified status

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • Pull Request refers to a feature branch with one commit containing changes

Verification

Please indicate the verification steps performed prior to pull request creation.

Build

  • Build completed using ./mvnw clean install -P contrib-check
    • JDK 21
    • JDK 25

Licensing

  • New dependencies are compatible with the Apache License 2.0 according to the License Policy
  • New dependencies are documented in applicable LICENSE and NOTICE files

Documentation

  • Documentation formatting appears as expected in rendered files

@ohnoitsyou ohnoitsyou force-pushed the NIFI-15523 branch 2 times, most recently from 8841d27 to 7decfc1 Compare January 30, 2026 18:32
An EventIterator created using the `of` factory would return
Optional.empty() when there are actually items in the internal iterator.

Flipping the ternary result expressions fixes this issue.

Added some basic tests to exercise the two factories and the default
filter implementation.
Copy link
Contributor

@exceptionfactory exceptionfactory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for finding and addressing this issue @ohnoitsyou.

The EventIterator changes look good. I noted a couple minor syntax issues in the test class, then this should be ready to go.

Copy link
Contributor

@exceptionfactory exceptionfactory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making the adjustments @ohnoitsyou! +1 merging

@exceptionfactory exceptionfactory merged commit 2610c5c into apache:main Feb 1, 2026
14 of 19 checks passed
@ohnoitsyou ohnoitsyou deleted the NIFI-15523 branch February 2, 2026 20:47
mark-bathori pushed a commit to mark-bathori/nifi that referenced this pull request Feb 5, 2026
…apache#10837)

- EventIterator created using the `of` factory would return Optional.empty() when there are actually items in the internal iterator
- Flipping the ternary result expressions fixed this issue

Signed-off-by: David Handermann <exceptionfactory@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants