Skip to content

Improve Handling of IAEs in DefaultOpEnvironment.adaptOp #49

Closed
scijava/incubator
#22

Description

@gselzer

This line is prone to throwing IllegalArgumentExceptions in calls such as

ops.op("namespace.name").inType(Foo.class, Bar.class).apply()

This call generates an OpRef looking for a BiFunction<Foo, Bar, Object>. If there is no satisfying BiFunction, adapt will try to look for an adaptor that can generate one. If adaptOpOutputSatisfiesRefTypes() can find an adapt Op to generate the appropriate BiFunction, the output O will not be assigned to a Type and thus substituteTypeVariables cannot substitute the O for some other Type.

Solutions include:

  1. Modifying inferTypeVariables to put some dummy type (i.e. an Any) into the Map
  2. Handling the error throwing within substituteTypeVariables better.

Unfortunately, I was rushed in thinking out this error report, so more details to come.

Activity

  1. added this to the unscheduled milestone on Apr 29, 2021
  2. added a commit that references this issue on Jun 16, 2021
    cc1c4ee
  3. added a commit that references this issue on May 2, 2024
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

    No labels
    No labels

    Type

    No type

    Projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions