Skip to content

Commit 75a244c

Browse files
dschoctrueden
authored andcommitted
Support implicit input parameters in modules
It is sometimes important to support parameters that have not been specified explicitly by the module, e.g. in ImageJ 1.x macros, where we need to be able to set the macro options as an engine-specific setting because the SciJava script service runs scripts on threads different from the caller's and ImageJ 1.x cannot handle that properly without some handholding. This change introduces a special class of settings: input map entries whose key starts with a dot (e.g. .macroOptions) are considered implicit, i.e. no errors about "no such parameter" will be produced. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent d91ed2f commit 75a244c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/org/scijava/module/DefaultModuleService.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,10 @@ private void assignInputs(final Module module,
346346
final Object value = inputMap.get(name);
347347
final Object converted;
348348
if (input == null) {
349-
log.warn("Unmatched input: " + name);
349+
// inputs whose name starts with a dot are implicitly known by convention
350+
if (!name.startsWith(".")) {
351+
log.warn("Unmatched input: " + name);
352+
}
350353
converted = value;
351354
}
352355
else {

0 commit comments

Comments
 (0)