{"record":{"id":"88620d2d505ba106","repo":"apache/incubator-seata","slug":"name-can-t-be-null","errorCode":null,"errorMessage":"name can't be null","messagePattern":"name can't be null","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"config/seata-config-core/src/main/java/org/apache/seata/config/FileConfiguration.java","lineNumber":137,"sourceCode":"            this.allowDynamicRefresh = allowDynamicRefresh;\n            if (LOGGER.isDebugEnabled()) {\n                LOGGER.debug(\"The file name of the operation is {}\", name);\n            }\n        }\n        this.name = name;\n        configOperateExecutor = new ThreadPoolExecutor(\n                CORE_CONFIG_OPERATE_THREAD,\n                MAX_CONFIG_OPERATE_THREAD,\n                Integer.MAX_VALUE,\n                TimeUnit.MILLISECONDS,\n                new LinkedBlockingQueue<>(),\n                new NamedThreadFactory(\"configOperate\", MAX_CONFIG_OPERATE_THREAD));\n    }\n\n    private File getConfigFile(String name) {\n        try {\n            if (name == null) {\n                throw new IllegalArgumentException(\"name can't be null\");\n            }\n\n            boolean filePathCustom = name.startsWith(SYS_FILE_RESOURCE_PREFIX);\n            String filePath = filePathCustom ? name.substring(SYS_FILE_RESOURCE_PREFIX.length()) : name;\n            String decodedPath = URLDecoder.decode(filePath, StandardCharsets.UTF_8.name());\n            File targetFile = getFileFromFileSystem(decodedPath);\n            if (targetFile != null) {\n                return targetFile;\n            }\n\n            if (!filePathCustom) {\n                targetFile = getFileFromClasspath(name);\n                if (targetFile != null) {\n                    return targetFile;\n                }\n            }\n        } catch (UnsupportedEncodingException e) {\n            LOGGER.error(\"decode name error: {}\", e.getMessage(), e);","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/apache/incubator-seata/blob/e01f97c6db397165050caa6764020410c2c8199a/config/seata-config-core/src/main/java/org/apache/seata/config/FileConfiguration.java#L119-L155","documentation":"FileConfiguration.getConfigFile(name) throws IllegalArgumentException(\"name can't be null\") when asked to resolve a config file whose name is null. The method locates files from the filesystem or classpath (with an optional 'file:' prefix); a null name means the caller asked which file corresponds to no configuration and is rejected up front.","triggerScenarios":"Passing a null name directly, or a derived name being null — e.g. ConfigurationFactory asking for the config file from a system property (seata.config.name / property such as file.conf name) that was set to an empty/absent value and normalized to null.","commonSituations":"Programmatic bootstrap where the config-file name property is optional and unset; wrappers calling getConfigFile with a value read from an unpopulated map; tests constructing FileConfiguration without a name argument path.","solutions":["Pass an explicit file name (commonly 'file.conf' or 'registry.conf').","Default the name when reading from properties: name == null ? 'file.conf' : name.","Check that the seata.config.name JVM property / env var you rely on is actually set at runtime."],"exampleFix":"// before\nFile f = getConfigFile(fileName);\n\n// after\nFile f = getConfigFile(fileName != null ? fileName : DEFAULT_FILE_NAME);","handlingStrategy":"validation","validationCode":"if (name == null || name.trim().isEmpty()) {\n    name = \"file.conf\"; // or fail fast with a descriptive error\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Default optional file-name properties at the edges of your bootstrap code","Assert required system properties (seata.config.name) early with clear messages"],"tags":["config","null-safety","file","validation","seata"],"backgroundTag":null,"analyzedSha":"e01f97c6db397165050caa6764020410c2c8199a","analyzedAt":"2026-08-14T10:23:53.097Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}