Skip to content

Commit c225eb2

Browse files
committed
Context: improve javadoc
1) Mention that it is OK for the passed pluginIndex to be null. 2) Remove the "NB" block about how PluginIndex#discover() "may" still be called. Actually, it is definitely always called, unless a subclass of PluginIndex is passed. And the attached PluginFinder will be used. We may still want to mention this, maybe, but if so it should be done in the main Context ctor rather than one of the convenience ones.
1 parent 8146999 commit c225eb2

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/main/java/org/scijava/Context.java

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -125,20 +125,15 @@ public Context(final Collection<Class<? extends Service>> serviceClasses) {
125125
/**
126126
* Creates a new SciJava application with the specified PluginIndex. This
127127
* allows a base set of available plugins to be defined, and is useful when
128-
* plugins that would not be returned by the PluginIndex's PluginFinder are
129-
* desired.
130-
* <p>
131-
* NB: the {@link PluginIndex#discover()} method may still be called, adding
132-
* additional plugins to this index. The mechanism of discovery should be
133-
* configured exclusively through the attached
134-
* {@link org.scijava.plugin.PluginFinder}.
135-
* </p>
128+
* plugins that would not be returned by the {@link PluginIndex}'s
129+
* {@link org.scijava.plugin.PluginFinder} are desired.
136130
*
137131
* @param pluginIndex The plugin index to use when discovering and indexing
138132
* plugins. If you wish to completely control how services are
139133
* discovered (i.e., use your own
140134
* {@link org.scijava.plugin.PluginFinder} implementation), then you
141-
* can pass a custom {@link PluginIndex} here.
135+
* can pass a custom {@link PluginIndex} here. Passing null will
136+
* result in a default plugin index being constructed and used.
142137
*/
143138
@SuppressWarnings("unchecked")
144139
public Context(final PluginIndex pluginIndex) {
@@ -166,7 +161,8 @@ public Context(final PluginIndex pluginIndex) {
166161
* plugins. If you wish to completely control how services are
167162
* discovered (i.e., use your own
168163
* {@link org.scijava.plugin.PluginFinder} implementation), then you
169-
* can pass a custom {@link PluginIndex} here.
164+
* can pass a custom {@link PluginIndex} here. Passing null will
165+
* result in a default plugin index being constructed and used.
170166
*/
171167
public Context(final Collection<Class<? extends Service>> serviceClasses,
172168
final PluginIndex pluginIndex)

0 commit comments

Comments
 (0)