restlet/restlet-framework-java — pull request #661 by grammophone (2012-09-26 13:16:23+00:00)
Title: Patch for issue #421: Multiple levels $expand 

In the original code, only one level of $expand is guaranteed to work.
Depending on the cardinality of the expanded relationships, there is a
chance to return null in higher levels. This is also admitted in the
comment at line 417 of the original
restlet/ext/odata/internal/EntityContentHandler.java. This change set
has been checked on version 2.1-RC5. Needs testing before release,
because the complexity of the framework. I would suggest complete
rewrite of these files at some point, because they would not only be
more manageable but also because they contain a design decision wich
causes the processing of the OData stream to have computational burden
O(n * d^2), where n is the number of XML elements in the stream and d is
the maximum $expand depth. This d^2 could be avoided in a new design.
The supplied code probably needs reformatting, as i have different code
formatting conventions.