Skip to content

TokenStreamFactory.createNonBlockingByteBufferParser() return type wrong #1527

Closed

Description

@hb16

Both createNonBlockingByteArrayParser() and createNonBlockingByteBufferParser() in TokenStreamFactory have the same type bound for the return type:

P extends JsonParser & ByteArrayFeeder

I'd expect the type for createNonBlockingByteBufferParser() to be

P extends JsonParser & ByteBufferFeeder.

Is this a copy-paste error or am I missing something?

Activity

  1. pjfanning commented on Dec 12, 2025

    @pjfanning
    Member

    @hb16 the method signature is wrong - can you use JsonFactory for now? JsonFactory has the method and you can cast its return type to ByteBufferFeeder. We will try to fix the return types in an upcoming release.

  2. cowtowncoder commented on Dec 12, 2025

    @cowtowncoder
    Member

    Definitely copy-paste fail. Embarrassing.

  3. added
    3.xIssues to be only tackled for some future 3.x version
    on Dec 12, 2025
  4. changed the title [-]createNonBlockingByteBufferParser() return type[/-] [+]`TokenStreamFactoy.createNonBlockingByteBufferParser()` return type wrong[/+] on Dec 12, 2025
  5. changed the title [-]`TokenStreamFactoy.createNonBlockingByteBufferParser()` return type wrong[/-] [+]`TokenStreamFactory.createNonBlockingByteBufferParser()` return type wrong[/+] on Dec 12, 2025
  6. modified the milestones: 3.1., 3.1.0 on Dec 12, 2025
  7. added and removed
    3.xIssues to be only tackled for some future 3.x version
    on Dec 12, 2025
  8. cowtowncoder commented on Dec 12, 2025

    @cowtowncoder
    Member

    Fixed by #1528

  9. pjfanning commented on Dec 12, 2025

    @pjfanning
    Member

    You'd really have expected that the Java parser would have prevented this.

  10. cowtowncoder commented on Dec 12, 2025

    @cowtowncoder
    Member

    @pjfanning I think part of the problem was override in JsonFactory that used too generic return type, instead of indicating mismatch with TokenStreamFactory base typing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions