{"record":{"id":"1e3d4afdd34e19a3","repo":"bumptech/glide","slug":"requested-to-override-an-existing-method-in-basere","errorCode":null,"errorMessage":"Requested to override an existing method in BaseRequestOptions, but no such method was found. Offending method: {}","messagePattern":"Requested to override an existing method in BaseRequestOptions, but no such method was found\\. Offending method: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"annotation/compiler/src/main/java/com/bumptech/glide/annotation/compiler/GlideExtensionValidator.java","lineNumber":160,"sourceCode":"    }\n    return typeMirror instanceof DeclaredType declaredType\n        && declaredType.asElement() instanceof TypeElement typeElement\n        && typeElement\n            .getQualifiedName()\n            .contentEquals(\"com.bumptech.glide.request.BaseRequestOptions\");\n  }\n\n  private void validateGlideOptionOverride(ExecutableElement element) {\n    int overrideType = processorUtil.getOverrideType(element);\n    boolean isOverridingBaseRequestOptionsMethod = isMethodInBaseRequestOptions(element);\n    if (isOverridingBaseRequestOptionsMethod && overrideType == GlideOption.OVERRIDE_NONE) {\n      throw new IllegalArgumentException(\n          \"Accidentally attempting to override a method in\"\n              + \" BaseRequestOptions. Add an 'override' value in the @GlideOption annotation\"\n              + \" if this is intentional. Offending method: \"\n              + getQualifiedMethodName(element));\n    } else if (!isOverridingBaseRequestOptionsMethod && overrideType != GlideOption.OVERRIDE_NONE) {\n      throw new IllegalArgumentException(\n          \"Requested to override an existing method in\"\n              + \" BaseRequestOptions, but no such method was found. Offending method: \"\n              + getQualifiedMethodName(element));\n    }\n  }\n\n  private boolean isMethodInBaseRequestOptions(ExecutableElement toFind) {\n    // toFind is a method in a GlideExtension whose first argument is a BaseRequestOptions<?> type.\n    // Since we're comparing against methods in BaseRequestOptions itself, we need to drop that\n    // first type.\n    TypeElement requestOptionsType =\n        processingEnvironment\n            .getElementUtils()\n            .getTypeElement(RequestOptionsGenerator.BASE_REQUEST_OPTIONS_QUALIFIED_NAME);\n    List<TypeMirror> toFindParameterTypes =\n        getComparableParameterTypes(toFind, /* skipFirst= */ true);\n    String toFindSimpleName = toFind.getSimpleName().toString();\n    for (Element element : requestOptionsType.getEnclosedElements()) {","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/bumptech/glide/blob/eb14a895d8f866e6a08c3e19d50ea3bd2c12c20a/annotation/compiler/src/main/java/com/bumptech/glide/annotation/compiler/GlideExtensionValidator.java#L142-L178","documentation":"The mirror case of error 10: you declared `override = OVERRIDE_EXTEND` or `OVERRIDE_REPLACE` on a @GlideOption method, but no method with the same name and argument types exists in BaseRequestOptions, so there is nothing to extend or replace. The processor refuses to generate super-call/dispatch code against a non-existent method.","triggerScenarios":"GlideExtensionValidator.validateGlideOptionOverride throws in the `else if (!isOverridingBaseRequestOptionsMethod && overrideType != GlideOption.OVERRIDE_NONE)` branch. Hit by annotating a uniquely-named method (e.g. `@GlideOption(override = OVERRIDE_EXTEND) static RequestOptions myAvatar(RequestOptions o, ...)`) — there is no `myAvatar` in BaseRequestOptions.","commonSituations":"Copy-pasting an `override = OVERRIDE_EXTEND` annotation onto a fresh method; refactoring a method name so it no longer matches the BaseRequestOptions method you originally overrode; changing the parameter list so the signature no longer matches.","solutions":["If the method is genuinely new (no matching built-in), drop `override` so it defaults to OVERRIDE_NONE.","If you intended to override, rename your method (and align trailing parameters) to match a real BaseRequestOptions method like `placeholder`, `override`, or `format`."],"exampleFix":"// before\n@GlideOption(override = GlideOption.OVERRIDE_EXTEND)\npublic static RequestOptions myAvatar(RequestOptions options, int resId) {\n  return options.placeholder(resId);\n}\n\n// after (no matching base method -> use OVERRIDE_NONE)\n@GlideOption\npublic static RequestOptions myAvatar(RequestOptions options, int resId) {\n  return options.placeholder(resId);\n}","handlingStrategy":"validation","validationCode":"@Test void glideOptionOverridesTargetExistingMethod() throws Exception {\n  java.util.Set<String> base = new java.util.HashSet<>();\n  for (java.lang.reflect.Method m : com.bumptech.glide.request.BaseRequestOptions.class.getDeclaredMethods()) base.add(m.getName());\n  for (java.lang.reflect.Method m : MyGlideExtension.class.getDeclaredMethods()) {\n    com.bumptech.glide.annotation.GlideOption o = m.getAnnotation(com.bumptech.glide.annotation.GlideOption.class);\n    if (o != null && o.override() != com.bumptech.glide.annotation.GlideOption.OVERRIDE_NONE) {\n      assertTrue(\"@GlideOption(\" + m + \") declares override but no base method exists\", base.contains(m.getName()));\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only set `override` when your method name and trailing args match a real BaseRequestOptions method.","Drop `override` entirely for genuinely new options."],"tags":["glide","annotation-processing","glideoption","override"],"backgroundTag":null,"analyzedSha":"eb14a895d8f866e6a08c3e19d50ea3bd2c12c20a","analyzedAt":"2026-08-14T01:43:54.821Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}