Repository navigation
Handle OpMethods that the SciJava Ops Engine module cannot read - #69
Conversation
bfc83a5 to
ce1fefb
Compare
@gselzer do you need to more than just a simple test Op declared in ImageJ-ops2 that hits this path? |
I mean, we can do that, it's just an indirect test. And we'd want to find an Op where it doesn't look weird, i.e. it would look weird to make only one |
I was hoping I could make these methods, but it's just too simple to require a method...
This makes an implicit test for OpMethods in non-readable modules
|
@hinerm alright, I rewrote the One thing that tripped me up during this rewrite is that I mistakenly used a I'm going to create an issue to see if we can get around this by boxing any primitives in |
My solution, for now, is to let it remain, but to guard behind a module visibility check (see 8788ba9) |
SciJava Ops Engine employs two different pathways for turning
public static Methods into Ops. Both of these pathways try to obtain theMethodby loading the owningClass, which fails when theorg.scijava.ops.enginemodule does notrequirethe module containing theMethod. This is the case for ImageJ Ops2, and for all Op-containing modules we'd like to create in the future. This escaped our attention because we hadn't actually created anyOpMethods in ImageJ Ops2 🤦Well, fortunately for us, we don't need to import the Class, because
Discoverywill always give us an instance of thatMethodanyways, and we don't need an owner instance becauseOpMethods must be static. For that reason, we can modify our javassist pathway to callMethod.invokeon theMethodinstance we already have.Points of discussion:
requiresits module, which is only the case for the engine itself right now). Should we get rid of it? Should we add a Module access check to the conditional?TODO: