private void buildTree(Location root, TreeNode attach) { if (root != null && root.getChildren() != null) { for (Location child : root.getChildren()) { TreeNode node = new DefaultTreeNode(child, attach); if (logger.isDebugEnabled()) { logger.debug(String.format("Tree node created to bind %s with %s", root, attach)); } buildTree(child, node); } } }