/**
   * This method gets the include path entries for a given project as a string and returns a
   * "decoded" List of IIncludePathEntrys
   *
   * @param String representing the entries they way they are saved into the preferences
   * @param project
   * @return List of IIncludePathEntrys for a given project
   */
  public static List<IIncludePathEntry> getIncludePathEntriesFromPreferences(
      String entriesString, IProject project) {
    if (entriesString == null || project == null) {
      throw new IllegalArgumentException("Null arguments are not allowed"); // $NON-NLS-1$
    }
    List<IIncludePathEntry> entries = new ArrayList<IIncludePathEntry>();

    Map[] maps = XMLPreferencesReader.getHashFromStoredValue(entriesString);
    if (maps != null) {
      for (Map map : maps) {
        IncludePathEntryDescriptor descriptor = new IncludePathEntryDescriptor();
        descriptor.restoreFromMap(map);
        entries.add(IncludePathEntry.elementDecode(descriptor, project.getFullPath()));
      }
    }
    return entries;
  }
  /**
   * This method gets the include path entries for a given project
   *
   * @param preferenceKey
   * @param project
   * @param projectScope
   * @param workingCopyManager
   * @return List of IIncludePathEntrys for a given project
   */
  public static List<IIncludePathEntry> getIncludePathEntriesFromPreferences(
      Key preferenceKey,
      IProject project,
      ProjectScope projectScope,
      IWorkingCopyManager workingCopyManager) {
    if (preferenceKey == null || project == null || projectScope == null) {
      throw new IllegalArgumentException("Null arguments are not allowed"); // $NON-NLS-1$
    }
    List<IIncludePathEntry> entries = new ArrayList<IIncludePathEntry>();

    Map[] maps = XMLPreferencesReader.read(preferenceKey, projectScope, workingCopyManager);
    if (maps != null) {
      for (Map map : maps) {
        IncludePathEntryDescriptor descriptor = new IncludePathEntryDescriptor();
        descriptor.restoreFromMap(map);
        entries.add(IncludePathEntry.elementDecode(descriptor, project.getFullPath()));
      }
    }
    return entries;
  }