Commit c68bf45
committed
Do not inject delegate command classes
Instead, let the ServicePreprocessor handle them.
It turns out it is very tricky to inject the context into the Command
instance at the proper time. The best time would be precisely when the
CommandModule instance has its context injected, but unfortunately,
there is no hook to trigger behavior in response to context injection.
It is not guaranteed that Contextual#setContext(Context) be called.
Injecting the context into the Command instance during
ContextModule#initialize() appeared to work on the surface, but actually
deferred population of Service parameters until the InitPreprocessor
was called; such behavior was unintuitive and dare I say bogus.
Furthermore, by suppressing Service and Context parameters from the list
of Command inputs, we made commands behave differently than scripts: the
latter report Service and Context parameters as input parameters,
whereas the former did not. With this change, that discrepancy is fixed.1 parent 85122f6 commit c68bf45
File tree
2 files changed
+0
-15
lines changed- src/main/java/org/scijava/command
2 files changed
+0
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
| |||
55 | 54 | | |
56 | 55 | | |
57 | 56 | | |
58 | | - | |
59 | 57 | | |
60 | 58 | | |
61 | 59 | | |
| |||
451 | 449 | | |
452 | 450 | | |
453 | 451 | | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | 452 | | |
460 | 453 | | |
461 | 454 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
| |||
144 | 143 | | |
145 | 144 | | |
146 | 145 | | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | 146 | | |
155 | 147 | | |
156 | 148 | | |
| |||
0 commit comments