private static void mapResource(WorkItem resource,Map<IProject,List<WorkItem>> projectsMap,boolean checkJavaProject){
  IProject project=resource.getProject();
  if (checkJavaProject && !ProjectUtilities.isJavaProject(project)) {
    return;
  }
  List<WorkItem> resources=projectsMap.get(project);
  if (resources == null) {
    resources=new ArrayList<WorkItem>();
    projectsMap.put(project,resources);
  }
  if (!containsParents(resources,resource)) {
    resources.add(resource);
  }
}

private static void mapResource ( WorkItem resource , Map < IProject , List < WorkItem > > projectsMap , boolean checkJavaProject ) { IProject project = resource . getProject ( ) ; if ( checkJavaProject && ! ProjectUtilities . isJavaProject ( project ) ) { return ; } List < WorkItem > resources = projectsMap . get ( project ) ; if ( resources == null ) { resources = new ArrayList < WorkItem > ( ) ; projectsMap . put ( project , resources ) ; } if ( ! containsParents ( resources , resource ) ) { resources . add ( resource ) ; } }
maps the resource into its project
