From af48258ef6ca5134ef1d6600982fd1c452617ee1 Mon Sep 17 00:00:00 2001 From: Eugeny Degtyarjov Date: Wed, 28 Oct 2015 07:51:09 +0000 Subject: [PATCH] PL-6242 Stack overflow exception is possible when we generate message about unfetched attribute. #PL-6242 --- .../cuba/core/sys/persistence/CubaEntityFetchGroup.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/global/src/com/haulmont/cuba/core/sys/persistence/CubaEntityFetchGroup.java b/modules/global/src/com/haulmont/cuba/core/sys/persistence/CubaEntityFetchGroup.java index e5138fe58d..8cf0c6b3ee 100644 --- a/modules/global/src/com/haulmont/cuba/core/sys/persistence/CubaEntityFetchGroup.java +++ b/modules/global/src/com/haulmont/cuba/core/sys/persistence/CubaEntityFetchGroup.java @@ -41,6 +41,8 @@ public class CubaEntityFetchGroup extends EntityFetchGroup { if (attributeName == null && entity._persistence_getSession() != null) { // occurs on merge return super.onUnfetchedAttribute(entity, null); } - throw new IllegalEntityStateException(ExceptionLocalization.buildMessage("cannot_get_unfetched_attribute", new Object[]{entity, attributeName})); + + String entityDescriptor = entity.getClass().getName() + "-" + ((BaseGenericIdEntity) entity).getId(); + throw new IllegalEntityStateException(ExceptionLocalization.buildMessage("cannot_get_unfetched_attribute", new Object[]{entityDescriptor, attributeName})); } } \ No newline at end of file