Bug 299207 [CommonNavigator] Refactor NavigatorContentServiceContentProvider
There are a number of things about this code that make it less clear that it needs to be: 1) The internalGetChildren() and getElements() are largely duplicated. 2) The pipelinedChildren() private method returns the localSet which is never modified. 3) A ContributorTrackingSet is used in internalGetChildren() and getElements() when it is not necessary (setContribution() is never called on this, it should be just a LinkedHashSet) 4) The synchronization of methods is inconsistent 5) There are obsolete and unnecessary Javadoc comments 6) The order of the methods makes it hard to understand This refactoring (to be attached) cleans up these issues making the code easier to understand. No functionality change nor bug fix is intended here (except possibly by making the synchronization consistent).
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/NavigatorContentServiceContentProvider.java
* <p>
	 * The results of this method will be displayed in the root of the
	 * TreeViewer.
	 * </p>
	 * {@inheritDoc}
	 * 
	 * @param anInputElement
	 *            The relevant element that a client would like children for -
	 *            the input element of the TreeViewer
	 * @return A non-null array of objects that are logical children of
	 *         anInputElement
	 * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
	 */
	public synchronized Object[] getElements(Object anInputElement) {
		contentService.resetContributionMemory();
		Set rootContentExtensions = contentService
				.findRootContentExtensions(anInputElement);
		if (rootContentExtensions.size() == 0) {
			return NO_CHILDREN;
		}
		ContributorTrackingSet finalElementsSet = new ContributorTrackingSet(contentService);
		ContributorTrackingSet localSet = new ContributorTrackingSet(contentService);		
		Object[] contributedChildren = null;
		NavigatorContentExtension foundExtension;
		NavigatorContentExtension[] overridingExtensions;
		for (Iterator itr = rootContentExtensions.iterator(); itr.hasNext();) {
			foundExtension = (NavigatorContentExtension) itr.next();
			try {
				if (!isOverridingExtensionInSet(foundExtension.getDescriptor(),
						rootContentExtensions)) {