Skip to content

Commit 113e6f7

Browse files
authored
JavaDocs generator fixes (#3341)
1 parent d95b8c3 commit 113e6f7

107 files changed

Lines changed: 2588 additions & 1546 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

vavr/generator/Generator.scala

Lines changed: 104 additions & 60 deletions
Large diffs are not rendered by default.

vavr/src-gen/main/java/io/vavr/API.java

Lines changed: 605 additions & 515 deletions
Large diffs are not rendered by default.

vavr/src-gen/main/java/io/vavr/CheckedFunction0.java

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,6 @@ public interface CheckedFunction0<R extends @Nullable Object> extends Serializab
7676
* // using a lambda reference
7777
* Function1<Integer, Integer> add3 = Function1.of(add1::apply);
7878
* }</pre>
79-
* <p>
80-
* <strong>Caution:</strong> Reflection loses type information of lambda references.
81-
* <pre>{@code // type of a lambda expression
82-
* Type<?, ?> type1 = add1.getType(); // (Integer) -> Integer
83-
*
84-
* // type of a method reference
85-
* Type<?, ?> type2 = add2.getType(); // (Integer) -> Integer
86-
*
87-
* // type of a lambda reference
88-
* Type<?, ?> type3 = add3.getType(); // (Object) -> Object
89-
* }</pre>
9079
*
9180
* @param methodReference (typically) a method reference, e.g. {@code Type::method}
9281
* @param <R> return type
@@ -97,24 +86,28 @@ public interface CheckedFunction0<R extends @Nullable Object> extends Serializab
9786
}
9887

9988
/**
100-
* Lifts the given {@code partialFunction} into a total function that returns an {@code Option} result.
89+
* Lifts the given {@code partialFunction} into a function that returns an {@code Option} result.
10190
*
10291
* @param partialFunction a function that is not defined for all values of the domain (e.g. by throwing)
10392
* @param <R> return type
10493
* @return a function that applies arguments to the given {@code partialFunction} and returns {@code Some(result)}
105-
* if the function is defined for the given arguments, and {@code None} otherwise.
94+
* if the function is defined for the given arguments, and {@code None} if it throws a non-fatal
95+
* throwable. Fatal throwables (see {@link Try}) are rethrown
96+
* instead of being turned into {@code None}.
10697
*/
10798
static <R extends @Nullable Object> Function0<Option<R>> lift(CheckedFunction0<? extends R> partialFunction) {
10899
return () -> Try.<R>of(partialFunction::apply).toOption();
109100
}
110101

111102
/**
112-
* Lifts the given {@code partialFunction} into a total function that returns an {@code Try} result.
103+
* Lifts the given {@code partialFunction} into a function that returns a {@code Try} result.
113104
*
114105
* @param partialFunction a function that is not defined for all values of the domain (e.g. by throwing)
115106
* @param <R> return type
116107
* @return a function that applies arguments to the given {@code partialFunction} and returns {@code Success(result)}
117-
* if the function is defined for the given arguments, and {@code Failure(throwable)} otherwise.
108+
* if the function is defined for the given arguments, and {@code Failure(throwable)} if it throws a
109+
* non-fatal throwable. Fatal throwables (see {@link Try}) are rethrown
110+
* instead of being wrapped.
118111
*/
119112
static <R extends @Nullable Object> Function0<Try<R>> liftTry(CheckedFunction0<? extends R> partialFunction) {
120113
return () -> Try.of(partialFunction::apply);
@@ -177,10 +170,10 @@ default CheckedFunction0<R> reversed() {
177170
}
178171

179172
/**
180-
* Returns a memoizing version of this function, which computes the return value for given arguments only one time.
181-
* On subsequent calls given the same arguments the memoized value is returned.
173+
* Returns a memoizing version of this function, which computes the return value only one time.
174+
* On subsequent calls the memoized value is returned.
182175
* <p>
183-
* Please note that memoizing functions do not permit {@code null} as single argument or return value.
176+
* Note that a {@code null} return value is permitted and cached like any other value.
184177
*
185178
* @return a memoizing function equivalent to this.
186179
*/
@@ -251,7 +244,7 @@ default Function0<R> unchecked() {
251244
}
252245

253246
/**
254-
* Returns a composed function that first applies this CheckedFunction0 to the given argument and then applies
247+
* Returns a composed function that first applies this CheckedFunction0 and then applies
255248
* {@linkplain CheckedFunction1} {@code after} to the result.
256249
*
257250
* @param <V> return type of after

vavr/src-gen/main/java/io/vavr/CheckedFunction1.java

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,6 @@ public interface CheckedFunction1<T1 extends @Nullable Object, R extends @Nullab
7979
* // using a lambda reference
8080
* Function1<Integer, Integer> add3 = Function1.of(add1::apply);
8181
* }</pre>
82-
* <p>
83-
* <strong>Caution:</strong> Reflection loses type information of lambda references.
84-
* <pre>{@code // type of a lambda expression
85-
* Type<?, ?> type1 = add1.getType(); // (Integer) -> Integer
86-
*
87-
* // type of a method reference
88-
* Type<?, ?> type2 = add2.getType(); // (Integer) -> Integer
89-
*
90-
* // type of a lambda reference
91-
* Type<?, ?> type3 = add3.getType(); // (Object) -> Object
92-
* }</pre>
9382
*
9483
* @param methodReference (typically) a method reference, e.g. {@code Type::method}
9584
* @param <R> return type
@@ -101,26 +90,30 @@ public interface CheckedFunction1<T1 extends @Nullable Object, R extends @Nullab
10190
}
10291

10392
/**
104-
* Lifts the given {@code partialFunction} into a total function that returns an {@code Option} result.
93+
* Lifts the given {@code partialFunction} into a function that returns an {@code Option} result.
10594
*
10695
* @param partialFunction a function that is not defined for all values of the domain (e.g. by throwing)
10796
* @param <R> return type
10897
* @param <T1> 1st argument
10998
* @return a function that applies arguments to the given {@code partialFunction} and returns {@code Some(result)}
110-
* if the function is defined for the given arguments, and {@code None} otherwise.
99+
* if the function is defined for the given arguments, and {@code None} if it throws a non-fatal
100+
* throwable. Fatal throwables (see {@link Try}) are rethrown
101+
* instead of being turned into {@code None}.
111102
*/
112103
static <T1 extends @Nullable Object, R extends @Nullable Object> Function1<T1, Option<R>> lift(CheckedFunction1<? super T1, ? extends R> partialFunction) {
113104
return t1 -> Try.<R>of(() -> partialFunction.apply(t1)).toOption();
114105
}
115106

116107
/**
117-
* Lifts the given {@code partialFunction} into a total function that returns an {@code Try} result.
108+
* Lifts the given {@code partialFunction} into a function that returns a {@code Try} result.
118109
*
119110
* @param partialFunction a function that is not defined for all values of the domain (e.g. by throwing)
120111
* @param <R> return type
121112
* @param <T1> 1st argument
122113
* @return a function that applies arguments to the given {@code partialFunction} and returns {@code Success(result)}
123-
* if the function is defined for the given arguments, and {@code Failure(throwable)} otherwise.
114+
* if the function is defined for the given arguments, and {@code Failure(throwable)} if it throws a
115+
* non-fatal throwable. Fatal throwables (see {@link Try}) are rethrown
116+
* instead of being wrapped.
124117
*/
125118
static <T1 extends @Nullable Object, R extends @Nullable Object> Function1<T1, Try<R>> liftTry(CheckedFunction1<? super T1, ? extends R> partialFunction) {
126119
return t1 -> Try.of(() -> partialFunction.apply(t1));
@@ -198,7 +191,8 @@ default CheckedFunction1<T1, R> reversed() {
198191
* Returns a memoizing version of this function, which computes the return value for given arguments only one time.
199192
* On subsequent calls given the same arguments the memoized value is returned.
200193
* <p>
201-
* Please note that memoizing functions do not permit {@code null} as single argument or return value.
194+
* Note that {@code null} arguments and {@code null} return values are permitted; a {@code null} result
195+
* is cached like any other value.
202196
*
203197
* @return a memoizing function equivalent to this.
204198
*/

vavr/src-gen/main/java/io/vavr/CheckedFunction2.java

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -82,17 +82,6 @@ public interface CheckedFunction2<T1 extends @Nullable Object, T2 extends @Nulla
8282
* // using a lambda reference
8383
* Function1<Integer, Integer> add3 = Function1.of(add1::apply);
8484
* }</pre>
85-
* <p>
86-
* <strong>Caution:</strong> Reflection loses type information of lambda references.
87-
* <pre>{@code // type of a lambda expression
88-
* Type<?, ?> type1 = add1.getType(); // (Integer) -> Integer
89-
*
90-
* // type of a method reference
91-
* Type<?, ?> type2 = add2.getType(); // (Integer) -> Integer
92-
*
93-
* // type of a lambda reference
94-
* Type<?, ?> type3 = add3.getType(); // (Object) -> Object
95-
* }</pre>
9685
*
9786
* @param methodReference (typically) a method reference, e.g. {@code Type::method}
9887
* @param <R> return type
@@ -105,28 +94,32 @@ public interface CheckedFunction2<T1 extends @Nullable Object, T2 extends @Nulla
10594
}
10695

10796
/**
108-
* Lifts the given {@code partialFunction} into a total function that returns an {@code Option} result.
97+
* Lifts the given {@code partialFunction} into a function that returns an {@code Option} result.
10998
*
11099
* @param partialFunction a function that is not defined for all values of the domain (e.g. by throwing)
111100
* @param <R> return type
112101
* @param <T1> 1st argument
113102
* @param <T2> 2nd argument
114103
* @return a function that applies arguments to the given {@code partialFunction} and returns {@code Some(result)}
115-
* if the function is defined for the given arguments, and {@code None} otherwise.
104+
* if the function is defined for the given arguments, and {@code None} if it throws a non-fatal
105+
* throwable. Fatal throwables (see {@link Try}) are rethrown
106+
* instead of being turned into {@code None}.
116107
*/
117108
static <T1 extends @Nullable Object, T2 extends @Nullable Object, R extends @Nullable Object> Function2<T1, T2, Option<R>> lift(CheckedFunction2<? super T1, ? super T2, ? extends R> partialFunction) {
118109
return (t1, t2) -> Try.<R>of(() -> partialFunction.apply(t1, t2)).toOption();
119110
}
120111

121112
/**
122-
* Lifts the given {@code partialFunction} into a total function that returns an {@code Try} result.
113+
* Lifts the given {@code partialFunction} into a function that returns a {@code Try} result.
123114
*
124115
* @param partialFunction a function that is not defined for all values of the domain (e.g. by throwing)
125116
* @param <R> return type
126117
* @param <T1> 1st argument
127118
* @param <T2> 2nd argument
128119
* @return a function that applies arguments to the given {@code partialFunction} and returns {@code Success(result)}
129-
* if the function is defined for the given arguments, and {@code Failure(throwable)} otherwise.
120+
* if the function is defined for the given arguments, and {@code Failure(throwable)} if it throws a
121+
* non-fatal throwable. Fatal throwables (see {@link Try}) are rethrown
122+
* instead of being wrapped.
130123
*/
131124
static <T1 extends @Nullable Object, T2 extends @Nullable Object, R extends @Nullable Object> Function2<T1, T2, Try<R>> liftTry(CheckedFunction2<? super T1, ? super T2, ? extends R> partialFunction) {
132125
return (t1, t2) -> Try.of(() -> partialFunction.apply(t1, t2));
@@ -206,7 +199,8 @@ default CheckedFunction2<T2, T1, R> reversed() {
206199
* Returns a memoizing version of this function, which computes the return value for given arguments only one time.
207200
* On subsequent calls given the same arguments the memoized value is returned.
208201
* <p>
209-
* Please note that memoizing functions do not permit {@code null} as single argument or return value.
202+
* Note that {@code null} arguments and {@code null} return values are permitted; a {@code null} result
203+
* is cached like any other value.
210204
*
211205
* @return a memoizing function equivalent to this.
212206
*/
@@ -280,7 +274,7 @@ default Function2<T1, T2, R> unchecked() {
280274
}
281275

282276
/**
283-
* Returns a composed function that first applies this CheckedFunction2 to the given argument and then applies
277+
* Returns a composed function that first applies this CheckedFunction2 to the given arguments and then applies
284278
* {@linkplain CheckedFunction1} {@code after} to the result.
285279
*
286280
* @param <V> return type of after

vavr/src-gen/main/java/io/vavr/CheckedFunction3.java

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,6 @@ public interface CheckedFunction3<T1 extends @Nullable Object, T2 extends @Nulla
8383
* // using a lambda reference
8484
* Function1<Integer, Integer> add3 = Function1.of(add1::apply);
8585
* }</pre>
86-
* <p>
87-
* <strong>Caution:</strong> Reflection loses type information of lambda references.
88-
* <pre>{@code // type of a lambda expression
89-
* Type<?, ?> type1 = add1.getType(); // (Integer) -> Integer
90-
*
91-
* // type of a method reference
92-
* Type<?, ?> type2 = add2.getType(); // (Integer) -> Integer
93-
*
94-
* // type of a lambda reference
95-
* Type<?, ?> type3 = add3.getType(); // (Object) -> Object
96-
* }</pre>
9786
*
9887
* @param methodReference (typically) a method reference, e.g. {@code Type::method}
9988
* @param <R> return type
@@ -107,30 +96,34 @@ public interface CheckedFunction3<T1 extends @Nullable Object, T2 extends @Nulla
10796
}
10897

10998
/**
110-
* Lifts the given {@code partialFunction} into a total function that returns an {@code Option} result.
99+
* Lifts the given {@code partialFunction} into a function that returns an {@code Option} result.
111100
*
112101
* @param partialFunction a function that is not defined for all values of the domain (e.g. by throwing)
113102
* @param <R> return type
114103
* @param <T1> 1st argument
115104
* @param <T2> 2nd argument
116105
* @param <T3> 3rd argument
117106
* @return a function that applies arguments to the given {@code partialFunction} and returns {@code Some(result)}
118-
* if the function is defined for the given arguments, and {@code None} otherwise.
107+
* if the function is defined for the given arguments, and {@code None} if it throws a non-fatal
108+
* throwable. Fatal throwables (see {@link Try}) are rethrown
109+
* instead of being turned into {@code None}.
119110
*/
120111
static <T1 extends @Nullable Object, T2 extends @Nullable Object, T3 extends @Nullable Object, R extends @Nullable Object> Function3<T1, T2, T3, Option<R>> lift(CheckedFunction3<? super T1, ? super T2, ? super T3, ? extends R> partialFunction) {
121112
return (t1, t2, t3) -> Try.<R>of(() -> partialFunction.apply(t1, t2, t3)).toOption();
122113
}
123114

124115
/**
125-
* Lifts the given {@code partialFunction} into a total function that returns an {@code Try} result.
116+
* Lifts the given {@code partialFunction} into a function that returns a {@code Try} result.
126117
*
127118
* @param partialFunction a function that is not defined for all values of the domain (e.g. by throwing)
128119
* @param <R> return type
129120
* @param <T1> 1st argument
130121
* @param <T2> 2nd argument
131122
* @param <T3> 3rd argument
132123
* @return a function that applies arguments to the given {@code partialFunction} and returns {@code Success(result)}
133-
* if the function is defined for the given arguments, and {@code Failure(throwable)} otherwise.
124+
* if the function is defined for the given arguments, and {@code Failure(throwable)} if it throws a
125+
* non-fatal throwable. Fatal throwables (see {@link Try}) are rethrown
126+
* instead of being wrapped.
134127
*/
135128
static <T1 extends @Nullable Object, T2 extends @Nullable Object, T3 extends @Nullable Object, R extends @Nullable Object> Function3<T1, T2, T3, Try<R>> liftTry(CheckedFunction3<? super T1, ? super T2, ? super T3, ? extends R> partialFunction) {
136129
return (t1, t2, t3) -> Try.of(() -> partialFunction.apply(t1, t2, t3));
@@ -223,7 +216,8 @@ default CheckedFunction3<T3, T2, T1, R> reversed() {
223216
* Returns a memoizing version of this function, which computes the return value for given arguments only one time.
224217
* On subsequent calls given the same arguments the memoized value is returned.
225218
* <p>
226-
* Please note that memoizing functions do not permit {@code null} as single argument or return value.
219+
* Note that {@code null} arguments and {@code null} return values are permitted; a {@code null} result
220+
* is cached like any other value.
227221
*
228222
* @return a memoizing function equivalent to this.
229223
*/
@@ -297,7 +291,7 @@ default Function3<T1, T2, T3, R> unchecked() {
297291
}
298292

299293
/**
300-
* Returns a composed function that first applies this CheckedFunction3 to the given argument and then applies
294+
* Returns a composed function that first applies this CheckedFunction3 to the given arguments and then applies
301295
* {@linkplain CheckedFunction1} {@code after} to the result.
302296
*
303297
* @param <V> return type of after

0 commit comments

Comments
 (0)