private static void addPluginDependenciesToFeatureModel(String thisPluginId, Set<String> dependencies,
			Map<String, Map<String, Set<String>>> map, String implies, String comment,
			boolean ignoreVersionsInFeatureModelGeneration) {

		for (String otherPluginDepEntry : dependencies) {

			String otherPluginName = ParsingUtil.getNameFromBundleDependencyEntry(otherPluginDepEntry, true, false);
			if (null != otherPluginName && !"".equalsIgnoreCase(otherPluginName.trim())) {
				// this means that there is some name to it.
				otherPluginName = otherPluginName.trim();

				// check if this is optional. If yes this will not be
				// included.
				if (!otherPluginName.contains(Constants.BUNDLE_DEPDENDENCY_KEYWORD_OPTIONAL)) {
					if (!ignoreVersionsInFeatureModelGeneration) {
						// now doing the check for whether there exists
						// some bundle that falls in the version range
						// specified by the otherPluginDepEntry.
						String versionRangeStr = ParsingUtil.getVersionStrFromBundleDependencyEntry(otherPluginDepEntry);

						try {
							VersionRange versionRange = new VersionRange(versionRangeStr);

							// now getting all Plugin IDs for the plugin name of
							// the dependency entry from the pluginmap.
							if (map.containsKey(otherPluginName)) {
								Set<String> candidatePluginIds = map.get(otherPluginName).keySet();
								for (String candidatePluginId : candidatePluginIds) {
									String candidatePluginVersionStr = parseDepIdForVersion(candidatePluginId);
									Version candidateVersion = new Version(candidatePluginVersionStr);
									if (versionRange.containsQualified(candidateVersion)) // versionRange.includes(candidateVersion))
									{
										String pluginDepFMEntry = thisPluginId.trim() + implies + candidatePluginId.trim()
												+ Constants.DELIM_COMMENT + comment.trim();
										dependenciesFM.add(pluginDepFMEntry);
									}
								}
							}
						} catch (ParseException e) {
							e.printStackTrace();
						}
					} else {
						// not considering the version ranges at all, so
						// skipping the check of whether a plugin exists in the
						// sepcified range.
						String pluginDepFMEntry = thisPluginId.trim() + implies + otherPluginName.trim()
								+ Constants.DELIM_COMMENT + comment.trim();
						pluginDepFMEntry = pluginDepFMEntry.replaceAll("<(.*?)>", "");
						dependenciesFM.add(pluginDepFMEntry);
					}
				}
			}
		}
	}