PL-6242 Stack overflow exception is possible when we generate message about unfetched attribute.

#PL-6242
This commit is contained in:
Eugeny Degtyarjov 2015-10-28 07:51:09 +00:00
parent d9a53c41da
commit af48258ef6

View File

@ -41,6 +41,8 @@ public class CubaEntityFetchGroup extends EntityFetchGroup {
if (attributeName == null && entity._persistence_getSession() != null) { // occurs on merge if (attributeName == null && entity._persistence_getSession() != null) { // occurs on merge
return super.onUnfetchedAttribute(entity, null); 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}));
} }
} }