{"record":{"id":"67a3f488053dcfd8","repo":"didi/DoKit","slug":"priority-invalid","errorCode":null,"errorMessage":"Priority invalid.","messagePattern":"Priority invalid\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"Android/dokit/src/main/java/com/didichuxing/doraemonkit/picasso/Request.java","lineNumber":411,"sourceCode":"    /** Clear the rotation transformation, if any. */\n    public Builder clearRotation() {\n      rotationDegrees = 0;\n      rotationPivotX = 0;\n      rotationPivotY = 0;\n      hasRotationPivot = false;\n      return this;\n    }\n\n    /** Decode the image using the specified config. */\n    public Builder config(Bitmap.Config config) {\n      this.config = config;\n      return this;\n    }\n\n    /** Execute request using the specified priority. */\n    public Builder priority(Priority priority) {\n      if (priority == null) {\n        throw new IllegalArgumentException(\"Priority invalid.\");\n      }\n      if (this.priority != null) {\n        throw new IllegalStateException(\"Priority already set.\");\n      }\n      this.priority = priority;\n      return this;\n    }\n\n    /**\n     * Add a custom transformation to be applied to the image.\n     * <p>\n     * Custom transformations will always be run after the built-in transformations.\n     */\n    public Builder transform(com.didichuxing.doraemonkit.picasso.Transformation transformation) {\n      if (transformation == null) {\n        throw new IllegalArgumentException(\"Transformation must not be null.\");\n      }\n      if (transformation.key() == null) {","sourceCodeStart":393,"sourceCodeEnd":429,"githubUrl":"https://github.com/didi/DoKit/blob/626827cddb2feb2f3aee87a52a064b4e5ca2bed4/Android/dokit/src/main/java/com/didichuxing/doraemonkit/picasso/Request.java#L393-L429","documentation":"Thrown by Request.Builder.priority(Priority) when the argument is null. Priority must be one of the enum constants (LOW, NORMAL, HIGH, IMMEDIATE); a null priority cannot be ordered in Picasso's request queue, so it fails fast with IllegalArgumentException.","triggerScenarios":"Passing a Priority variable that is null: priority(null), or priority(config.getPriority()) where config has no priority set.","commonSituations":"Mapping an optional priority from remote config / JSON where the field is absent and decodes to null; passing a priority looked up from a Map that misses; refactoring a method signature so null reaches this setter.","solutions":["Default before calling: priority(p != null ? p : Priority.NORMAL).","Use Priority.NORMAL as the default value when parsing optional priority fields.","Annotate the parameter @NonNull in your wrapper so static analysis catches null flows."],"exampleFix":"// before\nPriority p = config.priority; // null when absent\nbuilder.priority(p);\n\n// after\nPriority p = config.priority != null ? config.priority : Priority.NORMAL;\nbuilder.priority(p);","handlingStrategy":"type-guard","validationCode":"if (priority != null) { builder.priority(priority); } else { builder.priority(Priority.NORMAL); }","typeGuard":"static Priority safePriority(Priority p) {\n  return p != null ? p : Priority.NORMAL;\n}","tryCatchPattern":null,"preventionTips":["Default optional priorities to Priority.NORMAL at parse time.","Mark priority parameters @NonNull in wrappers."],"tags":["android","picasso","null-safety","validation","builder"],"backgroundTag":null,"analyzedSha":"626827cddb2feb2f3aee87a52a064b4e5ca2bed4","analyzedAt":"2026-08-14T12:45:58.758Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}