{"record":{"id":"1090b4fafbfd278b","repo":"apache/seatunnel","slug":"hugegraphconnectorerrorcode-illegal-config-argumen","errorCode":"HugeGraphConnectorErrorCode.ILLEGAL_CONFIG_ARGUMENT","errorMessage":"The '%s' can't be null","messagePattern":"The '(.+?)' can't be null","errorType":"error_code","errorClass":"HugeGraphConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-hugegraph/src/main/java/org/apache/seatunnel/connectors/seatunnel/hugegraph/utils/E.java","lineNumber":52,"sourceCode":"        }\n    }\n\n    public static void checkNotNull(Object object, String elem, String owner) {\n        if (object == null) {\n            throw new HugeGraphConnectorException(\n                    HugeGraphConnectorErrorCode.ILLEGAL_CONFIG_ARGUMENT,\n                    String.format(\"The '%s' of '%s' can't be null\", elem, owner));\n        }\n    }\n\n    public static void checkNotEmpty(Collection<?> collection, String elem) {\n        if (collection == null) {\n            throw new HugeGraphConnectorException(\n                    HugeGraphConnectorErrorCode.ILLEGAL_CONFIG_ARGUMENT,\n                    String.format(\"The '%s' can't be null\", elem));\n        }\n        if (collection.isEmpty()) {\n            throw new HugeGraphConnectorException(\n                    HugeGraphConnectorErrorCode.ILLEGAL_CONFIG_ARGUMENT,\n                    String.format(\"The '%s' can't be empty\", elem));\n        }\n    }\n\n    public static void checkNotEmpty(Collection<?> collection, String elem, String owner) {\n        if (collection == null) {\n            throw new HugeGraphConnectorException(\n                    HugeGraphConnectorErrorCode.ILLEGAL_CONFIG_ARGUMENT,\n                    String.format(\"The '%s' of '%s' can't be null\", elem, owner));\n        }\n        if (collection.isEmpty()) {\n            throw new HugeGraphConnectorException(\n                    HugeGraphConnectorErrorCode.ILLEGAL_CONFIG_ARGUMENT,\n                    String.format(\"The '%s' of '%s' can't be empty\", elem, owner));\n        }\n    }\n","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-hugegraph/src/main/java/org/apache/seatunnel/connectors/seatunnel/hugegraph/utils/E.java#L34-L70","documentation":"Null branch of E.checkNotEmpty(collection, elem): throws when the named collection is null (message 'The %s can't be null', code HugeGraphConnectorErrorCode.ILLEGAL_CONFIG_ARGUMENT). Distinguishes 'not provided at all' from 'provided but empty'.","triggerScenarios":"The named collection option is entirely missing from the config so the connector receives null when checking non-emptiness.","commonSituations":"Required list option omitted in the job HOCON; key typo so the option resolves to null; programmatic config builders skipping the field.","solutions":["Add the missing collection option to the config","Fix the option key spelling to match the documented Option","Initialize the collection when building configs programmatically"],"exampleFix":"// before: no 'labels' key\n// after\nlabels = [\"person\", \"company\"]","handlingStrategy":"validation","validationCode":"if (cfg.get(\"labels\") == null) {\n    throw new IllegalArgumentException(\"labels is required\");\n}","typeGuard":"boolean isProvidedCollection(Map<String,Object> cfg, String key) { return cfg.get(key) instanceof Collection; }","tryCatchPattern":"try {\n    source.prepare(config);\n} catch (HugeGraphConnectorException e) {\n    if (String.valueOf(e.getMessage()).matches(\"The '.*' can't be null\")) {\n        // add the missing list option\n    }\n    throw e;\n}","preventionTips":["List all required options in job config checklists","Diff configs against working examples","Use schema-validated config formats"],"tags":["hugegraph","null-collection","config"],"backgroundTag":"missing-required-config-field","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}