private TreeNode addTopNode(TreeNodeImpl _root, int type, String encodedName, String filePath) { String name = encodedName.substring(7, encodedName.length()); List<TreeNodeImpl> lst = _root.childs.get(name); if (lst == null) { lst = new ArrayList<TreeNodeImpl>(); _root.childs.put(name, lst); } FileEntitiesHolder fh = files.get(filePath); if (fh == null) { fh = new FileEntitiesHolder(filePath); files.put(filePath, fh); } TreeNodeTop node = new TreeNodeTop(_root, encodedName, fh); node.type = type; lst.add(node); return node; }