Bug 64897 packages view: not updated when project source folders change [browsing]
RC1 - browsing perspective - smoke test scenario... - import junit.zip into the previously not existing folder 'src' -> packages view shows a number of packages src.junit.framework... with errors - go to the project properties, source page - add 'src' as source folder, accept when asked to remove the project root as source folder - press OK -> the error marks in the packages view are removed -> the packages src... are still visible in the packages view -> they are only removed upon a selection change in the "projects" view
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/PackagesViewHierarchicalContentProvider.java
String fragmentname= fragment.getElementName();
			for (int i= 0; i < children.length; i++) {
				IJavaElement element= children[i];
				if (element instanceof IPackageFragment) {
					IPackageFragment frag= (IPackageFragment) element;
					String name= element.getElementName();
					if (name.length() > fragmentname.length() && name.charAt(fragmentname.length()) == '.' && frag.exists() && !IPackageFragment.DEFAULT_PACKAGE_NAME.equals(fragmentname) && name.startsWith(fragmentname) && !name.equals(fragmentname)) {
						String tail= name.substring(fragmentname.length() + 1); 
						if (!IPackageFragment.DEFAULT_PACKAGE_NAME.equals(tail) && tail.indexOf(".") == -1) { 
							list.add(frag);
						}
					}
				}
			}
		} catch (JavaModelException e) {
			JavaPlugin.log(e);
		}
		return (IPackageFragment[]) list.toArray(new IPackageFragment[list.size()]);
	}
	
	private IPackageFragment[] getTopLevelChildrenByElementName(IJavaElement[] elements){
		List topLevelElements= new ArrayList();
		for (int i= 0; i < elements.length; i++) {
			IJavaElement iJavaElement= elements[i];
			
			if((iJavaElement.getElementName().indexOf(".")==-1) && (iJavaElement instanceof IPackageFragment)){ 
				topLevelElements.add(iJavaElement);
			}
		}	
		return (IPackageFragment[]) topLevelElements.toArray(new IPackageFragment[topLevelElements.size()]);