private void addToParent(final IResource resource){
  final IContainer parent=resource.getParent();
  if (parent == null) {
    return;
  }
  List<IResource> members=memberMap.get(parent);
  if (members == null) {
    members=new ArrayList<IResource>();
    memberMap.put(parent,members);
  }
  if (!members.contains(resource)) {
    members.add(resource);
  }
  addToParent(parent);
}

private void addToParent ( final IResource resource ) { final IContainer parent = resource . getParent ( ) ; if ( parent == null ) { return ; } List < IResource > members = memberMap . get ( parent ) ; if ( members == null ) { members = new ArrayList < IResource > ( ) ; memberMap . put ( parent , members ) ; } if ( ! members . contains ( resource ) ) { members . add ( resource ) ; } addToParent ( parent ) ; }
add the resource as a child of its parent .
