jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Parvulescu <alex.parvule...@gmail.com>
Subject AbstractNodeState strange loop
Date Tue, 19 Feb 2013 13:17:47 GMT
hi,

I came across this funny looking bit in the AbstractNodeState class [0]:

public Iterable<String> getChildNodeNames() {
  return Iterables.transform(
  getChildNodeEntries(),

and

public Iterable<? extends ChildNodeEntry> getChildNodeEntries() {
  return Iterables.transform(
  getChildNodeNames(),

So it seems that each one references the other :)

I checked and each class that extends AbstractNodeState implements one or
both methods, this code can be quite dangerous.
I'm proposing to remove one implementation from this class. I'd remove
#getChildNodeEntries as it is already implemented by all existing classes
and it is intimately tied to the storage mechanism anyway.


best,
alex

[0]
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeState.java?view=markup#l82

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message