Skip to content

Fix wrapping errors with subinterfaces #52

Closed

Description

@gselzer

Suppose we wrote some

public interface DoubleFunction extends Function<Double, Double> {}

and some Ops to go with it. Then, we ask Ops for one of those DoubleFunctions using

DoubleFunction df = env.op("fooOp", new Nil<DoubleFunction>(), new Nil[] {new Nil<Double>()}, new Nil<Double>())

Currently, if ops can find a suitable DoubleFunction it will wrap it into a GenericTypedFunction, and then will encounter a ClassCastException (because a GenericTypedFunction is obviously not a DoubleFunction)

The solution to this problem involves changing DefaultOpEnvironment.getWrapperClass(). It might be that we should only wrap if there is a wrapper for the direct superInterface of a particular Op.

Activity

  1. gselzer commented on Feb 9, 2021

    @gselzer
    MemberAuthor

    This issue was resolved via scijava/incubator#25

  2. 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

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions