Bug 300046 ImportTypeDialog is lacking in javadoc
This seems to be a new type that was introduced when the resources work was merged into the 3.x stream. Some stuff is documented but there are other areas that aren't (such as the class itself). I don't even know what a "type" is but I'm pretty sure we're not talking about a Java type. Is this supposed to be public or internal? Please make the necessary changes and polish before the API freeze in M6.
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/ide/dialogs/ImportTypeDialog.java
* FOO will be selected over DIR1, even through the distance between 
	 * the common root and DIR1 is (1), and the distance between the 
	 * common root and FOO is (2).  This is because selecting DIR1 would
	 * cause the location to be relative to its parent.
	 * @param paths
	 * @param target
	 * @return the most appropriate path variable given the context
	 */
	private static String getPreferredVariable(IPath[] paths,
			IContainer target) {
		IPath commonRoot = null;
		for (int i = 0; i < paths.length; i++) {
			if (paths[i] != null) {
				if (commonRoot == null)
					commonRoot = paths[i];
				else  {
					int count = commonRoot.matchingFirstSegments(paths[i]);
					int remainingSegments = commonRoot.segmentCount() - count;
					if (remainingSegments <= 0)
						return null;
					commonRoot = commonRoot.removeLastSegments(remainingSegments);
				}
			}
		}
		
		String mostAppropriate = null;
		String mostAppropriateToParent = null;
		int mostAppropriateCount = Integer.MAX_VALUE;
		int mostAppropriateCountToParent = Integer.MAX_VALUE;
		IPathVariableManager pathVariableManager = target.getProject().getPathVariableManager();