{"record":{"id":"266d322db9945335","repo":"junit-team/junit5","slug":"annotationbasedargumentsprovider-does-not-override","errorCode":null,"errorMessage":"AnnotationBasedArgumentsProvider does not override the provideArguments(ParameterDeclarations, ExtensionContext, Annotation) method. Please report this issue to the maintainers of %s.","messagePattern":"AnnotationBasedArgumentsProvider does not override the provideArguments\\(ParameterDeclarations, ExtensionContext, Annotation\\) 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/AnnotationBasedArgumentsProvider.java","lineNumber":79,"sourceCode":"\tpublic Stream<? extends Arguments> provideArguments(ParameterDeclarations parameters, ExtensionContext context) {\n\t\treturn annotations.stream().flatMap(annotation -> provideArguments(parameters, context, annotation));\n\t}\n\n\t/**\n\t * Provide a {@link Stream} of {@link Arguments} &mdash; based on metadata in the\n\t * provided annotation &mdash; to be passed to a {@code @ParameterizedTest} method.\n\t *\n\t * @param context the current extension context; never {@code null}\n\t * @param annotation the annotation to process; never {@code null}\n\t * @return a stream of arguments; never {@code null}\n\t * @deprecated Please implement\n\t * {@link #provideArguments(ParameterDeclarations, ExtensionContext, Annotation)}\n\t * instead.\n\t */\n\t@Deprecated(since = \"5.13\")\n\t@API(status = DEPRECATED, since = \"5.13\")\n\tprotected Stream<? extends Arguments> provideArguments(ExtensionContext context, A annotation) {\n\t\tthrow new JUnitException(\"\"\"\n\t\t\t\tAnnotationBasedArgumentsProvider does not override the \\\n\t\t\t\tprovideArguments(ParameterDeclarations, ExtensionContext, Annotation) method. \\\n\t\t\t\tPlease report this issue to the maintainers of %s.\"\"\".formatted(getClass().getName()));\n\t}\n\n\t/**\n\t * The returned {@code Stream} will be {@link Stream#close() properly closed}\n\t * by the default implementation of\n\t * {@link #provideArguments(ParameterDeclarations, ExtensionContext)},\n\t * making it safe to use a resource such as\n\t * {@link java.nio.file.Files#lines(java.nio.file.Path) Files.lines()}.\n\t */\n\tprotected Stream<? extends Arguments> provideArguments(ParameterDeclarations parameters, ExtensionContext context,\n\t\t\tA annotation) {\n\t\treturn provideArguments(context, annotation);\n\t}\n\n}","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/junit-team/junit5/blob/f070c699a08b5d8393df9afd147af5c5e90bb21b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/AnnotationBasedArgumentsProvider.java#L61-L97","documentation":"Thrown by the deprecated protected provideArguments(ExtensionContext, A) in AnnotationBasedArgumentsProvider when a subclass has not overridden the new provideArguments(ParameterDeclarations, ExtensionContext, Annotation) method introduced in 5.13. The base default now only signals that the subclass must migrate to the new signature. The message asks the user to report the issue to the maintainers of the offending class.","triggerScenarios":"A third-party or custom AnnotationBasedArgumentsProvider subclass overrides only the old 2-arg provideArguments(ExtensionContext, A). When the framework calls the new 3-arg method, the default falls through to the deprecated 2-arg method which throws this JUnitException.","commonSituations":"Upgrading JUnit Jupiter to 5.13+ while using a custom or library-provided ArgumentsProvider that extends AnnotationBasedArgumentsProvider and has not been updated. Using an outdated third-party extension built against pre-5.13 APIs.","solutions":["Override provideArguments(ParameterDeclarations, ExtensionContext, Annotation) in the AnnotationBasedArgumentsProvider subclass.","Upgrade the third-party extension library to a version compatible with JUnit 5.13+.","If the subclass is from a library you do not control, file an issue with the maintainers as the message instructs, using the printed class name."],"exampleFix":"// before\n@Override\nprotected Stream<? extends Arguments> provideArguments(ExtensionContext ctx, MyAnnotation ann) { ... }\n\n// after\n@Override\nprotected Stream<? extends Arguments> provideArguments(ParameterDeclarations params, ExtensionContext ctx, MyAnnotation ann) { ... }","handlingStrategy":"validation","validationCode":"// Reflectively verify the subclass overrides the new method before use\nboolean overridesNew = Arrays.stream(providerClass.getDeclaredMethods())\n    .anyMatch(m -> m.getName().equals(\"provideArguments\")\n        && m.getParameterCount() == 3\n        && m.getParameters()[0].getType() == ParameterDeclarations.class);\nif (!overridesNew) throw new IllegalStateException(\"Provider must override the new provideArguments\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["After upgrading JUnit to 5.13+, audit every AnnotationBasedArgumentsProvider subclass.","Pin third-party extension versions that declare JUnit 5.13+ compatibility.","Compile against the new platform JAR so missing overrides surface at build time."],"tags":["junit-jupiter","arguments-provider","deprecation","migration"],"backgroundTag":null,"analyzedSha":"f070c699a08b5d8393df9afd147af5c5e90bb21b","analyzedAt":"2026-08-11T20:31:00.530Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}