{"record":{"id":"b0000cad143d0e3b","repo":"apache/hadoop","slug":"progress-must-not-be-null","errorCode":null,"errorMessage":"Progress must not be null","messagePattern":"Progress must not be null","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/Options.java","lineNumber":147,"sourceCode":"      public ChecksumOpt getValue() { return checksumOpt; }\n    }\n    \n    public static class Perms extends CreateOpts {\n      private final FsPermission permissions;\n      protected Perms(FsPermission perm) { \n        if(perm == null) {\n          throw new IllegalArgumentException(\"Permissions must not be null\");\n        }\n        permissions = perm; \n      }\n      public FsPermission getValue() { return permissions; }\n    }\n    \n    public static class Progress extends CreateOpts {\n      private final Progressable progress;\n      protected Progress(Progressable prog) { \n        if(prog == null) {\n          throw new IllegalArgumentException(\"Progress must not be null\");\n        }\n        progress = prog;\n      }\n      public Progressable getValue() { return progress; }\n    }\n    \n    public static class CreateParent extends CreateOpts {\n      private final boolean createParent;\n      protected CreateParent(boolean createPar) {\n        createParent = createPar;}\n      public boolean getValue() { return createParent; }\n    }\n\n    \n    /**\n     * Get an option of desired type\n     * @param clazz is the desired class of the opt\n     * @param opts - not null - at least one opt must be passed","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/Options.java#L129-L165","documentation":"Options.CreateOpts.Progress (FileSystem.create(path, CreateOpts.progresser(p), ...)) requires a non-null Progressable; null throws IllegalArgumentException because the option must reference a real progress callback.","triggerScenarios":"CreateOpts.progress(null) or new CreateOpts.Progress(null) — e.g. a helper that accepts an optional progress callback and forwards it without a null guard.","commonSituations":"Optional progress parameters in wrapper APIs, code paths where progress reporting is only sometimes wired up.","solutions":["Pass a no-op Progressable when the caller has no callback","Omit the Progress option so create() uses the filesystem default","Null-check optional callback parameters before building opts"],"exampleFix":"// before\nCreateOpts.progress(progress);         // progress == null\n// after\nCreateOpts.progress(progress != null ? progress\n    : new Progressable() { @Override public void progress() {} });","handlingStrategy":"validation","validationCode":"Progressable prog = (progress != null) ? progress\n    : new Progressable() { @Override public void progress() {} };\nout = fs.create(p, CreateOpts.progress(prog));","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pass a no-op Progressable when no callback exists","Omit the Progress option to use the FS default","Null-check optional callbacks at API boundaries"],"tags":["create-options","progressable","null-argument","validation"],"backgroundTag":"null-create-option","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}