{"record":{"id":"61ef8701cbac9e03","repo":"junit-team/junit5","slug":"parameter-resolution-is-disabled","errorCode":null,"errorMessage":"Parameter resolution is disabled","messagePattern":"Parameter resolution is disabled","errorType":"exception","errorClass":"JUnitException","httpStatus":null,"severity":"error","filePath":"junit-jupiter-params/src/main/java/org/junit/jupiter/params/ArgumentSetLifecycleMethod.java","lineNumber":49,"sourceCode":"\t}\n\n\tArgumentSetLifecycleMethod(Method method, ParameterResolver parameterResolver) {\n\t\tthis.method = Preconditions.notNull(method, \"method must not be null\");\n\t\tthis.parameterResolver = Preconditions.notNull(parameterResolver, \"parameterResolver must not be null\");\n\t}\n\n\tinterface ParameterResolver {\n\n\t\tParameterResolver DISABLED = new ParameterResolver() {\n\t\t\t@Override\n\t\t\tpublic boolean supports(ParameterContext parameterContext) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic Object resolve(ParameterContext parameterContext, ExtensionContext extensionContext,\n\t\t\t\t\tEvaluatedArgumentSet arguments, int invocationIndex, ResolutionCache resolutionCache) {\n\t\t\t\tthrow new JUnitException(\"Parameter resolution is disabled\");\n\t\t\t}\n\t\t};\n\n\t\tboolean supports(ParameterContext parameterContext);\n\n\t\t@Nullable\n\t\tObject resolve(ParameterContext parameterContext, ExtensionContext extensionContext,\n\t\t\t\tEvaluatedArgumentSet arguments, int invocationIndex, ResolutionCache resolutionCache);\n\n\t}\n}\n","sourceCodeStart":31,"sourceCodeEnd":61,"githubUrl":"https://github.com/junit-team/junit5/blob/f070c699a08b5d8393df9afd147af5c5e90bb21b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ArgumentSetLifecycleMethod.java#L31-L61","documentation":"Thrown by the DISABLED singleton ParameterResolver inside ArgumentSetLifecycleMethod when its resolve() method is called. This resolver's supports() always returns false, so resolve() should never be invoked — its sole purpose is to act as a sentinel that prevents parameter resolution for argument-set-level lifecycle methods (like @BeforeEach methods in a @ParameterizedClass context where per-argument-set resolution is not active). Reaching this error means the framework's supports/resolve contract was violated internally.","triggerScenarios":"A lifecycle method (e.g., @BeforeEach) associated with a @ParameterizedClass argument set attempts to resolve parameters when the DISABLED resolver is bound. This should not happen through normal annotation usage because supports() returns false. It would only fire if custom extension code bypassed the supports() check.","commonSituations":"Unreachable through standard JUnit usage. Would indicate a framework-internal bug where a parameter is being resolved without first checking supports(). Developers writing extensions that manually call resolve() without checking supports() first might trigger it.","solutions":["If writing a custom extension, always check ParameterResolver.supports() before calling resolve()","Report as a JUnit internal bug if encountered without custom extensions"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// No user-facing validation — this error indicates an internal contract violation.\n// Ensure any custom extension checks supports() before calling resolve():\n\nif (parameterResolver.supports(parameterContext)) {\n    Object value = parameterResolver.resolve(parameterContext, extensionContext, arguments, index, cache);\n} else {\n    // handle unsupported parameter\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When writing custom ParameterResolver extensions, always check supports() before resolve()","This error should not occur in normal usage — report it as a JUnit bug if encountered"],"tags":["internal","parameter-resolution","lifecycle","junit-params"],"backgroundTag":null,"analyzedSha":"f070c699a08b5d8393df9afd147af5c5e90bb21b","analyzedAt":"2026-08-11T20:31:00.530Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}