{"record":{"id":"8032e86fefc00a41","repo":"quarkusio/quarkus","slug":"should-be-implemented","errorCode":null,"errorMessage":"Should be implemented!","messagePattern":"Should be implemented!","errorType":"validation","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/observability-devservices/testlibs/devresource-common/src/main/java/io/quarkus/observability/devresource/DevResourceLifecycleManager.java","lineNumber":63,"sourceCode":"    /**\n     * Should we enable / start this dev resource.\n     * e.g. we could already have actual service running\n     * Each impl should provide its own reason on why it disabled dev service.\n     *\n     * @return true if ok to start new dev service, false otherwise\n     */\n    default boolean enable() {\n        return true;\n    }\n\n    /**\n     * Create container from config.\n     *\n     * @param config the config\n     * @return container id\n     */\n    default Container<T> container(T config) {\n        throw new IllegalStateException(\"Should be implemented!\");\n    }\n\n    /**\n     * Create container from config.\n     *\n     * @param config the config\n     * @param root the all modules config\n     * @return container id\n     */\n    default Container<T> container(T config, ModulesConfiguration root) {\n        return container(config);\n    }\n\n    /**\n     * Deduce current config from params.\n     * If port are too dynamic / configured, it's hard to deduce,\n     * since configuration is not part of the devservice state.\n     * e.g. different ports then usual - Grafana UI is 3000, if you do not use 3000,","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/observability-devservices/testlibs/devresource-common/src/main/java/io/quarkus/observability/devresource/DevResourceLifecycleManager.java#L45-L81","documentation":"DevResourceLifecycleManager.container(T) is a default method intended to be overridden by implementations that know how to create their container from config. The default body throws IllegalStateException('Should be implemented!') to signal that the concrete lifecycle manager forgot to provide container creation logic.","triggerScenarios":"Using (or extending) a DevResourceLifecycleManager that does not override container(config), and the framework invoking the default method during dev-service/test-resource startup.","commonSituations":"Custom observability dev resource manager created by copying a base class without implementing container(); abstract helpers left unimplemented; API version changes where a new method must be overridden.","solutions":["Override container(T config) in your DevResourceLifecycleManager implementation and return a started GenericContainer","Extend a concrete manager subclass that already implements container()","If you don't need a container, override related lifecycle methods to avoid the default being called"],"exampleFix":"// before\nclass MyManager implements DevResourceLifecycleManager<MyConfig> { }\n// after\nclass MyManager implements DevResourceLifecycleManager<MyConfig> {\n    @Override\n    public GenericContainer<?> container(MyConfig config) {\n        return new GenericContainer<>(\"my-image\").withExposedPorts(8080);\n    }\n}","handlingStrategy":"type-guard","validationCode":"DevResourceLifecycleManager<?> m = ...;\n// ensure the concrete class overrides container():\nif (m.getClass().getMethod(\"container\", Object.class).getDeclaringClass() == DevResourceLifecycleManager.class) {\n    throw new IllegalStateException(m.getClass() + \" must override container()\");\n}","typeGuard":"static boolean implementsContainer(DevResourceLifecycleManager<?> m) throws NoSuchMethodException {\n    return m.getClass().getMethod(\"container\", Object.class).getDeclaringClass() != DevResourceLifecycleManager.class;\n}","tryCatchPattern":"try { Container<?> c = manager.container(config); } catch (IllegalStateException e) { if (\"Should be implemented!\".equals(e.getMessage())) { /* use fallback container */ } }","preventionTips":["Always override container() when implementing DevResourceLifecycleManager","Prefer extending a concrete subclass","Add a unit test invoking container(config) on your manager"],"tags":["devservices","testcontainers","unimplemented"],"backgroundTag":"missing-override-implementation","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}