Commit ca1aa0d
committed
PluginInfo: fall back to @plugin class annotation
Normally, plugins are discovered by scanning the SJC annotation index,
present in the resource META-INF/json/org.scijava.plugin.Plugin.
However, PluginInfo objects can also be created explicitly and added
directly to a PluginIndex. This is especially useful for unit tests.
When this happens, the PluginInfo(String, Class) constructor passed a
null Plugin annotation, resulting in no plugin metadata at all. It is
much better for the code path through that constructor to scrap the
given Class for its associated Plugin annotation, if any.1 parent 27fb650 commit ca1aa0d
1 file changed
+7
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
181 | | - | |
182 | | - | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
183 | 185 | | |
| 186 | + | |
| 187 | + | |
184 | 188 | | |
185 | 189 | | |
186 | 190 | | |
| |||
0 commit comments