Bug 40793 Primary working copies: Type search does not find type in modified CU
M2 See test cases AllTypesCacheTest.testWorkingCopies() & testWorkingCopies2(): Editor is opened and the type name of the opened type is modfied. testWorkingCopies(): editor is saved: new type is found in index but also old type is still found testWorkingCopies2(): editor is not saved: new type is not found in index
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/AllTypesCacheTest.java
assertTrue("unnecessary flush of cache", AllTypesCache.getNumberOfCacheFlushes() == nFlushes);	
		
		res1.clear();
		AllTypesCache.getTypes(workspaceScope, IJavaSearchConstants.CLASS, null, res1);
		assertTrue("469 classes in workspace expected, is " + res1.size(), res1.size() == 469);
		
		assertTrue("unnecessary flush of cache", AllTypesCache.getNumberOfCacheFlushes() == nFlushes);
		
		res1.clear();
		AllTypesCache.getTypes(proj1Scope, IJavaSearchConstants.TYPE, null, res1);
		assertTrue("471 types in proj1 expected, is " + res1.size(), res1.size() == 471);
		
		assertTrue("unnecessary flush of cache", AllTypesCache.getNumberOfCacheFlushes() == nFlushes);
		
		res1.clear();		
		AllTypesCache.getTypes(proj1Scope, IJavaSearchConstants.INTERFACE, null, res1);
		assertTrue("65 interfaces in proj1 expected, is " + res1.size(), res1.size() == 65);
		
		assertTrue("unnecessary flush of cache", AllTypesCache.getNumberOfCacheFlushes() == nFlushes);
		
		res1.clear();
		AllTypesCache.getTypes(proj1Scope, IJavaSearchConstants.CLASS, null, res1);
		assertTrue("406 classes in proj1 expected, is " + res1.size(), res1.size() == 406);
		
		assertTrue("unnecessary flush of cache", AllTypesCache.getNumberOfCacheFlushes() == nFlushes);
		
		res1.clear();
		AllTypesCache.getTypes(proj2Scope, IJavaSearchConstants.TYPE, null, res1);
		assertTrue("539 types in proj2 expected, is " + res1.size(), res1.size() == 539);