Hi,

The contract for NodeTypeDefinition.getDeclaredPropertyDefinitions() says: "In implementations that support node type registration, if this NodeTypeDefinition object is actually a newly-created empty NodeTypeTemplate, then this method will return null."

Why null and not an empty array? Is there a case supporting this behaviour or is this just the implementation leaking into the spec.?

There is even a test case (NodeTypeCreationTest.testEmptyNodeDefinitionTemplate) which specifically tests this part of the contract.

Specifically requiring null asks for additional null checks and complicates the implementation and usage. Here is what I had to do to make NodeTypeCreationTest.testEmptyNodeDefinitionTemplate pass:

http://svn.apache.org/viewvc?view=revision&revision=1384683

While not terribly complex still weird.

Michael

Reply via email to