#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.
This commit is contained in:
Rob Bygrave
2023-03-14 11:56:01 +13:00
parent 4039c20462
commit a2690fdccd
@@ -2395,10 +2395,13 @@ public class DatabaseConfig {
/**
* Deprecated - migrate to classes().
* <p>
* 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<Class<?>> getClasses() {
return new ArrayList<>(classes);
public Set<Class<?>> getClasses() {
return classes;
}
/**