Lines 28-33
Link Here
|
28 |
import org.eclipse.jdt.core.IPackageFragmentRoot; |
28 |
import org.eclipse.jdt.core.IPackageFragmentRoot; |
29 |
import org.eclipse.jdt.core.JavaModelException; |
29 |
import org.eclipse.jdt.core.JavaModelException; |
30 |
import org.eclipse.jdt.internal.compiler.util.ObjectVector; |
30 |
import org.eclipse.jdt.internal.compiler.util.ObjectVector; |
|
|
31 |
import org.eclipse.jdt.internal.core.DeltaProcessor.RootInfo; |
31 |
import org.eclipse.jdt.internal.core.JavaModelManager.PerProjectInfo; |
32 |
import org.eclipse.jdt.internal.core.JavaModelManager.PerProjectInfo; |
32 |
import org.eclipse.jdt.internal.core.search.indexing.IndexManager; |
33 |
import org.eclipse.jdt.internal.core.search.indexing.IndexManager; |
33 |
import org.eclipse.jdt.internal.core.util.Util; |
34 |
import org.eclipse.jdt.internal.core.util.Util; |
Lines 304-310
Link Here
|
304 |
result |= HAS_LIBRARY_CHANGE; |
305 |
result |= HAS_LIBRARY_CHANGE; |
305 |
} |
306 |
} |
306 |
|
307 |
|
307 |
PackageFragmentRoot[] pkgFragmentRoots = null; |
308 |
IPackageFragmentRoot[] pkgFragmentRoots = null; |
308 |
if (removedRoots != null) { |
309 |
if (removedRoots != null) { |
309 |
PackageFragmentRoot oldRoot = (PackageFragmentRoot) removedRoots.get(this.oldResolvedClasspath[i].getPath()); |
310 |
PackageFragmentRoot oldRoot = (PackageFragmentRoot) removedRoots.get(this.oldResolvedClasspath[i].getPath()); |
310 |
if (oldRoot != null) { // use old root if any (could be none if entry wasn't bound) |
311 |
if (oldRoot != null) { // use old root if any (could be none if entry wasn't bound) |
Lines 323-328
Link Here
|
323 |
null, // inside original project |
324 |
null, // inside original project |
324 |
false, // don't retrieve exported roots |
325 |
false, // don't retrieve exported roots |
325 |
null); /*no reverse map*/ |
326 |
null); /*no reverse map*/ |
|
|
327 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=335986 |
328 |
// When a package fragment's corresponding resource is removed from the project, |
329 |
// IJavaProject#computePackageFragmentRoots() doesn't include that entry. Hence |
330 |
// the cache become necessary in such cases. Add the cache to the accumulatedRoots |
331 |
// only when it's not already present. |
332 |
RootInfo rootInfo = (RootInfo) state.oldRoots.get(this.oldResolvedClasspath[i].getPath()); |
333 |
if (rootInfo != null && rootInfo.cache != null) { |
334 |
IPackageFragmentRoot oldRoot = rootInfo.cache; |
335 |
boolean found = false; |
336 |
for (int j = 0; j < accumulatedRoots.size(); j++) { |
337 |
IPackageFragmentRoot root = (IPackageFragmentRoot) accumulatedRoots.elementAt(j); |
338 |
if (!root.getPath().equals(oldRoot.getPath())) { |
339 |
found = true; |
340 |
break; |
341 |
} |
342 |
} |
343 |
if (!found) |
344 |
accumulatedRoots.add(oldRoot); |
345 |
} |
346 |
|
326 |
pkgFragmentRoots = new PackageFragmentRoot[accumulatedRoots.size()]; |
347 |
pkgFragmentRoots = new PackageFragmentRoot[accumulatedRoots.size()]; |
327 |
accumulatedRoots.copyInto(pkgFragmentRoots); |
348 |
accumulatedRoots.copyInto(pkgFragmentRoots); |
328 |
} catch (JavaModelException e) { |
349 |
} catch (JavaModelException e) { |