Commit b0c981b
committed
Merge branch 'recursive-injection'
This enhances the behavior of context injection to recursively inject
@Parameter-annotated fields when the field value is already assigned
to an object reference. This is especially useful for CommandModule,
which keeps a reference to its delegate Command instance. This Command
instance also needs the context injected at the same time it is injected
into the CommandModule instance. In the past, a couple of different
hacky solutions were employed, such as injecting the context into the
Command as part of initialize() -- but each hack had its limitations.
The best solution is to actually inject the context into member fields
at the same time it is injected into the base object itself.
This change ensures that Command instances always receive a context
injection immediately, even if e.g. no preprocessing is performed.
This branch is dedicated to Richard Domander.File tree
3 files changed
+38
-1
lines changed- src
- main/java/org/scijava
- command
- test/java/org/scijava/command
3 files changed
+38
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
471 | 471 | | |
472 | 472 | | |
473 | 473 | | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
474 | 479 | | |
475 | 480 | | |
476 | 481 | | |
| |||
533 | 538 | | |
534 | 539 | | |
535 | 540 | | |
536 | | - | |
537 | 541 | | |
538 | 542 | | |
539 | 543 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
115 | 130 | | |
116 | 131 | | |
117 | 132 | | |
| |||
235 | 250 | | |
236 | 251 | | |
237 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
238 | 270 | | |
0 commit comments