From 17cd6153973e308e43ca63c7f6c3350c3437edc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Kope=C4=87?= Date: Fri, 7 Nov 2025 23:34:48 +0100 Subject: [PATCH] Fix: Missing javadocs for types in For comprehensions --- vavr/generator/Generator.scala | 7 + vavr/src-gen/main/java/io/vavr/API.java | 324 ++++++++++++++++++++++++ 2 files changed, 331 insertions(+) diff --git a/vavr/generator/Generator.scala b/vavr/generator/Generator.scala index 2060fdce5..23fc653c1 100644 --- a/vavr/generator/Generator.scala +++ b/vavr/generator/Generator.scala @@ -948,10 +948,17 @@ def generateMainClasses(): Unit = { case 2 => BiFunctionType case _ => s"Function$i" } + + val parameterDoc = (if (monadicTypesThatNeedParameter.contains(mtype)) { + s"\n* @param The left-hand type of all {@link $mtype}s" + } else { "" }) + val typeDocs = (1 to i).gen(j => s"* @param component type of {@link $mtype} number $j\n") val args = (1 to i).gen(j => s"? super T$j")(", ") xs""" /$javadoc * For-comprehension with ${i.numerus(mtype)}. + $parameterDoc + $typeDocs */ public static class $forClassName<$generics> { diff --git a/vavr/src-gen/main/java/io/vavr/API.java b/vavr/src-gen/main/java/io/vavr/API.java index f1653a5af..4de6bb305 100644 --- a/vavr/src-gen/main/java/io/vavr/API.java +++ b/vavr/src-gen/main/java/io/vavr/API.java @@ -3649,6 +3649,8 @@ public static For8Validation component type of {@link Iterable} number 1 */ public static class For1 { @@ -3682,6 +3684,9 @@ public Iterator yield() { /** * For-comprehension with two Iterables. + + * @param component type of {@link Iterable} number 1 + * @param component type of {@link Iterable} number 2 */ public static class For2 { @@ -3711,6 +3716,10 @@ public Iterator yield(BiFunction f) /** * For-comprehension with three Iterables. + + * @param component type of {@link Iterable} number 1 + * @param component type of {@link Iterable} number 2 + * @param component type of {@link Iterable} number 3 */ public static class For3 { @@ -3743,6 +3752,11 @@ public Iterator yield(Function3 component type of {@link Iterable} number 1 + * @param component type of {@link Iterable} number 2 + * @param component type of {@link Iterable} number 3 + * @param component type of {@link Iterable} number 4 */ public static class For4 { @@ -3778,6 +3792,12 @@ public Iterator yield(Function4 component type of {@link Iterable} number 1 + * @param component type of {@link Iterable} number 2 + * @param component type of {@link Iterable} number 3 + * @param component type of {@link Iterable} number 4 + * @param component type of {@link Iterable} number 5 */ public static class For5 { @@ -3816,6 +3836,13 @@ public Iterator yield(Function5 component type of {@link Iterable} number 1 + * @param component type of {@link Iterable} number 2 + * @param component type of {@link Iterable} number 3 + * @param component type of {@link Iterable} number 4 + * @param component type of {@link Iterable} number 5 + * @param component type of {@link Iterable} number 6 */ public static class For6 { @@ -3857,6 +3884,14 @@ public Iterator yield(Function6 component type of {@link Iterable} number 1 + * @param component type of {@link Iterable} number 2 + * @param component type of {@link Iterable} number 3 + * @param component type of {@link Iterable} number 4 + * @param component type of {@link Iterable} number 5 + * @param component type of {@link Iterable} number 6 + * @param component type of {@link Iterable} number 7 */ public static class For7 { @@ -3901,6 +3936,15 @@ public Iterator yield(Function7 component type of {@link Iterable} number 1 + * @param component type of {@link Iterable} number 2 + * @param component type of {@link Iterable} number 3 + * @param component type of {@link Iterable} number 4 + * @param component type of {@link Iterable} number 5 + * @param component type of {@link Iterable} number 6 + * @param component type of {@link Iterable} number 7 + * @param component type of {@link Iterable} number 8 */ public static class For8 { @@ -3948,6 +3992,8 @@ public Iterator yield(Function8 component type of {@link Option} number 1 */ public static class For1Option { @@ -3981,6 +4027,9 @@ public Option yield() { /** * For-comprehension with two Options. + + * @param component type of {@link Option} number 1 + * @param component type of {@link Option} number 2 */ public static class For2Option { @@ -4010,6 +4059,10 @@ public Option yield(BiFunction f) { /** * For-comprehension with three Options. + + * @param component type of {@link Option} number 1 + * @param component type of {@link Option} number 2 + * @param component type of {@link Option} number 3 */ public static class For3Option { @@ -4042,6 +4095,11 @@ public Option yield(Function3 component type of {@link Option} number 1 + * @param component type of {@link Option} number 2 + * @param component type of {@link Option} number 3 + * @param component type of {@link Option} number 4 */ public static class For4Option { @@ -4077,6 +4135,12 @@ public Option yield(Function4 component type of {@link Option} number 1 + * @param component type of {@link Option} number 2 + * @param component type of {@link Option} number 3 + * @param component type of {@link Option} number 4 + * @param component type of {@link Option} number 5 */ public static class For5Option { @@ -4115,6 +4179,13 @@ public Option yield(Function5 component type of {@link Option} number 1 + * @param component type of {@link Option} number 2 + * @param component type of {@link Option} number 3 + * @param component type of {@link Option} number 4 + * @param component type of {@link Option} number 5 + * @param component type of {@link Option} number 6 */ public static class For6Option { @@ -4156,6 +4227,14 @@ public Option yield(Function6 component type of {@link Option} number 1 + * @param component type of {@link Option} number 2 + * @param component type of {@link Option} number 3 + * @param component type of {@link Option} number 4 + * @param component type of {@link Option} number 5 + * @param component type of {@link Option} number 6 + * @param component type of {@link Option} number 7 */ public static class For7Option { @@ -4200,6 +4279,15 @@ public Option yield(Function7 component type of {@link Option} number 1 + * @param component type of {@link Option} number 2 + * @param component type of {@link Option} number 3 + * @param component type of {@link Option} number 4 + * @param component type of {@link Option} number 5 + * @param component type of {@link Option} number 6 + * @param component type of {@link Option} number 7 + * @param component type of {@link Option} number 8 */ public static class For8Option { @@ -4247,6 +4335,8 @@ public Option yield(Function8 component type of {@link Future} number 1 */ public static class For1Future { @@ -4280,6 +4370,9 @@ public Future yield() { /** * For-comprehension with two Futures. + + * @param component type of {@link Future} number 1 + * @param component type of {@link Future} number 2 */ public static class For2Future { @@ -4309,6 +4402,10 @@ public Future yield(BiFunction f) { /** * For-comprehension with three Futures. + + * @param component type of {@link Future} number 1 + * @param component type of {@link Future} number 2 + * @param component type of {@link Future} number 3 */ public static class For3Future { @@ -4341,6 +4438,11 @@ public Future yield(Function3 component type of {@link Future} number 1 + * @param component type of {@link Future} number 2 + * @param component type of {@link Future} number 3 + * @param component type of {@link Future} number 4 */ public static class For4Future { @@ -4376,6 +4478,12 @@ public Future yield(Function4 component type of {@link Future} number 1 + * @param component type of {@link Future} number 2 + * @param component type of {@link Future} number 3 + * @param component type of {@link Future} number 4 + * @param component type of {@link Future} number 5 */ public static class For5Future { @@ -4414,6 +4522,13 @@ public Future yield(Function5 component type of {@link Future} number 1 + * @param component type of {@link Future} number 2 + * @param component type of {@link Future} number 3 + * @param component type of {@link Future} number 4 + * @param component type of {@link Future} number 5 + * @param component type of {@link Future} number 6 */ public static class For6Future { @@ -4455,6 +4570,14 @@ public Future yield(Function6 component type of {@link Future} number 1 + * @param component type of {@link Future} number 2 + * @param component type of {@link Future} number 3 + * @param component type of {@link Future} number 4 + * @param component type of {@link Future} number 5 + * @param component type of {@link Future} number 6 + * @param component type of {@link Future} number 7 */ public static class For7Future { @@ -4499,6 +4622,15 @@ public Future yield(Function7 component type of {@link Future} number 1 + * @param component type of {@link Future} number 2 + * @param component type of {@link Future} number 3 + * @param component type of {@link Future} number 4 + * @param component type of {@link Future} number 5 + * @param component type of {@link Future} number 6 + * @param component type of {@link Future} number 7 + * @param component type of {@link Future} number 8 */ public static class For8Future { @@ -4546,6 +4678,8 @@ public Future yield(Function8 component type of {@link Try} number 1 */ public static class For1Try { @@ -4579,6 +4713,9 @@ public Try yield() { /** * For-comprehension with two Trys. + + * @param component type of {@link Try} number 1 + * @param component type of {@link Try} number 2 */ public static class For2Try { @@ -4608,6 +4745,10 @@ public Try yield(BiFunction f) { /** * For-comprehension with three Trys. + + * @param component type of {@link Try} number 1 + * @param component type of {@link Try} number 2 + * @param component type of {@link Try} number 3 */ public static class For3Try { @@ -4640,6 +4781,11 @@ public Try yield(Function3 component type of {@link Try} number 1 + * @param component type of {@link Try} number 2 + * @param component type of {@link Try} number 3 + * @param component type of {@link Try} number 4 */ public static class For4Try { @@ -4675,6 +4821,12 @@ public Try yield(Function4 component type of {@link Try} number 1 + * @param component type of {@link Try} number 2 + * @param component type of {@link Try} number 3 + * @param component type of {@link Try} number 4 + * @param component type of {@link Try} number 5 */ public static class For5Try { @@ -4713,6 +4865,13 @@ public Try yield(Function5 component type of {@link Try} number 1 + * @param component type of {@link Try} number 2 + * @param component type of {@link Try} number 3 + * @param component type of {@link Try} number 4 + * @param component type of {@link Try} number 5 + * @param component type of {@link Try} number 6 */ public static class For6Try { @@ -4754,6 +4913,14 @@ public Try yield(Function6 component type of {@link Try} number 1 + * @param component type of {@link Try} number 2 + * @param component type of {@link Try} number 3 + * @param component type of {@link Try} number 4 + * @param component type of {@link Try} number 5 + * @param component type of {@link Try} number 6 + * @param component type of {@link Try} number 7 */ public static class For7Try { @@ -4798,6 +4965,15 @@ public Try yield(Function7 component type of {@link Try} number 1 + * @param component type of {@link Try} number 2 + * @param component type of {@link Try} number 3 + * @param component type of {@link Try} number 4 + * @param component type of {@link Try} number 5 + * @param component type of {@link Try} number 6 + * @param component type of {@link Try} number 7 + * @param component type of {@link Try} number 8 */ public static class For8Try { @@ -4845,6 +5021,8 @@ public Try yield(Function8 component type of {@link List} number 1 */ public static class For1List { @@ -4878,6 +5056,9 @@ public List yield() { /** * For-comprehension with two Lists. + + * @param component type of {@link List} number 1 + * @param component type of {@link List} number 2 */ public static class For2List { @@ -4907,6 +5088,10 @@ public List yield(BiFunction f) { /** * For-comprehension with three Lists. + + * @param component type of {@link List} number 1 + * @param component type of {@link List} number 2 + * @param component type of {@link List} number 3 */ public static class For3List { @@ -4939,6 +5124,11 @@ public List yield(Function3 component type of {@link List} number 1 + * @param component type of {@link List} number 2 + * @param component type of {@link List} number 3 + * @param component type of {@link List} number 4 */ public static class For4List { @@ -4974,6 +5164,12 @@ public List yield(Function4 component type of {@link List} number 1 + * @param component type of {@link List} number 2 + * @param component type of {@link List} number 3 + * @param component type of {@link List} number 4 + * @param component type of {@link List} number 5 */ public static class For5List { @@ -5012,6 +5208,13 @@ public List yield(Function5 component type of {@link List} number 1 + * @param component type of {@link List} number 2 + * @param component type of {@link List} number 3 + * @param component type of {@link List} number 4 + * @param component type of {@link List} number 5 + * @param component type of {@link List} number 6 */ public static class For6List { @@ -5053,6 +5256,14 @@ public List yield(Function6 component type of {@link List} number 1 + * @param component type of {@link List} number 2 + * @param component type of {@link List} number 3 + * @param component type of {@link List} number 4 + * @param component type of {@link List} number 5 + * @param component type of {@link List} number 6 + * @param component type of {@link List} number 7 */ public static class For7List { @@ -5097,6 +5308,15 @@ public List yield(Function7 component type of {@link List} number 1 + * @param component type of {@link List} number 2 + * @param component type of {@link List} number 3 + * @param component type of {@link List} number 4 + * @param component type of {@link List} number 5 + * @param component type of {@link List} number 6 + * @param component type of {@link List} number 7 + * @param component type of {@link List} number 8 */ public static class For8List { @@ -5144,6 +5364,9 @@ public List yield(Function8 The left-hand type of all {@link Either}s + * @param component type of {@link Either} number 1 */ public static class For1Either { @@ -5177,6 +5400,10 @@ public Either yield() { /** * For-comprehension with two Eithers. + + * @param The left-hand type of all {@link Either}s + * @param component type of {@link Either} number 1 + * @param component type of {@link Either} number 2 */ public static class For2Either { @@ -5206,6 +5433,11 @@ public Either yield(BiFunction f) /** * For-comprehension with three Eithers. + + * @param The left-hand type of all {@link Either}s + * @param component type of {@link Either} number 1 + * @param component type of {@link Either} number 2 + * @param component type of {@link Either} number 3 */ public static class For3Either { @@ -5238,6 +5470,12 @@ public Either yield(Function3 The left-hand type of all {@link Either}s + * @param component type of {@link Either} number 1 + * @param component type of {@link Either} number 2 + * @param component type of {@link Either} number 3 + * @param component type of {@link Either} number 4 */ public static class For4Either { @@ -5273,6 +5511,13 @@ public Either yield(Function4 The left-hand type of all {@link Either}s + * @param component type of {@link Either} number 1 + * @param component type of {@link Either} number 2 + * @param component type of {@link Either} number 3 + * @param component type of {@link Either} number 4 + * @param component type of {@link Either} number 5 */ public static class For5Either { @@ -5311,6 +5556,14 @@ public Either yield(Function5 The left-hand type of all {@link Either}s + * @param component type of {@link Either} number 1 + * @param component type of {@link Either} number 2 + * @param component type of {@link Either} number 3 + * @param component type of {@link Either} number 4 + * @param component type of {@link Either} number 5 + * @param component type of {@link Either} number 6 */ public static class For6Either { @@ -5352,6 +5605,15 @@ public Either yield(Function6 The left-hand type of all {@link Either}s + * @param component type of {@link Either} number 1 + * @param component type of {@link Either} number 2 + * @param component type of {@link Either} number 3 + * @param component type of {@link Either} number 4 + * @param component type of {@link Either} number 5 + * @param component type of {@link Either} number 6 + * @param component type of {@link Either} number 7 */ public static class For7Either { @@ -5396,6 +5658,16 @@ public Either yield(Function7 The left-hand type of all {@link Either}s + * @param component type of {@link Either} number 1 + * @param component type of {@link Either} number 2 + * @param component type of {@link Either} number 3 + * @param component type of {@link Either} number 4 + * @param component type of {@link Either} number 5 + * @param component type of {@link Either} number 6 + * @param component type of {@link Either} number 7 + * @param component type of {@link Either} number 8 */ public static class For8Either { @@ -5443,6 +5715,9 @@ public Either yield(Function8 The left-hand type of all {@link Validation}s + * @param component type of {@link Validation} number 1 */ public static class For1Validation { @@ -5476,6 +5751,10 @@ public Validation yield() { /** * For-comprehension with two Validations. + + * @param The left-hand type of all {@link Validation}s + * @param component type of {@link Validation} number 1 + * @param component type of {@link Validation} number 2 */ public static class For2Validation { @@ -5505,6 +5784,11 @@ public Validation yield(BiFunction The left-hand type of all {@link Validation}s + * @param component type of {@link Validation} number 1 + * @param component type of {@link Validation} number 2 + * @param component type of {@link Validation} number 3 */ public static class For3Validation { @@ -5537,6 +5821,12 @@ public Validation yield(Function3 The left-hand type of all {@link Validation}s + * @param component type of {@link Validation} number 1 + * @param component type of {@link Validation} number 2 + * @param component type of {@link Validation} number 3 + * @param component type of {@link Validation} number 4 */ public static class For4Validation { @@ -5572,6 +5862,13 @@ public Validation yield(Function4 The left-hand type of all {@link Validation}s + * @param component type of {@link Validation} number 1 + * @param component type of {@link Validation} number 2 + * @param component type of {@link Validation} number 3 + * @param component type of {@link Validation} number 4 + * @param component type of {@link Validation} number 5 */ public static class For5Validation { @@ -5610,6 +5907,14 @@ public Validation yield(Function5 The left-hand type of all {@link Validation}s + * @param component type of {@link Validation} number 1 + * @param component type of {@link Validation} number 2 + * @param component type of {@link Validation} number 3 + * @param component type of {@link Validation} number 4 + * @param component type of {@link Validation} number 5 + * @param component type of {@link Validation} number 6 */ public static class For6Validation { @@ -5651,6 +5956,15 @@ public Validation yield(Function6 The left-hand type of all {@link Validation}s + * @param component type of {@link Validation} number 1 + * @param component type of {@link Validation} number 2 + * @param component type of {@link Validation} number 3 + * @param component type of {@link Validation} number 4 + * @param component type of {@link Validation} number 5 + * @param component type of {@link Validation} number 6 + * @param component type of {@link Validation} number 7 */ public static class For7Validation { @@ -5695,6 +6009,16 @@ public Validation yield(Function7 The left-hand type of all {@link Validation}s + * @param component type of {@link Validation} number 1 + * @param component type of {@link Validation} number 2 + * @param component type of {@link Validation} number 3 + * @param component type of {@link Validation} number 4 + * @param component type of {@link Validation} number 5 + * @param component type of {@link Validation} number 6 + * @param component type of {@link Validation} number 7 + * @param component type of {@link Validation} number 8 */ public static class For8Validation {