Skip to content

Commit 85122f6

Browse files
committed
Improve order of preprocessor plugins
The validity check should come extremely early. After that, the Gateway and Service population should happen ASAP. Only then should we consider others such as single typed inputs. Without this change, it was possible for parameter validator methods to fire before services were populated.
1 parent c988ebf commit 85122f6

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/main/java/org/scijava/module/process/GatewayPreprocessor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@
5252
*
5353
* @author Curtis Rueden
5454
*/
55-
@Plugin(type = PreprocessorPlugin.class,
56-
priority = Priority.VERY_HIGH_PRIORITY)
55+
@Plugin(type = PreprocessorPlugin.class, //
56+
priority = 2 * Priority.VERY_HIGH_PRIORITY)
5757
public class GatewayPreprocessor extends AbstractPreprocessorPlugin {
5858

5959
@Parameter

src/main/java/org/scijava/module/process/ServicePreprocessor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@
6161
*
6262
* @author Curtis Rueden
6363
*/
64-
@Plugin(type = PreprocessorPlugin.class,
65-
priority = Priority.VERY_HIGH_PRIORITY)
64+
@Plugin(type = PreprocessorPlugin.class, //
65+
priority = 2 * Priority.VERY_HIGH_PRIORITY)
6666
public class ServicePreprocessor extends AbstractPreprocessorPlugin {
6767

6868
// -- ModuleProcessor methods --

src/main/java/org/scijava/module/process/ValidityPreprocessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
* @author Curtis Rueden
4545
*/
4646
@Plugin(type = PreprocessorPlugin.class,
47-
priority = Priority.VERY_HIGH_PRIORITY + 1)
47+
priority = 3 * Priority.VERY_HIGH_PRIORITY)
4848
public class ValidityPreprocessor extends AbstractPreprocessorPlugin {
4949

5050
// -- ModuleProcessor methods --

0 commit comments

Comments
 (0)