{"record":{"id":"023dd62ccbf007eb","repo":"bumptech/glide","slug":"unrecognized-static-method-name","errorCode":null,"errorMessage":"Unrecognized static method name: {}","messagePattern":"Unrecognized static method name: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"annotation/compiler/src/main/java/com/bumptech/glide/annotation/compiler/RequestOptionsGenerator.java","lineNumber":252,"sourceCode":"   */\n  private static String getInstanceMethodNameFromStaticMethodName(String staticMethodName) {\n    String equivalentInstanceMethodName;\n    if (\"bitmapTransform\".equals(staticMethodName)) {\n      equivalentInstanceMethodName = \"transform\";\n    } else if (\"decodeTypeOf\".equals(staticMethodName)) {\n      equivalentInstanceMethodName = \"decode\";\n    } else if (staticMethodName.endsWith(\"Transform\")) {\n      equivalentInstanceMethodName = staticMethodName.substring(0, staticMethodName.length() - 9);\n    } else if (staticMethodName.endsWith(\"Of\")) {\n      equivalentInstanceMethodName = staticMethodName.substring(0, staticMethodName.length() - 2);\n    } else if (\"noTransformation\".equals(staticMethodName)) {\n      equivalentInstanceMethodName = \"dontTransform\";\n    } else if (\"noAnimation\".equals(staticMethodName)) {\n      equivalentInstanceMethodName = \"dontAnimate\";\n    } else if (staticMethodName.equals(\"option\")) {\n      equivalentInstanceMethodName = \"set\";\n    } else {\n      throw new IllegalArgumentException(\"Unrecognized static method name: \" + staticMethodName);\n    }\n    return equivalentInstanceMethodName;\n  }\n\n  private MethodAndStaticVar generateStaticMethodEquivalentForRequestOptionsStaticMethod(\n      ExecutableElement staticMethod) {\n    boolean memoize = memoizeStaticMethodFromArguments(staticMethod);\n    String staticMethodName = staticMethod.getSimpleName().toString();\n\n    String equivalentInstanceMethodName =\n        getInstanceMethodNameFromStaticMethodName(staticMethodName);\n\n    MethodSpec.Builder methodSpecBuilder =\n        MethodSpec.methodBuilder(staticMethodName)\n            .addModifiers(Modifier.PUBLIC, Modifier.STATIC)\n            .addJavadoc(processorUtil.generateSeeMethodJavadoc(staticMethod))\n            .returns(glideOptionsName);\n","sourceCodeStart":234,"sourceCodeEnd":270,"githubUrl":"https://github.com/bumptech/glide/blob/eb14a895d8f866e6a08c3e19d50ea3bd2c12c20a/annotation/compiler/src/main/java/com/bumptech/glide/annotation/compiler/RequestOptionsGenerator.java#L234-L270","documentation":"Thrown by getInstanceMethodNameFromStaticMethodName() when a static method in RequestOptions/GlideOptions that the generator must wrap has a name that matches none of the recognized patterns (bitmapTransform, decodeTypeOf, *Transform, *Of, noTransformation, noAnimation, option). The generator cannot derive the instance-method name to delegate to.","triggerScenarios":"During code generation the processor iterates the static methods of RequestOptions and maps each name to an instance method. If a static method name falls outside every known pattern, line 252 throws.","commonSituations":"A version mismatch between the glide:compiler (annotation processor) and glide:library artifacts, where the library added a new static method the older compiler does not recognize; using a fork of Glide that renamed/added static methods; processing the wrong RequestOptions class due to dependency shadowing.","solutions":["Align the versions of com.github.bumptech.glide:compiler and com.github.bumptech.glide:glide (and other Glide artifacts) to the same release.","Run a clean build to discard stale generated sources after aligning versions.","If you fork Glide, extend the name-mapping logic in RequestOptionsGenerator for any new static method names you introduce.","Check for dependency shadowing/duplicates with ./gradlew dependencies and exclude conflicting Glide artifacts."],"exampleFix":"// before (versions mismatched)\ndependencies {\n  implementation 'com.github.bumptech.glide:glide:4.16.0'\n  annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'\n}\n\n// after (aligned)\ndependencies {\n  implementation 'com.github.bumptech.glide:glide:4.16.0'\n  annotationProcessor 'com.github.bumptech.glide:compiler:4.16.0'\n}","handlingStrategy":"validation","validationCode":"// Keep Glide artifacts version-aligned to avoid unrecognized static method names.\ndependencies {\n  val glideVer = \"4.16.0\"\n  implementation(\"com.github.bumptech.glide:glide:$glideVer\")\n  annotationProcessor(\"com.github.bumptech.glide:compiler:$glideVer\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin all Glide artifacts (library + compiler) to one version.","Run ./gradlew dependencies to detect duplicate/shadowed Glide artifacts.","Clean the build after aligning versions."],"tags":["annotation-processor","compile-time","version-mismatch","glide-compiler"],"backgroundTag":null,"analyzedSha":"eb14a895d8f866e6a08c3e19d50ea3bd2c12c20a","analyzedAt":"2026-08-14T01:43:54.821Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}