code: private void setCompartmentRefForComplexMembers(final Glyph glyph, final Glyph compartment,
                                                      final Set<Glyph> visited)
      {
          if(!visited.add(glyph))
              return;
  
          glyph.setCompartmentRef(compartment);
          if(glyph.getGlyph().size() > 0) {
              for(Glyph g: glyph.getGlyph() ) {
                  setCompartmentRefForComplexMembers(g, compartment, visited);
              }
          }
      }
docs: Recursively sets compartmentRef fields of members of a complex glyph
  to the same value as complex's compartment.
  
  @param glyph target glyph where compartmentRef(compartment parameter) will be set.
  @param compartment compartmentRef value that will be set.
  @param visited (initially an empty set of) previously processed glyphs, to escape infinite loops