{"record":{"id":"f49ef283f7be2e75","repo":"OpenFeign/feign","slug":"method-s-should-not-be-called","errorCode":null,"errorMessage":"Method \"%s\" should not be called","messagePattern":"Method \"(.+?)\" should not be called","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/feign/ReflectiveFeign.java","lineNumber":100,"sourceCode":"      this.dispatch = checkNotNull(dispatch, \"dispatch for %s\", target);\n    }\n\n    @Override\n    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {\n      if (\"equals\".equals(method.getName())) {\n        try {\n          Object otherHandler =\n              args.length > 0 && args[0] != null ? Proxy.getInvocationHandler(args[0]) : null;\n          return equals(otherHandler);\n        } catch (IllegalArgumentException e) {\n          return false;\n        }\n      } else if (\"hashCode\".equals(method.getName())) {\n        return hashCode();\n      } else if (\"toString\".equals(method.getName())) {\n        return toString();\n      } else if (!dispatch.containsKey(method)) {\n        throw new UnsupportedOperationException(\n            String.format(\"Method \\\"%s\\\" should not be called\", method.getName()));\n      }\n\n      return dispatch.get(method).invoke(args);\n    }\n\n    @Override\n    public boolean equals(Object obj) {\n      if (obj instanceof FeignInvocationHandler) {\n        FeignInvocationHandler other = (FeignInvocationHandler) obj;\n        return target.equals(other.target);\n      }\n      return false;\n    }\n\n    @Override\n    public int hashCode() {\n      return target.hashCode();","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/OpenFeign/feign/blob/e2a1e27560a1e68840c34f031afca88b36096e30/core/src/main/java/feign/ReflectiveFeign.java#L82-L118","documentation":"Thrown by the FeignInvocationHandler's invoke method when a method marked as ignored in the interface metadata is invoked on the Feign proxy. Feign builds a dispatch table per method; methods annotated to be ignored (e.g. via @FeignIgnore or ignored configuration) have no handler, so calling them on the proxy is a programming/configuration error rather than an HTTP failure. The \"equals\"/\"hashCode\"/\"toString\" Object methods are intercepted separately, so any other method without a dispatch entry reaches this error.","triggerScenarios":"Thrown at core/src/main/java/feign/ReflectiveFeign.java:100 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the ignore annotation/configuration for the method so Feign generates a real handler for it","Stop calling the ignored method on the Feign proxy; invoke it on a concrete implementation instead","Check the target interface for stale methods left behind after configuration changes","Verify the Contract being used actually processes the method's annotations and produces metadata"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e2a1e27560a1e68840c34f031afca88b36096e30","analyzedAt":"2026-09-10T12:37:37.238Z","contentChangedAt":"2026-09-10T12:37:37.238Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}