From 0aae42eaf1ea0184f2df2b53d1ca052eeb8c0644 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Wed, 21 Oct 2020 16:36:32 +0200 Subject: [PATCH] [jOOQ/jOOQ#10775] Better play safe, no contravariance in Collector --- jOOQ/src/main/java/org/jooq/Rows.java | 92 +++++++++++++-------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/jOOQ/src/main/java/org/jooq/Rows.java b/jOOQ/src/main/java/org/jooq/Rows.java index f355eaf74b..f95f707bd5 100644 --- a/jOOQ/src/main/java/org/jooq/Rows.java +++ b/jOOQ/src/main/java/org/jooq/Rows.java @@ -60,7 +60,7 @@ public final class Rows { * Create a collector that can collect into an array of {@link RowN}. */ @SafeVarargs - public static Collector collectingArray( + public static Collector collectingArray( Function... functions ) { return Collectors.collectingAndThen(collecting(functions), l -> l.toArray(RowN[]::new)); @@ -70,7 +70,7 @@ public final class Rows { * Create a collector that can collect into a list of {@link RowN}. */ @SafeVarargs - public static Collector> collecting( + public static Collector> collecting( Function... functions ) { return Collector.of( @@ -89,7 +89,7 @@ public final class Rows { * Create a collector that can collect into an array of {@link Row1}. */ @SuppressWarnings("unchecked") - public static Collector[]> collectingArray( + public static Collector[]> collectingArray( Function f1 ) { return Collectors.collectingAndThen(collecting(f1), l -> l.toArray(Row1[]::new)); @@ -98,7 +98,7 @@ public final class Rows { /** * Create a collector that can collect into a list of {@link Row1}. */ - public static Collector>> collecting( + public static Collector>> collecting( Function f1 ) { return Collector.of( @@ -115,7 +115,7 @@ public final class Rows { * Create a collector that can collect into an array of {@link Row2}. */ @SuppressWarnings("unchecked") - public static Collector[]> collectingArray( + public static Collector[]> collectingArray( Function f1, Function f2 ) { @@ -125,7 +125,7 @@ public final class Rows { /** * Create a collector that can collect into a list of {@link Row2}. */ - public static Collector>> collecting( + public static Collector>> collecting( Function f1, Function f2 ) { @@ -143,7 +143,7 @@ public final class Rows { * Create a collector that can collect into an array of {@link Row3}. */ @SuppressWarnings("unchecked") - public static Collector[]> collectingArray( + public static Collector[]> collectingArray( Function f1, Function f2, Function f3 @@ -154,7 +154,7 @@ public final class Rows { /** * Create a collector that can collect into a list of {@link Row3}. */ - public static Collector>> collecting( + public static Collector>> collecting( Function f1, Function f2, Function f3 @@ -173,7 +173,7 @@ public final class Rows { * Create a collector that can collect into an array of {@link Row4}. */ @SuppressWarnings("unchecked") - public static Collector[]> collectingArray( + public static Collector[]> collectingArray( Function f1, Function f2, Function f3, @@ -185,7 +185,7 @@ public final class Rows { /** * Create a collector that can collect into a list of {@link Row4}. */ - public static Collector>> collecting( + public static Collector>> collecting( Function f1, Function f2, Function f3, @@ -205,7 +205,7 @@ public final class Rows { * Create a collector that can collect into an array of {@link Row5}. */ @SuppressWarnings("unchecked") - public static Collector[]> collectingArray( + public static Collector[]> collectingArray( Function f1, Function f2, Function f3, @@ -218,7 +218,7 @@ public final class Rows { /** * Create a collector that can collect into a list of {@link Row5}. */ - public static Collector>> collecting( + public static Collector>> collecting( Function f1, Function f2, Function f3, @@ -239,7 +239,7 @@ public final class Rows { * Create a collector that can collect into an array of {@link Row6}. */ @SuppressWarnings("unchecked") - public static Collector[]> collectingArray( + public static Collector[]> collectingArray( Function f1, Function f2, Function f3, @@ -253,7 +253,7 @@ public final class Rows { /** * Create a collector that can collect into a list of {@link Row6}. */ - public static Collector>> collecting( + public static Collector>> collecting( Function f1, Function f2, Function f3, @@ -275,7 +275,7 @@ public final class Rows { * Create a collector that can collect into an array of {@link Row7}. */ @SuppressWarnings("unchecked") - public static Collector[]> collectingArray( + public static Collector[]> collectingArray( Function f1, Function f2, Function f3, @@ -290,7 +290,7 @@ public final class Rows { /** * Create a collector that can collect into a list of {@link Row7}. */ - public static Collector>> collecting( + public static Collector>> collecting( Function f1, Function f2, Function f3, @@ -313,7 +313,7 @@ public final class Rows { * Create a collector that can collect into an array of {@link Row8}. */ @SuppressWarnings("unchecked") - public static Collector[]> collectingArray( + public static Collector[]> collectingArray( Function f1, Function f2, Function f3, @@ -329,7 +329,7 @@ public final class Rows { /** * Create a collector that can collect into a list of {@link Row8}. */ - public static Collector>> collecting( + public static Collector>> collecting( Function f1, Function f2, Function f3, @@ -353,7 +353,7 @@ public final class Rows { * Create a collector that can collect into an array of {@link Row9}. */ @SuppressWarnings("unchecked") - public static Collector[]> collectingArray( + public static Collector[]> collectingArray( Function f1, Function f2, Function f3, @@ -370,7 +370,7 @@ public final class Rows { /** * Create a collector that can collect into a list of {@link Row9}. */ - public static Collector>> collecting( + public static Collector>> collecting( Function f1, Function f2, Function f3, @@ -395,7 +395,7 @@ public final class Rows { * Create a collector that can collect into an array of {@link Row10}. */ @SuppressWarnings("unchecked") - public static Collector[]> collectingArray( + public static Collector[]> collectingArray( Function f1, Function f2, Function f3, @@ -413,7 +413,7 @@ public final class Rows { /** * Create a collector that can collect into a list of {@link Row10}. */ - public static Collector>> collecting( + public static Collector>> collecting( Function f1, Function f2, Function f3, @@ -439,7 +439,7 @@ public final class Rows { * Create a collector that can collect into an array of {@link Row11}. */ @SuppressWarnings("unchecked") - public static Collector[]> collectingArray( + public static Collector[]> collectingArray( Function f1, Function f2, Function f3, @@ -458,7 +458,7 @@ public final class Rows { /** * Create a collector that can collect into a list of {@link Row11}. */ - public static Collector>> collecting( + public static Collector>> collecting( Function f1, Function f2, Function f3, @@ -485,7 +485,7 @@ public final class Rows { * Create a collector that can collect into an array of {@link Row12}. */ @SuppressWarnings("unchecked") - public static Collector[]> collectingArray( + public static Collector[]> collectingArray( Function f1, Function f2, Function f3, @@ -505,7 +505,7 @@ public final class Rows { /** * Create a collector that can collect into a list of {@link Row12}. */ - public static Collector>> collecting( + public static Collector>> collecting( Function f1, Function f2, Function f3, @@ -533,7 +533,7 @@ public final class Rows { * Create a collector that can collect into an array of {@link Row13}. */ @SuppressWarnings("unchecked") - public static Collector[]> collectingArray( + public static Collector[]> collectingArray( Function f1, Function f2, Function f3, @@ -554,7 +554,7 @@ public final class Rows { /** * Create a collector that can collect into a list of {@link Row13}. */ - public static Collector>> collecting( + public static Collector>> collecting( Function f1, Function f2, Function f3, @@ -583,7 +583,7 @@ public final class Rows { * Create a collector that can collect into an array of {@link Row14}. */ @SuppressWarnings("unchecked") - public static Collector[]> collectingArray( + public static Collector[]> collectingArray( Function f1, Function f2, Function f3, @@ -605,7 +605,7 @@ public final class Rows { /** * Create a collector that can collect into a list of {@link Row14}. */ - public static Collector>> collecting( + public static Collector>> collecting( Function f1, Function f2, Function f3, @@ -635,7 +635,7 @@ public final class Rows { * Create a collector that can collect into an array of {@link Row15}. */ @SuppressWarnings("unchecked") - public static Collector[]> collectingArray( + public static Collector[]> collectingArray( Function f1, Function f2, Function f3, @@ -658,7 +658,7 @@ public final class Rows { /** * Create a collector that can collect into a list of {@link Row15}. */ - public static Collector>> collecting( + public static Collector>> collecting( Function f1, Function f2, Function f3, @@ -689,7 +689,7 @@ public final class Rows { * Create a collector that can collect into an array of {@link Row16}. */ @SuppressWarnings("unchecked") - public static Collector[]> collectingArray( + public static Collector[]> collectingArray( Function f1, Function f2, Function f3, @@ -713,7 +713,7 @@ public final class Rows { /** * Create a collector that can collect into a list of {@link Row16}. */ - public static Collector>> collecting( + public static Collector>> collecting( Function f1, Function f2, Function f3, @@ -745,7 +745,7 @@ public final class Rows { * Create a collector that can collect into an array of {@link Row17}. */ @SuppressWarnings("unchecked") - public static Collector[]> collectingArray( + public static Collector[]> collectingArray( Function f1, Function f2, Function f3, @@ -770,7 +770,7 @@ public final class Rows { /** * Create a collector that can collect into a list of {@link Row17}. */ - public static Collector>> collecting( + public static Collector>> collecting( Function f1, Function f2, Function f3, @@ -803,7 +803,7 @@ public final class Rows { * Create a collector that can collect into an array of {@link Row18}. */ @SuppressWarnings("unchecked") - public static Collector[]> collectingArray( + public static Collector[]> collectingArray( Function f1, Function f2, Function f3, @@ -829,7 +829,7 @@ public final class Rows { /** * Create a collector that can collect into a list of {@link Row18}. */ - public static Collector>> collecting( + public static Collector>> collecting( Function f1, Function f2, Function f3, @@ -863,7 +863,7 @@ public final class Rows { * Create a collector that can collect into an array of {@link Row19}. */ @SuppressWarnings("unchecked") - public static Collector[]> collectingArray( + public static Collector[]> collectingArray( Function f1, Function f2, Function f3, @@ -890,7 +890,7 @@ public final class Rows { /** * Create a collector that can collect into a list of {@link Row19}. */ - public static Collector>> collecting( + public static Collector>> collecting( Function f1, Function f2, Function f3, @@ -925,7 +925,7 @@ public final class Rows { * Create a collector that can collect into an array of {@link Row20}. */ @SuppressWarnings("unchecked") - public static Collector[]> collectingArray( + public static Collector[]> collectingArray( Function f1, Function f2, Function f3, @@ -953,7 +953,7 @@ public final class Rows { /** * Create a collector that can collect into a list of {@link Row20}. */ - public static Collector>> collecting( + public static Collector>> collecting( Function f1, Function f2, Function f3, @@ -989,7 +989,7 @@ public final class Rows { * Create a collector that can collect into an array of {@link Row21}. */ @SuppressWarnings("unchecked") - public static Collector[]> collectingArray( + public static Collector[]> collectingArray( Function f1, Function f2, Function f3, @@ -1018,7 +1018,7 @@ public final class Rows { /** * Create a collector that can collect into a list of {@link Row21}. */ - public static Collector>> collecting( + public static Collector>> collecting( Function f1, Function f2, Function f3, @@ -1055,7 +1055,7 @@ public final class Rows { * Create a collector that can collect into an array of {@link Row22}. */ @SuppressWarnings("unchecked") - public static Collector[]> collectingArray( + public static Collector[]> collectingArray( Function f1, Function f2, Function f3, @@ -1085,7 +1085,7 @@ public final class Rows { /** * Create a collector that can collect into a list of {@link Row22}. */ - public static Collector>> collecting( + public static Collector>> collecting( Function f1, Function f2, Function f3,