{"record":{"id":"871e69f84ae2bf7f","repo":"apache/pulsar","slug":"supplier-is-not-specified","errorCode":null,"errorMessage":"Supplier is not specified!","messagePattern":"Supplier is not specified!","errorType":"validation","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/Actions.java","lineNumber":53,"sourceCode":"    @Data\n    @Builder(toBuilder = true)\n    public static class Action {\n        private String actionName;\n        @Builder.Default\n        private int numRetries = 1;\n        private Supplier<ActionResult> supplier;\n        @Builder.Default\n        private long sleepBetweenInvocationsMs = 500;\n        private Boolean continueOn;\n        private Consumer<ActionResult> onFail;\n        private Consumer<ActionResult> onSuccess;\n\n        public void verifyAction() {\n            if (isBlank(actionName)) {\n                throw new RuntimeException(\"Action name is empty!\");\n            }\n            if (supplier == null) {\n                throw new RuntimeException(\"Supplier is not specified!\");\n            }\n        }\n    }\n\n    @Data\n    @Builder\n    public static class ActionResult {\n        private boolean success;\n        private String errorMsg;\n        private Object result;\n    }\n\n    private Actions() {\n\n    }\n\n\n    public Actions addAction(Action action) {","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/Actions.java#L35-L71","documentation":"Actions.verifyAction requires each Action to have a supplier that performs the actual work and yields an ActionResult. If the supplier was never set on the builder, verifyAction throws this RuntimeException, since an action without work cannot be executed.","triggerScenarios":"Building an Action with Action.builder().actionName(\"x\").build() (no .supplier(...)) and registering it through ActionChainBuilder.addAction, which calls verifyAction and finds supplier == null.","commonSituations":"copying an action template and deleting the lambda; conditional builder code paths that skip setting the supplier; refactoring where the supplier moved into another builder method no longer called.","solutions":["Set the supplier on the builder: Action.builder().actionName(\"x\").supplier(() -> doWork())...","Ensure the code path that sets the supplier is actually executed (no early return / wrong branch)","If the action intentionally does no work, supply a no-op supplier returning a completed ActionResult"],"exampleFix":"// before\nAction.builder().actionName(\"noop\").build();\n// after\nAction.builder().actionName(\"noop\").supplier(() -> ActionResult.builder().success(true).build()).build();","handlingStrategy":"validation","validationCode":"if (supplier == null) {\n    throw new IllegalArgumentException(\"Action supplier must be set before building Action\");\n}","typeGuard":"static boolean hasSupplier(Actions.Action action) {\n    return action != null && action.getSupplier() != null;\n}","tryCatchPattern":"try {\n    action.verifyAction();\n} catch (RuntimeException e) {\n    if (e.getMessage().equals(\"Supplier is not specified!\")) { /* add .supplier(...) to the builder */ }\n}","preventionTips":["Never build an Action without .supplier(...)","Review builder chains after refactoring to ensure no required call was dropped","Use a helper factory that requires the supplier parameter"],"tags":["pulsar-io","validation","builder"],"backgroundTag":"required-field-missing","analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}