{"record":{"id":"d293dd38024d2df1","repo":"xpipe-io/xpipe","slug":"names-are-null","errorCode":null,"errorMessage":"Names are null","messagePattern":"Names are null","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/io/xpipe/app/util/StorePath.java","lineNumber":40,"sourceCode":"public class StorePath {\n\n    public static final char SEPARATOR = '/';\n\n    private final List<String> names;\n\n    @JsonCreator\n    public StorePath(List<String> names) {\n        this.names = names;\n    }\n\n    /**\n     * Creates a new store path.\n     *\n     * @throws IllegalArgumentException if any name is not valid\n     */\n    public static StorePath create(String... names) {\n        if (names == null) {\n            throw new IllegalArgumentException(\"Names are null\");\n        }\n\n        if (Arrays.stream(names).anyMatch(s -> s == null)) {\n            throw new IllegalArgumentException(\"Name is null\");\n        }\n\n        if (Arrays.stream(names).anyMatch(s -> s.contains(\"\" + SEPARATOR))) {\n            throw new IllegalArgumentException(\"Separator character \" + SEPARATOR + \" is not allowed in the names\");\n        }\n\n        if (Arrays.stream(names).anyMatch(s -> s.strip().length() == 0)) {\n            throw new IllegalArgumentException(\"Trimmed entry name is empty\");\n        }\n\n        return new StorePath(Arrays.stream(names).toList());\n    }\n\n    /**","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/xpipe-io/xpipe/blob/d85ca821baa46092a320ebb13546d7240adb74f8/app/src/main/java/io/xpipe/app/util/StorePath.java#L22-L58","documentation":"StorePath.create throws IllegalArgumentException when the varargs names array itself is null. StorePath models hierarchical store names, so a null array is invalid input rather than an empty path. This is a defensive API contract check.","triggerScenarios":"Calling StorePath.create((String[]) null) or passing a null String[] variable, typically from code that assembled names dynamically and ended with null.","commonSituations":"Building names from configuration where a list field was missing and null was forwarded; reflection or generic varargs calls passing null arrays.","solutions":["Ensure the names array is initialized before calling create; use an empty array or default value","Validate upstream config/data that produces the names list","Coalesce null lists to empty arrays at the call site"],"exampleFix":"// before\nString[] names = config.getNames(); // may be null\nStorePath path = StorePath.create(names);\n// after\nString[] names = config.getNames() != null ? config.getNames() : new String[0];\nStorePath path = StorePath.create(names);","handlingStrategy":"validation","validationCode":"if (names == null) {\n    names = new String[0]; // or throw a meaningful domain error\n}\nStorePath path = StorePath.create(names);","typeGuard":"boolean hasNames(String[] names) { return names != null; }","tryCatchPattern":"try {\n    StorePath.create(names);\n} catch (IllegalArgumentException e) {\n    logger.error(\"invalid store path input: {}\", e.getMessage());\n}","preventionTips":["Initialize name arrays with defaults instead of null","Validate config-derived name lists at load time","Never forward possibly-null varargs arrays"],"tags":["validation","null","argument"],"backgroundTag":"null-argument","analyzedSha":"d85ca821baa46092a320ebb13546d7240adb74f8","analyzedAt":"2026-09-06T14:30:08.251Z","contentChangedAt":"2026-09-06T14:30:08.251Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}