From a2690fdccd0a2aa674a33fd61908dd7bf7f11b8e Mon Sep 17 00:00:00 2001 From: Rob Bygrave Date: Tue, 14 Mar 2023 11:56:01 +1300 Subject: [PATCH] #2995 - Change DatabaseConfig.getClasses() to return a Set The thinking is that it is safer to make this API change rather than to return a shallow copy which you won't be able to detect. --- .../src/main/java/io/ebean/config/DatabaseConfig.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ebean-api/src/main/java/io/ebean/config/DatabaseConfig.java b/ebean-api/src/main/java/io/ebean/config/DatabaseConfig.java index 50a24bdb9..8c25f2014 100644 --- a/ebean-api/src/main/java/io/ebean/config/DatabaseConfig.java +++ b/ebean-api/src/main/java/io/ebean/config/DatabaseConfig.java @@ -2395,10 +2395,13 @@ public class DatabaseConfig { /** * Deprecated - migrate to classes(). + *

+ * Sorry if returning Set rather than List breaks code but it feels safer to + * do that than a subtle change to return a shallow copy which you will not detect. */ @Deprecated - public List> getClasses() { - return new ArrayList<>(classes); + public Set> getClasses() { + return classes; } /**