jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dürig <mdue...@apache.org>
Subject NodeTypeDefinition.getDeclaredPropertyDefinitions() contract weirdness!?
Date Fri, 14 Sep 2012 08:36:51 GMT

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

Mime
View raw message