Skip to content

Make use of ValidityProblems during Op matching #105

@hinerm

Description

@hinerm

With the merge of scijava/incubator@2adac43 we now have @Optional parameters. This comes with the caveat that parameters should only be declared in one location, i.e. either an op interface or method implementation, but not both.

The optional-op-param-validation adds tests creating this ambiguous state.

In ops, this state is currently detected and a ValidityProblem is created to record the issue.

However, the actual call into detecting parameter optionality is just passing an anonymous list that is immediately discarded. This results in op requests failing with no information actually provided.

We should, at the least, be actually propagating ValidityProblems and including them in any "No candidates found" report at the end of a failed matching session.

^ this may not be necessary any more since scijava/incubator#83

But I suggest the following:

  • Clean up dead usages of problems lists like this one.
  • Turn ValidityProblem to an enum and use that instead of message string comparison
  • Add a test for each other ValidityProblem type, modeled after the OpMethodDependencyPositionTest

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions