Lines 366-372
Link Here
|
366 |
* In all cases, add the project's dependents to the list of projects to update |
366 |
* In all cases, add the project's dependents to the list of projects to update |
367 |
* so that the classpath related markers can be updated. |
367 |
* so that the classpath related markers can be updated. |
368 |
*/ |
368 |
*/ |
369 |
private void checkProjectsAndClasspathChanges(IResourceDelta delta) { |
369 |
private void checkProjectsAndClasspathChanges(IResourceDelta delta, JavaProject javaProject) { |
370 |
IResource resource = delta.getResource(); |
370 |
IResource resource = delta.getResource(); |
371 |
IResourceDelta[] children = null; |
371 |
IResourceDelta[] children = null; |
372 |
|
372 |
|
Lines 381-387
Link Here
|
381 |
// - if the project is added or changed this is a noop for projectsBeingDeleted |
381 |
// - if the project is added or changed this is a noop for projectsBeingDeleted |
382 |
// - if the project is closed, it has already lost its java nature |
382 |
// - if the project is closed, it has already lost its java nature |
383 |
IProject project = (IProject)resource; |
383 |
IProject project = (IProject)resource; |
384 |
JavaProject javaProject = (JavaProject)JavaCore.create(project); |
384 |
javaProject = (JavaProject)JavaCore.create(project); |
385 |
switch (delta.getKind()) { |
385 |
switch (delta.getKind()) { |
386 |
case IResourceDelta.ADDED : |
386 |
case IResourceDelta.ADDED : |
387 |
this.manager.forceBatchInitializations(false/*not initAfterLoad*/); |
387 |
this.manager.forceBatchInitializations(false/*not initAfterLoad*/); |
Lines 492-499
Link Here
|
492 |
|
492 |
|
493 |
break; |
493 |
break; |
494 |
case IResource.FOLDER: |
494 |
case IResource.FOLDER: |
495 |
if (delta.getKind() == IResourceDelta.CHANGED) { // look for .jar file change to update classpath |
495 |
switch(delta.getKind()) { |
496 |
children = delta.getAffectedChildren(); |
496 |
case IResourceDelta.CHANGED: |
|
|
497 |
children = delta.getAffectedChildren(); |
498 |
break; |
499 |
case IResourceDelta.ADDED: |
500 |
case IResourceDelta.REMOVED: |
501 |
if (javaProject == null) |
502 |
javaProject = (JavaProject)JavaCore.create(resource.getProject());; |
503 |
|
504 |
if (javaProject.isOnClasspath(resource)) { |
505 |
readRawClasspath(javaProject); |
506 |
} |
507 |
break; |
497 |
} |
508 |
} |
498 |
break; |
509 |
break; |
499 |
case IResource.FILE : |
510 |
case IResource.FILE : |
Lines 514-520
Link Here
|
514 |
//$FALL-THROUGH$ |
525 |
//$FALL-THROUGH$ |
515 |
case IResourceDelta.ADDED : |
526 |
case IResourceDelta.ADDED : |
516 |
case IResourceDelta.REMOVED : |
527 |
case IResourceDelta.REMOVED : |
517 |
javaProject = (JavaProject)JavaCore.create(file.getProject()); |
528 |
if (javaProject == null) |
|
|
529 |
javaProject = (JavaProject)JavaCore.create(file.getProject());; |
518 |
|
530 |
|
519 |
// force to (re)read the .classpath file |
531 |
// force to (re)read the .classpath file |
520 |
// in case of removal (IResourceDelta.REMOVED) this will reset the classpath to its default and create the right delta |
532 |
// in case of removal (IResourceDelta.REMOVED) this will reset the classpath to its default and create the right delta |
Lines 524-530
Link Here
|
524 |
} |
536 |
} |
525 |
this.state.rootsAreStale = true; |
537 |
this.state.rootsAreStale = true; |
526 |
} else if ((rootInfo = rootInfo(file.getFullPath(), kind)) != null && rootInfo.entryKind == IClasspathEntry.CPE_LIBRARY) { |
538 |
} else if ((rootInfo = rootInfo(file.getFullPath(), kind)) != null && rootInfo.entryKind == IClasspathEntry.CPE_LIBRARY) { |
527 |
javaProject = (JavaProject)JavaCore.create(file.getProject()); |
539 |
if (javaProject == null) |
|
|
540 |
javaProject = (JavaProject)JavaCore.create(file.getProject());; |
541 |
|
528 |
javaProject.resetResolvedClasspath(); |
542 |
javaProject.resetResolvedClasspath(); |
529 |
this.state.rootsAreStale = true; |
543 |
this.state.rootsAreStale = true; |
530 |
} |
544 |
} |
Lines 533-539
Link Here
|
533 |
} |
547 |
} |
534 |
if (children != null) { |
548 |
if (children != null) { |
535 |
for (int i = 0; i < children.length; i++) { |
549 |
for (int i = 0; i < children.length; i++) { |
536 |
checkProjectsAndClasspathChanges(children[i]); |
550 |
checkProjectsAndClasspathChanges(children[i], javaProject); |
537 |
} |
551 |
} |
538 |
} |
552 |
} |
539 |
} |
553 |
} |
Lines 2034-2040
Link Here
|
2034 |
try { |
2048 |
try { |
2035 |
try { |
2049 |
try { |
2036 |
stopDeltas(); |
2050 |
stopDeltas(); |
2037 |
checkProjectsAndClasspathChanges(delta); |
2051 |
checkProjectsAndClasspathChanges(delta, null); |
2038 |
|
2052 |
|
2039 |
// generate external archive change deltas |
2053 |
// generate external archive change deltas |
2040 |
if (elementsToRefresh != null) { |
2054 |
if (elementsToRefresh != null) { |