You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Julian Reschke (JIRA)" <ji...@apache.org> on 2013/06/10 15:52:19 UTC
[jira] [Updated] (JCR-3606) misleading exception message in
ItemSaveOperation.validateTransientItems()
[ https://issues.apache.org/jira/browse/JCR-3606?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Julian Reschke updated JCR-3606:
--------------------------------
Summary: misleading exception message in ItemSaveOperation.validateTransientItems() (was: misleading expepction message in ItemSaveOperation.validateTransientItems())
> misleading exception message in ItemSaveOperation.validateTransientItems()
> --------------------------------------------------------------------------
>
> Key: JCR-3606
> URL: https://issues.apache.org/jira/browse/JCR-3606
> Project: Jackrabbit Content Repository
> Issue Type: Improvement
> Components: jackrabbit-core
> Affects Versions: 2.4.4, 2.6.1, 2.7
> Reporter: Julian Reschke
> Priority: Minor
>
> When checking for mandatory child nodes, the code also checks whether that child node is the expected defining node type. If it does not, the same message as for a *missing* child node is generated:
> String msg = itemMgr.safeGetJCRPath(id)
> + ": mandatory child node " + cnd.getName()
> + " does not exist";
> if (!nodeState.hasChildNodeEntry(cnd.getName())) {
> log.debug(msg);
> throw new ConstraintViolationException(msg);
> } else {
> /*
> there exists a child node with the mandatory-name.
> make sure the node really has the expected mandatory
> node definition.
> */
> boolean hasMandatoryChild = false;
> for (ChildNodeEntry cne : nodeState.getChildNodeEntries(cnd.getName())) {
> ItemData childData = itemMgr.getItemData(cne.getId(), null, false);
> if (childData.getDefinition().isMandatory()) {
> hasMandatoryChild = true;
> break;
> }
> }
> if (!hasMandatoryChild) {
> throw new ConstraintViolationException(msg);
> }
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira