From 6209cec91b457161f982ef835ae18503d0209150 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Tue, 2 Jul 2019 14:56:39 +0200 Subject: [PATCH] [jOOQ/jOOQ#8881] Deprecate internal Tools.filterOne() utility This utility does not go through the ExecuteListener#exception() lifecycle and should thus be avoided. It is difficult to remove completely because of DML RETURNING clauses, which need quite some refactoring for the lifecycle to work correctly. --- jOOQ/src/main/java/org/jooq/impl/Tools.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jOOQ/src/main/java/org/jooq/impl/Tools.java b/jOOQ/src/main/java/org/jooq/impl/Tools.java index 766f46b7e0..d2e981ece0 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Tools.java +++ b/jOOQ/src/main/java/org/jooq/impl/Tools.java @@ -1995,13 +1995,17 @@ final class Tools { /** * Get the only element from a list or null, or throw an - * exception + * exception. * * @param list The list * @return The only element from the list or null * @throws TooManyRowsException Thrown if the list contains more than one * element + * @deprecated - [#8881] - Do not reuse this method as it doesn't properly + * manage the {@link ExecuteListener#exception(ExecuteContext)} + * lifecycle event. Use {@link #fetchOne(Cursor)} instead. */ + @Deprecated static final R filterOne(List list) throws TooManyRowsException { int size = list.size();