You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Thomas Draier (JIRA)" <ji...@apache.org> on 2010/01/28 12:29:34 UTC

[jira] Created: (JCR-2480) Property definition not properly initialized

Property definition not properly initialized
--------------------------------------------

                 Key: JCR-2480
                 URL: https://issues.apache.org/jira/browse/JCR-2480
             Project: Jackrabbit Content Repository
          Issue Type: Bug
          Components: jackrabbit-core, jackrabbit-spi-commons
    Affects Versions: 2.0-beta6
            Reporter: Thomas Draier
            Priority: Minor


Hi,

When reading property definitions from the repository, the "defaultValues" is not properly initialized by the NodeTypeReader , if no default values has been set . The defaultValues keeps a null value instead of an empty array. This causes problems when calling NodeTypeManager.regiterNodeTypes() - the property definitions are always seen as modified even they don't . A trivial modification is detected and definitions is rewritten everytime. Passing null as default values for the new definitions does not work, as it's replaced by an empty array.

Modifying the initialization of the QPropertyDefinitionBuilder.defaultValues with an empty list , as it's done for valueConstraints, fixes the issues

regards


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (JCR-2480) Property definition not properly initialized

Posted by "Stefan Guggisberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2480?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefan Guggisberg resolved JCR-2480.
------------------------------------

    Resolution: Fixed

resolved as duplicate of JCR-2490

thanks for reporting this issue!

> Property definition not properly initialized
> --------------------------------------------
>
>                 Key: JCR-2480
>                 URL: https://issues.apache.org/jira/browse/JCR-2480
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core, jackrabbit-spi-commons
>    Affects Versions: 2.0-beta6
>            Reporter: Thomas Draier
>            Priority: Minor
>
> Hi,
> When reading property definitions from the repository, the "defaultValues" is not properly initialized by the NodeTypeReader , if no default values has been set . The defaultValues keeps a null value instead of an empty array. This causes problems when calling NodeTypeManager.regiterNodeTypes() - the property definitions are always seen as modified even they don't . A trivial modification is detected and definitions is rewritten everytime. Passing null as default values for the new definitions does not work, as it's replaced by an empty array.
> Modifying the initialization of the QPropertyDefinitionBuilder.defaultValues with an empty list , as it's done for valueConstraints, fixes the issues
> regards

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-2480) Property definition not properly initialized

Posted by "Thomas Draier (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2480?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12828573#action_12828573 ] 

Thomas Draier commented on JCR-2480:
------------------------------------

Hi Marcel,

I'm not using the TemplateBuilderFactory here (which is mainly used by the CndImporter) - i directly register my node types using the registerNodeTypes(NodeTypeDefinition[] ntds, boolean allowUpdate) method . I currently use an empty array in the default values, which is converted to null afterwards when re-reading the definition from the database. If I use a null value instead, it is then stored as an empty array  - the QNodeTypeDefinitionImpl.createQPropertyDefinitions() method make this conversion :

            QValue[] defVls = propDef.getDefaultValues() == null
                    ? QValue.EMPTY_ARRAY
                    : ValueFormat.getQValues(propDef.getDefaultValues(), resolver, qValueFactory);

So in all cases, a change in the definition is detected .. the main question is, what is best to use here for the default values, when no values are set .. ? null or empty array .. ?


> Property definition not properly initialized
> --------------------------------------------
>
>                 Key: JCR-2480
>                 URL: https://issues.apache.org/jira/browse/JCR-2480
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core, jackrabbit-spi-commons
>    Affects Versions: 2.0-beta6
>            Reporter: Thomas Draier
>            Priority: Minor
>
> Hi,
> When reading property definitions from the repository, the "defaultValues" is not properly initialized by the NodeTypeReader , if no default values has been set . The defaultValues keeps a null value instead of an empty array. This causes problems when calling NodeTypeManager.regiterNodeTypes() - the property definitions are always seen as modified even they don't . A trivial modification is detected and definitions is rewritten everytime. Passing null as default values for the new definitions does not work, as it's replaced by an empty array.
> Modifying the initialization of the QPropertyDefinitionBuilder.defaultValues with an empty list , as it's done for valueConstraints, fixes the issues
> regards

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-2480) Property definition not properly initialized

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2480?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12828221#action_12828221 ] 

Marcel Reutegger commented on JCR-2480:
---------------------------------------

I think this is a bug in TemplateBuilderFactory, which returns a empty array even when no default value is present. Note that this is distinct from an empty array.

> Property definition not properly initialized
> --------------------------------------------
>
>                 Key: JCR-2480
>                 URL: https://issues.apache.org/jira/browse/JCR-2480
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core, jackrabbit-spi-commons
>    Affects Versions: 2.0-beta6
>            Reporter: Thomas Draier
>            Priority: Minor
>
> Hi,
> When reading property definitions from the repository, the "defaultValues" is not properly initialized by the NodeTypeReader , if no default values has been set . The defaultValues keeps a null value instead of an empty array. This causes problems when calling NodeTypeManager.regiterNodeTypes() - the property definitions are always seen as modified even they don't . A trivial modification is detected and definitions is rewritten everytime. Passing null as default values for the new definitions does not work, as it's replaced by an empty array.
> Modifying the initialization of the QPropertyDefinitionBuilder.defaultValues with an empty list , as it's done for valueConstraints, fixes the issues
> regards

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.