{"record":{"id":"3ac8953d744169c4","repo":"junit-team/junit5","slug":"argumentsprovider-does-not-override-the-providearg","errorCode":null,"errorMessage":"ArgumentsProvider does not override the provideArguments(ParameterDeclarations, ExtensionContext) method. Please report this issue to the maintainers of %s.","messagePattern":"ArgumentsProvider does not override the provideArguments\\(ParameterDeclarations, ExtensionContext\\) method\\. Please report this issue to the maintainers of (.+?)\\.","errorType":"exception","errorClass":"JUnitException","httpStatus":null,"severity":"error","filePath":"junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/ArgumentsProvider.java","lineNumber":86,"sourceCode":"\t *\n\t * @param parameters the parameter declarations for the parameterized\n\t * class or test; never {@code null}\n\t * @param context the current extension context; never {@code null}\n\t * @return a stream of arguments; never {@code null}\n\t * @since 5.13\n\t */\n\t@API(status = MAINTAINED, since = \"6.0.2\")\n\tdefault Stream<? extends Arguments> provideArguments(ParameterDeclarations parameters, ExtensionContext context)\n\t\t\tthrows Exception {\n\t\ttry {\n\t\t\treturn provideArguments(context);\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tString message = \"\"\"\n\t\t\t\t\tArgumentsProvider does not override the provideArguments(ParameterDeclarations, ExtensionContext) method. \\\n\t\t\t\t\tPlease report this issue to the maintainers of %s.\"\"\".formatted(\n\t\t\t\tgetClass().getName());\n\t\t\tthrow new JUnitException(message, e);\n\t\t}\n\t}\n\n}\n","sourceCodeStart":68,"sourceCodeEnd":91,"githubUrl":"https://github.com/junit-team/junit5/blob/f070c699a08b5d8393df9afd147af5c5e90bb21b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/ArgumentsProvider.java#L68-L91","documentation":"Thrown by the default provideArguments(ParameterDeclarations, ExtensionContext) on ArgumentsProvider when delegating to the deprecated single-arg method raises any Exception. The bridge catches it and rethrows as JUnitException instructing the user to report to the maintainers of the provider class. It indicates the provider did not override the new method and the legacy fallback path failed.","triggerScenarios":"An ArgumentsProvider subclass that overrides neither the new 2-arg method nor the legacy 1-arg method correctly, causing the legacy default to throw UnsupportedOperationException (or another exception). The bridge in the new default catches that and wraps it.","commonSituations":"Upgrading to JUnit 6.x where the new method is the only maintained entry point. A provider that relied on the deprecated default without implementing anything. Provider whose legacy implementation throws for unrelated reasons.","solutions":["Implement provideArguments(ParameterDeclarations, ExtensionContext) directly in the provider class.","Inspect the wrapped cause exception for the underlying failure (e.g. UnsupportedOperationException) and address it.","Update the provider library to a JUnit 6-compatible release."],"exampleFix":"// before\npublic class MyProvider implements ArgumentsProvider {\n  // no override -> bridge throws\n}\n\n// after\npublic class MyProvider implements ArgumentsProvider {\n  @Override\n  public Stream<? extends Arguments> provideArguments(ParameterDeclarations params, ExtensionContext ctx) {\n    return Stream.of(arguments(\"a\"));\n  }\n}","handlingStrategy":"try-catch","validationCode":"// Inspect provider class for a non-default override of the new method\nMethod m;\ntry {\n    m = providerClass.getMethod(\"provideArguments\", ParameterDeclarations.class, ExtensionContext.class);\n} catch (NoSuchMethodException e) {\n    throw new IllegalStateException(\"provider does not declare the new method\", e);\n}\nif (m.isDefault()) throw new IllegalStateException(\"provider relies on the default bridge\");","typeGuard":null,"tryCatchPattern":"try {\n    provider.provideArguments(parameters, context);\n} catch (JUnitException e) {\n    if (e.getMessage().contains(\"does not override the provideArguments\")) {\n        // migrate the provider or upgrade the extension library\n    }\n    throw e;\n}","preventionTips":["Treat any wrapped exception from ArgumentsProvider as a migration signal on JUnit 6.x.","Keep custom providers' override signatures aligned with the platform version.","Add an integration test that exercises each provider after platform upgrades."],"tags":["junit-jupiter","arguments-provider","deprecation","migration","wrapping"],"backgroundTag":null,"analyzedSha":"f070c699a08b5d8393df9afd147af5c5e90bb21b","analyzedAt":"2026-08-11T20:31:00.530Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}