#2418 #2420 BeanState.loadErrors() returns empty map

Change Database.beanState() to throw IllegalArgumentException when bean isn't an entity bean
This commit is contained in:
Rob Bygrave
2021-10-19 11:52:36 +13:00
parent 7862648b83
commit a61c73c62a
4 changed files with 23 additions and 19 deletions
@@ -138,7 +138,6 @@ public interface BeanState {
/**
* Returns a map with load errors.
*/
@Nullable
Map<String, Exception> loadErrors();
/**
@@ -9,11 +9,7 @@ import javax.persistence.PersistenceException;
import java.io.Serializable;
import java.math.BigDecimal;
import java.net.URL;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import java.util.*;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
@@ -1164,7 +1160,7 @@ public final class EntityBeanIntercept implements Serializable {
*/
public Map<String, Exception> getLoadErrors() {
if (loadErrors == null) {
return null;
return Collections.emptyMap();
}
Map<String, Exception> ret = null;
int len = getPropertyLength();