{"record":{"id":"7b7a322c5ac20a54","repo":"bumptech/glide","slug":"expected-non-empty-parameters-for","errorCode":null,"errorMessage":"Expected non-empty parameters for: {}","messagePattern":"Expected non-empty parameters for: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"annotation/compiler/src/main/java/com/bumptech/glide/annotation/compiler/RequestOptionsGenerator.java","lineNumber":387,"sourceCode":"    }\n    boolean memoize = memoizeStaticMethodFromAnnotation(instanceMethod);\n\n    //noinspection ResultOfMethodCallIgnored\n    Preconditions.checkNotNull(staticMethodName);\n    MethodSpec.Builder methodSpecBuilder =\n        MethodSpec.methodBuilder(staticMethodName)\n            .addModifiers(Modifier.PUBLIC, Modifier.STATIC)\n            .addJavadoc(processorUtil.generateSeeMethodJavadoc(instanceMethod))\n            .varargs(instanceMethod.isVarArgs())\n            .returns(glideOptionsName);\n\n    List<? extends VariableElement> parameters = instanceMethod.getParameters();\n\n    // Always remove the first parameter because it's always RequestOptions in extensions. The\n    // actual method we want to generate will pass the RequestOptions in to the extension method,\n    // but should not itself require a RequestOptions object to be passed in.\n    if (parameters.isEmpty()) {\n      throw new IllegalArgumentException(\"Expected non-empty parameters for: \" + instanceMethod);\n    }\n    // Remove is not supported.\n    parameters = parameters.subList(1, parameters.size());\n\n    StringBuilder createNewOptionAndCall =\n        createNewOptionAndCall(\n            memoize, methodSpecBuilder, \"new $T().$L(\", processorUtil.getParameters(parameters));\n\n    FieldSpec requiredStaticField = null;\n    if (memoize) {\n      // Generates code that looks like:\n      // if (GlideOptions.<methodName> == null) {\n      //   GlideOptions.<methodName> = new GlideOptions().<methodName>().autoClone()\n      // }\n\n      // Mix in an incrementing unique id to handle method overloading.\n      String staticVariableName = staticMethodName + nextFieldId++;\n      requiredStaticField =","sourceCodeStart":369,"sourceCodeEnd":405,"githubUrl":"https://github.com/bumptech/glide/blob/eb14a895d8f866e6a08c3e19d50ea3bd2c12c20a/annotation/compiler/src/main/java/com/bumptech/glide/annotation/compiler/RequestOptionsGenerator.java#L369-L405","documentation":"Thrown when generating a static helper for a @GlideOption extension method that declares zero parameters. Glide requires the extension's instance method to take at least one parameter (the RequestOptions/BaseRequestOptions to operate on), which the generator strips before producing the public static method.","triggerScenarios":"generateStaticMethodEquivalentForRequestOptionsStaticMethod() reads instanceMethod.getParameters(); if the list is empty the guard at line 387 fires, because there is no RequestOptions parameter to remove.","commonSituations":"Declaring a @GlideOption method with no arguments at all; mis-copying the extension method signature so the RequestOptions parameter is missing; following an outdated signature example.","solutions":["Add the required BaseRequestOptions/RequestOptions first parameter to the @GlideOption method.","Provide any additional configuration parameters after the options parameter.","Return the modified options object from the method (see error 22).","Rebuild to regenerate the static helper."],"exampleFix":"// before\n@GlideOption\nfun myOption(): RequestOptions // no parameters\n\n// after\n@GlideOption\nfun myOption(options: RequestOptions): RequestOptions {\n  return options.format(DecodeFormat.RGB_565)\n}","handlingStrategy":"validation","validationCode":"// @GlideOption methods require at least the RequestOptions parameter.\n@GlideOption\nfun myOption(options: RequestOptions, radius: Int): RequestOptions {\n  return options.transform(RoundedCorners(radius))\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include the BaseRequestOptions first parameter in @GlideOption methods.","Validate extension method signatures against the current Glide extension contract."],"tags":["annotation-processor","compile-time","glideoption","glideextension","api-contract"],"backgroundTag":null,"analyzedSha":"eb14a895d8f866e6a08c3e19d50ea3bd2c12c20a","analyzedAt":"2026-08-14T01:43:54.821Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}